xref: /trunk/main/svl/inc/svl/rngitem.hxx (revision 39a19a47)
1*39a19a47SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*39a19a47SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*39a19a47SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*39a19a47SAndrew Rist  * distributed with this work for additional information
6*39a19a47SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*39a19a47SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*39a19a47SAndrew Rist  * "License"); you may not use this file except in compliance
9*39a19a47SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*39a19a47SAndrew Rist  *
11*39a19a47SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*39a19a47SAndrew Rist  *
13*39a19a47SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*39a19a47SAndrew Rist  * software distributed under the License is distributed on an
15*39a19a47SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*39a19a47SAndrew Rist  * KIND, either express or implied.  See the License for the
17*39a19a47SAndrew Rist  * specific language governing permissions and limitations
18*39a19a47SAndrew Rist  * under the License.
19*39a19a47SAndrew Rist  *
20*39a19a47SAndrew Rist  *************************************************************/
21*39a19a47SAndrew Rist 
22*39a19a47SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef _SFXRNGITEM_HXX
25cdf0e10cSrcweir 
26cdf0e10cSrcweir #ifndef NUMTYPE
27cdf0e10cSrcweir 
28cdf0e10cSrcweir #define NUMTYPE	sal_uInt16
29cdf0e10cSrcweir #define SfxXRangeItem SfxRangeItem
30cdf0e10cSrcweir #define SfxXRangesItem SfxUShortRangesItem
31cdf0e10cSrcweir #include <svl/rngitem.hxx>
32cdf0e10cSrcweir #undef NUMTYPE
33cdf0e10cSrcweir #undef SfxXRangeItem
34cdf0e10cSrcweir #undef SfxXRangesItem
35cdf0e10cSrcweir 
36cdf0e10cSrcweir #ifndef _SFXITEMS_HXX
37cdf0e10cSrcweir #define NUMTYPE	sal_uLong
38cdf0e10cSrcweir #define SfxXRangeItem SfxULongRangeItem
39cdf0e10cSrcweir #define SfxXRangesItem SfxULongRangesItem
40cdf0e10cSrcweir #include <svl/rngitem.hxx>
41cdf0e10cSrcweir #undef NUMTYPE
42cdf0e10cSrcweir #undef SfxXRangeItem
43cdf0e10cSrcweir #undef SfxXRangesItem
44cdf0e10cSrcweir #endif
45cdf0e10cSrcweir 
46cdf0e10cSrcweir #define _SFXRNGITEM_HXX
47cdf0e10cSrcweir 
48cdf0e10cSrcweir #else
49cdf0e10cSrcweir #include "svl/svldllapi.h"
50cdf0e10cSrcweir #include <svl/poolitem.hxx>
51cdf0e10cSrcweir 
52cdf0e10cSrcweir class SvStream;
53cdf0e10cSrcweir 
54cdf0e10cSrcweir // -----------------------------------------------------------------------
55cdf0e10cSrcweir 
56cdf0e10cSrcweir class SVL_DLLPUBLIC SfxXRangeItem : public SfxPoolItem
57cdf0e10cSrcweir {
58cdf0e10cSrcweir private:
59cdf0e10cSrcweir 	NUMTYPE 					nFrom;
60cdf0e10cSrcweir 	NUMTYPE 					nTo;
61cdf0e10cSrcweir public:
62cdf0e10cSrcweir 								TYPEINFO();
63cdf0e10cSrcweir 								SfxXRangeItem();
64cdf0e10cSrcweir 								SfxXRangeItem( sal_uInt16 nWID, NUMTYPE nFrom, NUMTYPE nTo );
65cdf0e10cSrcweir 								SfxXRangeItem( sal_uInt16 nWID, SvStream &rStream );
66cdf0e10cSrcweir 								SfxXRangeItem( const SfxXRangeItem& rItem );
67cdf0e10cSrcweir 	virtual int 				operator==( const SfxPoolItem& ) const;
68cdf0e10cSrcweir 	virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
69cdf0e10cSrcweir 									SfxMapUnit eCoreMetric,
70cdf0e10cSrcweir 									SfxMapUnit ePresMetric,
71cdf0e10cSrcweir 									XubString &rText,
72cdf0e10cSrcweir                                     const IntlWrapper * = 0 ) const;
73cdf0e10cSrcweir 	virtual SfxPoolItem*    	Clone( SfxItemPool *pPool = 0 ) const;
From()74cdf0e10cSrcweir 	inline NUMTYPE&				From() { return nFrom; }
From() const75cdf0e10cSrcweir 	inline NUMTYPE				From() const { return nFrom; }
To()76cdf0e10cSrcweir 	inline NUMTYPE&				To() { return nTo; }
To() const77cdf0e10cSrcweir 	inline NUMTYPE				To() const { return nTo; }
HasRange() const78cdf0e10cSrcweir 	inline sal_Bool					HasRange() const { return nTo>nFrom; }
79cdf0e10cSrcweir 	virtual SfxPoolItem*		Create( SvStream &, sal_uInt16 nVersion ) const;
80cdf0e10cSrcweir 	virtual SvStream&			Store( SvStream &, sal_uInt16 nItemVersion ) const;
81cdf0e10cSrcweir };
82cdf0e10cSrcweir 
83cdf0e10cSrcweir // -----------------------------------------------------------------------
84cdf0e10cSrcweir 
85cdf0e10cSrcweir class SVL_DLLPUBLIC SfxXRangesItem : public SfxPoolItem
86cdf0e10cSrcweir {
87cdf0e10cSrcweir private:
88cdf0e10cSrcweir 	NUMTYPE*					_pRanges;
89cdf0e10cSrcweir 
90cdf0e10cSrcweir public:
91cdf0e10cSrcweir 								TYPEINFO();
92cdf0e10cSrcweir 								SfxXRangesItem();
93cdf0e10cSrcweir 								SfxXRangesItem( sal_uInt16 nWID, const NUMTYPE *pRanges );
94cdf0e10cSrcweir 								SfxXRangesItem( sal_uInt16 nWID, SvStream &rStream );
95cdf0e10cSrcweir 								SfxXRangesItem( const SfxXRangesItem& rItem );
96cdf0e10cSrcweir 	virtual 					~SfxXRangesItem();
97cdf0e10cSrcweir 	virtual int 				operator==( const SfxPoolItem& ) const;
98cdf0e10cSrcweir 	virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
99cdf0e10cSrcweir 									SfxMapUnit eCoreMetric,
100cdf0e10cSrcweir 									SfxMapUnit ePresMetric,
101cdf0e10cSrcweir 									XubString &rText,
102cdf0e10cSrcweir                                     const IntlWrapper * = 0 ) const;
103cdf0e10cSrcweir 	virtual SfxPoolItem*    	Clone( SfxItemPool *pPool = 0 ) const;
GetRanges() const104cdf0e10cSrcweir 	inline const NUMTYPE*		GetRanges() const { return _pRanges; }
105cdf0e10cSrcweir 	virtual SfxPoolItem*		Create( SvStream &, sal_uInt16 nVersion ) const;
106cdf0e10cSrcweir 	virtual SvStream&			Store( SvStream &, sal_uInt16 nItemVersion ) const;
107cdf0e10cSrcweir };
108cdf0e10cSrcweir 
109cdf0e10cSrcweir #endif
110cdf0e10cSrcweir #endif
111