1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: rngitem.hxx,v $
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
35 #define NUMTYPE USHORT
36 #define SfxXRangeItem SfxRangeItem
37 #define SfxXRangesItem SfxUShortRangesItem
38 #include <bf_svtools/rngitem.hxx>
45 #define SfxXRangeItem SfxULongRangeItem
46 #define SfxXRangesItem SfxULongRangesItem
47 #include <bf_svtools/rngitem.hxx>
53 #define _SFXRNGITEM_HXX
57 #ifndef INCLUDED_SVTDLLAPI_H
58 #include "bf_svtools/svtdllapi.h"
61 #ifndef _SFXPOOLITEM_HXX
62 #include <bf_svtools/poolitem.hxx>
70 // -----------------------------------------------------------------------
72 class SfxXRangeItem
: public SfxPoolItem
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
,
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
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
,
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;