1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #ifndef INCLUDED_SVL_CINTITEM_HXX
21 #define INCLUDED_SVL_CINTITEM_HXX
23 #include <svl/svldllapi.h>
24 #include <tools/debug.hxx>
25 #include <svl/poolitem.hxx>
27 class SVL_DLLPUBLIC CntByteItem
: public SfxPoolItem
34 CntByteItem(sal_uInt16 which
= 0, sal_uInt8 nTheValue
= 0):
35 SfxPoolItem(which
), m_nValue(nTheValue
) {}
37 CntByteItem(const CntByteItem
& rItem
):
38 SfxPoolItem(rItem
), m_nValue(rItem
.m_nValue
)
41 virtual ~CntByteItem() {}
43 virtual bool operator ==(const SfxPoolItem
& rItem
) const SAL_OVERRIDE
;
45 using SfxPoolItem::Compare
;
46 virtual int Compare(const SfxPoolItem
& rWith
) const SAL_OVERRIDE
;
48 virtual bool GetPresentation(SfxItemPresentation
,
49 SfxMapUnit
, SfxMapUnit
,
51 const IntlWrapper
* = 0)
54 virtual bool QueryValue(com::sun::star::uno::Any
& rVal
,
55 sal_uInt8 nMemberId
= 0) const SAL_OVERRIDE
;
57 virtual bool PutValue(const com::sun::star::uno::Any
& rVal
,
58 sal_uInt8 nMemberId
= 0) SAL_OVERRIDE
;
60 virtual SfxPoolItem
* Create(SvStream
& rStream
, sal_uInt16
) const SAL_OVERRIDE
;
62 virtual SvStream
& Store(SvStream
& rStream
, sal_uInt16
) const SAL_OVERRIDE
;
64 virtual SfxPoolItem
* Clone(SfxItemPool
* = 0) const SAL_OVERRIDE
;
66 sal_uInt8
GetValue() const { return m_nValue
; }
68 inline void SetValue(sal_uInt8 nTheValue
);
71 inline void CntByteItem::SetValue(sal_uInt8 nTheValue
)
73 DBG_ASSERT(GetRefCount() == 0, "CntByteItem::SetValue(): Pooled item");
77 class SVL_DLLPUBLIC CntUInt16Item
: public SfxPoolItem
84 CntUInt16Item(sal_uInt16 which
= 0, sal_uInt16 nTheValue
= 0):
85 SfxPoolItem(which
), m_nValue(nTheValue
)
88 CntUInt16Item(sal_uInt16 which
, SvStream
& rStream
);
90 CntUInt16Item(const CntUInt16Item
& rItem
):
91 SfxPoolItem(rItem
), m_nValue(rItem
.m_nValue
)
94 virtual ~CntUInt16Item() {}
96 virtual bool operator ==(const SfxPoolItem
& rItem
) const SAL_OVERRIDE
;
98 using SfxPoolItem::Compare
;
99 virtual int Compare(const SfxPoolItem
& rWith
) const SAL_OVERRIDE
;
101 virtual bool GetPresentation(SfxItemPresentation
,
102 SfxMapUnit
, SfxMapUnit
,
104 const IntlWrapper
* = 0)
107 virtual bool QueryValue(com::sun::star::uno::Any
& rVal
,
108 sal_uInt8 nMemberId
= 0) const SAL_OVERRIDE
;
110 virtual bool PutValue(const com::sun::star::uno::Any
& rVal
,
111 sal_uInt8 nMemberId
= 0) SAL_OVERRIDE
;
113 virtual SfxPoolItem
* Create(SvStream
& rStream
, sal_uInt16
) const SAL_OVERRIDE
;
115 virtual SvStream
& Store(SvStream
& rStream
, sal_uInt16
) const SAL_OVERRIDE
;
117 virtual SfxPoolItem
* Clone(SfxItemPool
* = 0) const SAL_OVERRIDE
;
119 sal_uInt16
GetValue() const { return m_nValue
; }
121 inline void SetValue(sal_uInt16 nTheValue
);
124 inline void CntUInt16Item::SetValue(sal_uInt16 nTheValue
)
126 DBG_ASSERT(GetRefCount() == 0, "CntUInt16Item::SetValue(): Pooled item");
127 m_nValue
= nTheValue
;
130 class SVL_DLLPUBLIC CntInt32Item
: public SfxPoolItem
137 CntInt32Item(sal_uInt16 which
= 0, sal_Int32 nTheValue
= 0):
138 SfxPoolItem(which
), m_nValue(nTheValue
)
141 CntInt32Item(sal_uInt16 which
, SvStream
& rStream
);
143 CntInt32Item(const CntInt32Item
& rItem
):
144 SfxPoolItem(rItem
), m_nValue(rItem
.m_nValue
)
147 virtual ~CntInt32Item() {}
149 virtual bool operator ==(const SfxPoolItem
& rItem
) const SAL_OVERRIDE
;
151 using SfxPoolItem::Compare
;
152 virtual int Compare(const SfxPoolItem
& rWith
) const SAL_OVERRIDE
;
154 virtual bool GetPresentation(SfxItemPresentation
,
155 SfxMapUnit
, SfxMapUnit
,
157 const IntlWrapper
* = 0)
160 virtual bool QueryValue(com::sun::star::uno::Any
& rVal
,
161 sal_uInt8 nMemberId
= 0) const SAL_OVERRIDE
;
163 virtual bool PutValue(const com::sun::star::uno::Any
& rVal
,
164 sal_uInt8 nMemberId
= 0) SAL_OVERRIDE
;
166 virtual SfxPoolItem
* Create(SvStream
& rStream
, sal_uInt16
) const SAL_OVERRIDE
;
168 virtual SvStream
& Store(SvStream
&, sal_uInt16
) const SAL_OVERRIDE
;
170 virtual SfxPoolItem
* Clone(SfxItemPool
* = 0) const SAL_OVERRIDE
;
172 sal_Int32
GetValue() const { return m_nValue
; }
174 inline void SetValue(sal_Int32 nTheValue
);
177 inline void CntInt32Item::SetValue(sal_Int32 nTheValue
)
179 DBG_ASSERT(GetRefCount() == 0, "CntInt32Item::SetValue(): Pooled item");
180 m_nValue
= nTheValue
;
183 class SVL_DLLPUBLIC CntUInt32Item
: public SfxPoolItem
190 CntUInt32Item(sal_uInt16 which
= 0, sal_uInt32 nTheValue
= 0):
191 SfxPoolItem(which
), m_nValue(nTheValue
)
194 CntUInt32Item(sal_uInt16 nWhich
, SvStream
& rStream
);
196 CntUInt32Item(const CntUInt32Item
& rItem
):
197 SfxPoolItem(rItem
), m_nValue(rItem
.m_nValue
)
200 virtual ~CntUInt32Item() {}
202 virtual bool operator ==(const SfxPoolItem
& rItem
) const SAL_OVERRIDE
;
204 using SfxPoolItem::Compare
;
205 virtual int Compare(const SfxPoolItem
& rWith
) const SAL_OVERRIDE
;
207 virtual bool GetPresentation(SfxItemPresentation
,
208 SfxMapUnit
, SfxMapUnit
,
210 const IntlWrapper
* = 0)
213 virtual bool QueryValue(com::sun::star::uno::Any
& rVal
,
214 sal_uInt8 nMemberId
= 0) const SAL_OVERRIDE
;
216 virtual bool PutValue(const com::sun::star::uno::Any
& rVal
,
217 sal_uInt8 nMemberId
= 0) SAL_OVERRIDE
;
219 virtual SfxPoolItem
* Create(SvStream
& rStream
, sal_uInt16
) const SAL_OVERRIDE
;
221 virtual SvStream
& Store(SvStream
& rStream
, sal_uInt16
) const SAL_OVERRIDE
;
223 virtual SfxPoolItem
* Clone(SfxItemPool
* = 0) const SAL_OVERRIDE
;
225 sal_uInt32
GetValue() const { return m_nValue
; }
227 inline void SetValue(sal_uInt32 nTheValue
);
230 inline void CntUInt32Item::SetValue(sal_uInt32 nTheValue
)
232 DBG_ASSERT(GetRefCount() == 0, "CntUInt32Item::SetValue(): Pooled item");
233 m_nValue
= nTheValue
;
236 #endif // INCLUDED_SVL_CINTITEM_HXX
238 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */