sync master with lastest vba changes
[ooovba.git] / binfilter / inc / bf_svtools / rngitem.hxx
blobe4fc6cd6dfa62bcfb200e31cd9d698d679182773
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: rngitem.hxx,v $
10 * $Revision: 1.4 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _SFXRNGITEM_HXX
33 #ifndef NUMTYPE
35 #define NUMTYPE USHORT
36 #define SfxXRangeItem SfxRangeItem
37 #define SfxXRangesItem SfxUShortRangesItem
38 #include <bf_svtools/rngitem.hxx>
39 #undef NUMTYPE
40 #undef SfxXRangeItem
41 #undef SfxXRangesItem
43 #ifndef _SFXITEMS_HXX
44 #define NUMTYPE ULONG
45 #define SfxXRangeItem SfxULongRangeItem
46 #define SfxXRangesItem SfxULongRangesItem
47 #include <bf_svtools/rngitem.hxx>
48 #undef NUMTYPE
49 #undef SfxXRangeItem
50 #undef SfxXRangesItem
51 #endif
53 #define _SFXRNGITEM_HXX
55 #else
57 #ifndef INCLUDED_SVTDLLAPI_H
58 #include "bf_svtools/svtdllapi.h"
59 #endif
61 #ifndef _SFXPOOLITEM_HXX
62 #include <bf_svtools/poolitem.hxx>
63 #endif
65 class SvStream;
67 namespace binfilter
70 // -----------------------------------------------------------------------
72 class SfxXRangeItem : public SfxPoolItem
74 private:
75 NUMTYPE nFrom;
76 NUMTYPE nTo;
77 public:
78 TYPEINFO();
79 SfxXRangeItem();
80 SfxXRangeItem( USHORT nWID, NUMTYPE nFrom, NUMTYPE nTo );
81 SfxXRangeItem( const SfxXRangeItem& rItem );
82 virtual int operator==( const SfxPoolItem& ) const;
83 virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
84 SfxMapUnit eCoreMetric,
85 SfxMapUnit ePresMetric,
86 XubString &rText,
87 const ::IntlWrapper * = 0 ) const;
88 virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
89 inline NUMTYPE& From() { return nFrom; }
90 inline NUMTYPE From() const { return nFrom; }
91 inline NUMTYPE& To() { return nTo; }
92 inline NUMTYPE To() const { return nTo; }
93 inline BOOL HasRange() const { return nTo>nFrom; }
94 virtual SfxPoolItem* Create( SvStream &, USHORT nVersion ) const;
95 virtual SvStream& Store( SvStream &, USHORT nItemVersion ) const;
98 // -----------------------------------------------------------------------
100 class SfxXRangesItem : public SfxPoolItem
102 private:
103 NUMTYPE* _pRanges;
105 public:
106 TYPEINFO();
107 SfxXRangesItem();
108 SfxXRangesItem( USHORT nWID, SvStream &rStream );
109 SfxXRangesItem( const SfxXRangesItem& rItem );
110 virtual ~SfxXRangesItem();
111 virtual int operator==( const SfxPoolItem& ) const;
112 virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
113 SfxMapUnit eCoreMetric,
114 SfxMapUnit ePresMetric,
115 XubString &rText,
116 const ::IntlWrapper * = 0 ) const;
117 virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
118 inline const NUMTYPE* GetRanges() const { return _pRanges; }
119 virtual SfxPoolItem* Create( SvStream &, USHORT nVersion ) const;
120 virtual SvStream& Store( SvStream &, USHORT nItemVersion ) const;
125 #endif
126 #endif