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: cintitem.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 _SVTOOLS_CINTITEM_HXX
32 #define _SVTOOLS_CINTITEM_HXX
34 #ifndef _TOOLS_DEBUG_HXX
35 #include <tools/debug.hxx>
38 #ifndef _SFXPOOLITEM_HXX
39 #include <bf_svtools/poolitem.hxx>
44 //============================================================================
45 DBG_NAMEEX_VISIBILITY(CntByteItem
, )
47 class CntByteItem
: public SfxPoolItem
54 CntByteItem(USHORT which
= 0, BYTE nTheValue
= 0):
55 SfxPoolItem(which
), m_nValue(nTheValue
) { DBG_CTOR(CntByteItem
, 0); }
57 CntByteItem(const CntByteItem
& rItem
):
58 SfxPoolItem(rItem
), m_nValue(rItem
.m_nValue
)
59 { DBG_CTOR(CntByteItem
, 0); }
61 virtual ~CntByteItem();
63 virtual int operator ==(const SfxPoolItem
& rItem
) const;
65 using SfxPoolItem::Compare
;
66 virtual int Compare(const SfxPoolItem
& rWith
) const;
68 virtual SfxItemPresentation
GetPresentation(SfxItemPresentation
,
69 SfxMapUnit
, SfxMapUnit
,
71 const ::IntlWrapper
* = 0)
74 virtual BOOL
QueryValue(::com::sun::star::uno::Any
& rVal
,
75 BYTE nMemberId
= 0) const;
77 virtual BOOL
PutValue(const ::com::sun::star::uno::Any
& rVal
,
80 virtual SfxPoolItem
* Create(SvStream
& rStream
, USHORT
) const;
82 virtual SvStream
& Store(SvStream
& rStream
, USHORT
) const;
84 virtual SfxPoolItem
* Clone(SfxItemPool
* = 0) const;
86 virtual BYTE
GetMin() const;
88 virtual BYTE
GetMax() const;
90 virtual SfxFieldUnit
GetUnit() const;
92 BYTE
GetValue() const { return m_nValue
; }
94 inline void SetValue(BYTE nTheValue
);
97 inline void CntByteItem::SetValue(BYTE nTheValue
)
99 DBG_ASSERT(GetRefCount() == 0, "CntByteItem::SetValue(): Pooled item");
100 m_nValue
= nTheValue
;
103 //============================================================================
104 DBG_NAMEEX_VISIBILITY(CntUInt16Item
, )
106 class CntUInt16Item
: public SfxPoolItem
113 CntUInt16Item(USHORT which
= 0, UINT16 nTheValue
= 0):
114 SfxPoolItem(which
), m_nValue(nTheValue
)
115 { DBG_CTOR(CntUInt16Item
, 0); }
117 CntUInt16Item(USHORT which
, SvStream
& rStream
);
119 CntUInt16Item(const CntUInt16Item
& rItem
):
120 SfxPoolItem(rItem
), m_nValue(rItem
.m_nValue
)
121 { DBG_CTOR(CntUInt16Item
, 0); }
123 virtual ~CntUInt16Item();
125 virtual int operator ==(const SfxPoolItem
& rItem
) const;
127 using SfxPoolItem::Compare
;
128 virtual int Compare(const SfxPoolItem
& rWith
) const;
130 virtual SfxItemPresentation
GetPresentation(SfxItemPresentation
,
131 SfxMapUnit
, SfxMapUnit
,
133 const ::IntlWrapper
* = 0)
136 virtual BOOL
QueryValue(::com::sun::star::uno::Any
& rVal
,
137 BYTE nMemberId
= 0) const;
139 virtual BOOL
PutValue(const ::com::sun::star::uno::Any
& rVal
,
142 virtual SfxPoolItem
* Create(SvStream
& rStream
, USHORT
) const;
144 virtual SvStream
& Store(SvStream
& rStream
, USHORT
) const;
146 virtual SfxPoolItem
* Clone(SfxItemPool
* = 0) const;
148 virtual UINT16
GetMin() const;
150 virtual UINT16
GetMax() const;
152 virtual SfxFieldUnit
GetUnit() const;
154 INT16
GetValue() const { return m_nValue
; }
156 inline void SetValue(UINT16 nTheValue
);
159 inline void CntUInt16Item::SetValue(UINT16 nTheValue
)
161 DBG_ASSERT(GetRefCount() == 0, "CntUInt16Item::SetValue(): Pooled item");
162 m_nValue
= nTheValue
;
165 //============================================================================
166 DBG_NAMEEX_VISIBILITY(CntInt32Item
, )
168 class CntInt32Item
: public SfxPoolItem
175 CntInt32Item(USHORT which
= 0, INT32 nTheValue
= 0):
176 SfxPoolItem(which
), m_nValue(nTheValue
)
177 { DBG_CTOR(CntInt32Item
, 0); }
179 CntInt32Item(USHORT which
, SvStream
& rStream
);
181 CntInt32Item(const CntInt32Item
& rItem
):
182 SfxPoolItem(rItem
), m_nValue(rItem
.m_nValue
)
183 { DBG_CTOR(CntInt32Item
, 0); }
185 virtual ~CntInt32Item();
187 virtual int operator ==(const SfxPoolItem
& rItem
) const;
189 using SfxPoolItem::Compare
;
190 virtual int Compare(const SfxPoolItem
& rWith
) const;
192 virtual SfxItemPresentation
GetPresentation(SfxItemPresentation
,
193 SfxMapUnit
, SfxMapUnit
,
195 const ::IntlWrapper
* = 0)
198 virtual BOOL
QueryValue(::com::sun::star::uno::Any
& rVal
,
199 BYTE nMemberId
= 0) const;
201 virtual BOOL
PutValue(const ::com::sun::star::uno::Any
& rVal
,
204 virtual SfxPoolItem
* Create(SvStream
& rStream
, USHORT
) const;
206 virtual SvStream
& Store(SvStream
&, USHORT
) const;
208 virtual SfxPoolItem
* Clone(SfxItemPool
* = 0) const;
210 virtual INT32
GetMin() const;
212 virtual INT32
GetMax() const;
214 virtual SfxFieldUnit
GetUnit() const;
216 INT32
GetValue() const { return m_nValue
; }
218 inline void SetValue(INT32 nTheValue
);
221 inline void CntInt32Item::SetValue(INT32 nTheValue
)
223 DBG_ASSERT(GetRefCount() == 0, "CntInt32Item::SetValue(): Pooled item");
224 m_nValue
= nTheValue
;
227 //============================================================================
228 DBG_NAMEEX_VISIBILITY(CntUInt32Item
, )
230 class CntUInt32Item
: public SfxPoolItem
237 CntUInt32Item(USHORT which
= 0, UINT32 nTheValue
= 0):
238 SfxPoolItem(which
), m_nValue(nTheValue
)
239 { DBG_CTOR(CntUInt32Item
, 0); }
241 CntUInt32Item(USHORT nWhich
, SvStream
& rStream
);
243 CntUInt32Item(const CntUInt32Item
& rItem
):
244 SfxPoolItem(rItem
), m_nValue(rItem
.m_nValue
)
245 { DBG_CTOR(CntUInt32Item
, 0); }
247 virtual ~CntUInt32Item();
249 virtual int operator ==(const SfxPoolItem
& rItem
) const;
251 using SfxPoolItem::Compare
;
252 virtual int Compare(const SfxPoolItem
& rWith
) const;
254 virtual SfxItemPresentation
GetPresentation(SfxItemPresentation
,
255 SfxMapUnit
, SfxMapUnit
,
257 const ::IntlWrapper
* = 0)
260 virtual BOOL
QueryValue(::com::sun::star::uno::Any
& rVal
,
261 BYTE nMemberId
= 0) const;
263 virtual BOOL
PutValue(const ::com::sun::star::uno::Any
& rVal
,
266 virtual SfxPoolItem
* Create(SvStream
& rStream
, USHORT
) const;
268 virtual SvStream
& Store(SvStream
& rStream
, USHORT
) const;
270 virtual SfxPoolItem
* Clone(SfxItemPool
* = 0) const;
272 virtual UINT32
GetMin() const;
274 virtual UINT32
GetMax() const;
276 virtual SfxFieldUnit
GetUnit() const;
278 UINT32
GetValue() const { return m_nValue
; }
280 inline void SetValue(UINT32 nTheValue
);
283 inline void CntUInt32Item::SetValue(UINT32 nTheValue
)
285 DBG_ASSERT(GetRefCount() == 0, "CntUInt32Item::SetValue(): Pooled item");
286 m_nValue
= nTheValue
;
291 #endif // _SVTOOLS_CINTITEM_HXX