Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
5 : * This Source Code Form is subject to the terms of the Mozilla Public
6 : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
11 : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : * contributor license agreements. See the NOTICE file distributed
13 : * with this work for additional information regarding copyright
14 : * ownership. The ASF licenses this file to you under the Apache
15 : * License, Version 2.0 (the "License"); you may not use this file
16 : * except in compliance with the License. You may obtain a copy of
17 : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : */
19 :
20 : #ifndef _SFXRNGITEM_HXX
21 :
22 : #ifndef NUMTYPE
23 :
24 : #define NUMTYPE sal_uInt16
25 : #define SfxXRangeItem SfxRangeItem
26 : #define SfxXRangesItem SfxUShortRangesItem
27 : #include <svl/rngitem.hxx>
28 : #undef NUMTYPE
29 : #undef SfxXRangeItem
30 : #undef SfxXRangesItem
31 :
32 : #define _SFXRNGITEM_HXX
33 :
34 : #else
35 : #include "svl/svldllapi.h"
36 : #include <svl/poolitem.hxx>
37 :
38 : class SvStream;
39 :
40 : // -----------------------------------------------------------------------
41 :
42 : class SVL_DLLPUBLIC SfxXRangeItem : public SfxPoolItem
43 : {
44 : private:
45 : NUMTYPE nFrom;
46 : NUMTYPE nTo;
47 : public:
48 : TYPEINFO();
49 : SfxXRangeItem();
50 : SfxXRangeItem( sal_uInt16 nWID, NUMTYPE nFrom, NUMTYPE nTo );
51 : SfxXRangeItem( const SfxXRangeItem& rItem );
52 : virtual int operator==( const SfxPoolItem& ) const;
53 : virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
54 : SfxMapUnit eCoreMetric,
55 : SfxMapUnit ePresMetric,
56 : XubString &rText,
57 : const IntlWrapper * = 0 ) const;
58 : virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
59 0 : inline NUMTYPE& From() { return nFrom; }
60 : inline NUMTYPE From() const { return nFrom; }
61 : inline NUMTYPE& To() { return nTo; }
62 : inline NUMTYPE To() const { return nTo; }
63 : inline sal_Bool HasRange() const { return nTo>nFrom; }
64 : virtual SfxPoolItem* Create( SvStream &, sal_uInt16 nVersion ) const;
65 : virtual SvStream& Store( SvStream &, sal_uInt16 nItemVersion ) const;
66 : };
67 :
68 : // -----------------------------------------------------------------------
69 :
70 : class SVL_DLLPUBLIC SfxXRangesItem : public SfxPoolItem
71 : {
72 : private:
73 : NUMTYPE* _pRanges;
74 :
75 : public:
76 : TYPEINFO();
77 : SfxXRangesItem();
78 : SfxXRangesItem( sal_uInt16 nWID, SvStream &rStream );
79 : SfxXRangesItem( const SfxXRangesItem& rItem );
80 : virtual ~SfxXRangesItem();
81 : virtual int operator==( const SfxPoolItem& ) const;
82 : virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
83 : SfxMapUnit eCoreMetric,
84 : SfxMapUnit ePresMetric,
85 : XubString &rText,
86 : const IntlWrapper * = 0 ) const;
87 : virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
88 : inline const NUMTYPE* GetRanges() const { return _pRanges; }
89 : virtual SfxPoolItem* Create( SvStream &, sal_uInt16 nVersion ) const;
90 : virtual SvStream& Store( SvStream &, sal_uInt16 nItemVersion ) const;
91 : };
92 :
93 : #endif
94 : #endif
95 :
96 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|