Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
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/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
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 .
18 : */
19 :
20 : #ifndef INCLUDED_SVL_CINTITEM_HXX
21 : #define INCLUDED_SVL_CINTITEM_HXX
22 :
23 : #include <svl/svldllapi.h>
24 : #include <tools/debug.hxx>
25 : #include <svl/poolitem.hxx>
26 :
27 : class SVL_DLLPUBLIC CntByteItem: public SfxPoolItem
28 : {
29 : sal_uInt8 m_nValue;
30 :
31 : public:
32 : TYPEINFO_OVERRIDE();
33 :
34 3268 : CntByteItem(sal_uInt16 which = 0, sal_uInt8 nTheValue = 0):
35 3268 : SfxPoolItem(which), m_nValue(nTheValue) {}
36 :
37 23254 : CntByteItem(const CntByteItem & rItem):
38 23254 : SfxPoolItem(rItem), m_nValue(rItem.m_nValue)
39 23254 : {}
40 :
41 26410 : virtual ~CntByteItem() {}
42 :
43 : virtual bool operator ==(const SfxPoolItem & rItem) const SAL_OVERRIDE;
44 :
45 : using SfxPoolItem::Compare;
46 : virtual int Compare(const SfxPoolItem & rWith) const SAL_OVERRIDE;
47 :
48 : virtual bool GetPresentation(SfxItemPresentation,
49 : SfxMapUnit, SfxMapUnit,
50 : OUString & rText,
51 : const IntlWrapper * = 0)
52 : const SAL_OVERRIDE;
53 :
54 : virtual bool QueryValue(com::sun::star::uno::Any& rVal,
55 : sal_uInt8 nMemberId = 0) const SAL_OVERRIDE;
56 :
57 : virtual bool PutValue(const com::sun::star::uno::Any& rVal,
58 : sal_uInt8 nMemberId = 0) SAL_OVERRIDE;
59 :
60 : virtual SfxPoolItem * Create(SvStream & rStream, sal_uInt16) const SAL_OVERRIDE;
61 :
62 : virtual SvStream & Store(SvStream & rStream, sal_uInt16) const SAL_OVERRIDE;
63 :
64 : virtual SfxPoolItem * Clone(SfxItemPool * = 0) const SAL_OVERRIDE;
65 :
66 : virtual sal_uInt8 GetMin() const;
67 :
68 : virtual sal_uInt8 GetMax() const;
69 :
70 : virtual SfxFieldUnit GetUnit() const;
71 :
72 89235 : sal_uInt8 GetValue() const { return m_nValue; }
73 :
74 : inline void SetValue(sal_uInt8 nTheValue);
75 : };
76 :
77 44 : inline void CntByteItem::SetValue(sal_uInt8 nTheValue)
78 : {
79 : DBG_ASSERT(GetRefCount() == 0, "CntByteItem::SetValue(): Pooled item");
80 44 : m_nValue = nTheValue;
81 44 : }
82 :
83 : class SVL_DLLPUBLIC CntUInt16Item: public SfxPoolItem
84 : {
85 : sal_uInt16 m_nValue;
86 :
87 : public:
88 : TYPEINFO_OVERRIDE();
89 :
90 607235 : CntUInt16Item(sal_uInt16 which = 0, sal_uInt16 nTheValue = 0):
91 607235 : SfxPoolItem(which), m_nValue(nTheValue)
92 607235 : {}
93 :
94 : CntUInt16Item(sal_uInt16 which, SvStream & rStream);
95 :
96 394910 : CntUInt16Item(const CntUInt16Item & rItem):
97 394910 : SfxPoolItem(rItem), m_nValue(rItem.m_nValue)
98 394910 : {}
99 :
100 996070 : virtual ~CntUInt16Item() {}
101 :
102 : virtual bool operator ==(const SfxPoolItem & rItem) const SAL_OVERRIDE;
103 :
104 : using SfxPoolItem::Compare;
105 : virtual int Compare(const SfxPoolItem & rWith) const SAL_OVERRIDE;
106 :
107 : virtual bool GetPresentation(SfxItemPresentation,
108 : SfxMapUnit, SfxMapUnit,
109 : OUString & rText,
110 : const IntlWrapper * = 0)
111 : const SAL_OVERRIDE;
112 :
113 : virtual bool QueryValue(com::sun::star::uno::Any& rVal,
114 : sal_uInt8 nMemberId = 0) const SAL_OVERRIDE;
115 :
116 : virtual bool PutValue(const com::sun::star::uno::Any& rVal,
117 : sal_uInt8 nMemberId = 0) SAL_OVERRIDE;
118 :
119 : virtual SfxPoolItem * Create(SvStream & rStream, sal_uInt16) const SAL_OVERRIDE;
120 :
121 : virtual SvStream & Store(SvStream & rStream, sal_uInt16) const SAL_OVERRIDE;
122 :
123 : virtual SfxPoolItem * Clone(SfxItemPool * = 0) const SAL_OVERRIDE;
124 :
125 : virtual sal_uInt16 GetMin() const;
126 :
127 : virtual sal_uInt16 GetMax() const;
128 :
129 : virtual SfxFieldUnit GetUnit() const;
130 :
131 8794155 : sal_uInt16 GetValue() const { return m_nValue; }
132 :
133 : inline void SetValue(sal_uInt16 nTheValue);
134 : };
135 :
136 46993 : inline void CntUInt16Item::SetValue(sal_uInt16 nTheValue)
137 : {
138 : DBG_ASSERT(GetRefCount() == 0, "CntUInt16Item::SetValue(): Pooled item");
139 46993 : m_nValue = nTheValue;
140 46993 : }
141 :
142 : class SVL_DLLPUBLIC CntInt32Item: public SfxPoolItem
143 : {
144 : sal_Int32 m_nValue;
145 :
146 : public:
147 : TYPEINFO_OVERRIDE();
148 :
149 971069 : CntInt32Item(sal_uInt16 which = 0, sal_Int32 nTheValue = 0):
150 971069 : SfxPoolItem(which), m_nValue(nTheValue)
151 971069 : {}
152 :
153 : CntInt32Item(sal_uInt16 which, SvStream & rStream);
154 :
155 57845 : CntInt32Item(const CntInt32Item & rItem):
156 57845 : SfxPoolItem(rItem), m_nValue(rItem.m_nValue)
157 57845 : {}
158 :
159 1016214 : virtual ~CntInt32Item() {}
160 :
161 : virtual bool operator ==(const SfxPoolItem & rItem) const SAL_OVERRIDE;
162 :
163 : using SfxPoolItem::Compare;
164 : virtual int Compare(const SfxPoolItem & rWith) const SAL_OVERRIDE;
165 :
166 : virtual bool GetPresentation(SfxItemPresentation,
167 : SfxMapUnit, SfxMapUnit,
168 : OUString & rText,
169 : const IntlWrapper * = 0)
170 : const SAL_OVERRIDE;
171 :
172 : virtual bool QueryValue(com::sun::star::uno::Any& rVal,
173 : sal_uInt8 nMemberId = 0) const SAL_OVERRIDE;
174 :
175 : virtual bool PutValue(const com::sun::star::uno::Any& rVal,
176 : sal_uInt8 nMemberId = 0) SAL_OVERRIDE;
177 :
178 : virtual SfxPoolItem * Create(SvStream & rStream, sal_uInt16) const SAL_OVERRIDE;
179 :
180 : virtual SvStream & Store(SvStream &, sal_uInt16) const SAL_OVERRIDE;
181 :
182 : virtual SfxPoolItem * Clone(SfxItemPool * = 0) const SAL_OVERRIDE;
183 :
184 : virtual sal_Int32 GetMin() const;
185 :
186 : virtual sal_Int32 GetMax() const;
187 :
188 : virtual SfxFieldUnit GetUnit() const;
189 :
190 8184038 : sal_Int32 GetValue() const { return m_nValue; }
191 :
192 : inline void SetValue(sal_Int32 nTheValue);
193 : };
194 :
195 24980 : inline void CntInt32Item::SetValue(sal_Int32 nTheValue)
196 : {
197 : DBG_ASSERT(GetRefCount() == 0, "CntInt32Item::SetValue(): Pooled item");
198 24980 : m_nValue = nTheValue;
199 24980 : }
200 :
201 : class SVL_DLLPUBLIC CntUInt32Item: public SfxPoolItem
202 : {
203 : sal_uInt32 m_nValue;
204 :
205 : public:
206 : TYPEINFO_OVERRIDE();
207 :
208 73449 : CntUInt32Item(sal_uInt16 which = 0, sal_uInt32 nTheValue = 0):
209 73449 : SfxPoolItem(which), m_nValue(nTheValue)
210 73449 : {}
211 :
212 : CntUInt32Item(sal_uInt16 nWhich, SvStream & rStream);
213 :
214 16309 : CntUInt32Item(const CntUInt32Item & rItem):
215 16309 : SfxPoolItem(rItem), m_nValue(rItem.m_nValue)
216 16309 : {}
217 :
218 88240 : virtual ~CntUInt32Item() {}
219 :
220 : virtual bool operator ==(const SfxPoolItem & rItem) const SAL_OVERRIDE;
221 :
222 : using SfxPoolItem::Compare;
223 : virtual int Compare(const SfxPoolItem & rWith) const SAL_OVERRIDE;
224 :
225 : virtual bool GetPresentation(SfxItemPresentation,
226 : SfxMapUnit, SfxMapUnit,
227 : OUString & rText,
228 : const IntlWrapper * = 0)
229 : const SAL_OVERRIDE;
230 :
231 : virtual bool QueryValue(com::sun::star::uno::Any& rVal,
232 : sal_uInt8 nMemberId = 0) const SAL_OVERRIDE;
233 :
234 : virtual bool PutValue(const com::sun::star::uno::Any& rVal,
235 : sal_uInt8 nMemberId = 0) SAL_OVERRIDE;
236 :
237 : virtual SfxPoolItem * Create(SvStream & rStream, sal_uInt16) const SAL_OVERRIDE;
238 :
239 : virtual SvStream & Store(SvStream & rStream, sal_uInt16) const SAL_OVERRIDE;
240 :
241 : virtual SfxPoolItem * Clone(SfxItemPool * = 0) const SAL_OVERRIDE;
242 :
243 : virtual sal_uInt32 GetMin() const;
244 :
245 : virtual sal_uInt32 GetMax() const;
246 :
247 : virtual SfxFieldUnit GetUnit() const;
248 :
249 245091 : sal_uInt32 GetValue() const { return m_nValue; }
250 :
251 : inline void SetValue(sal_uInt32 nTheValue);
252 : };
253 :
254 708 : inline void CntUInt32Item::SetValue(sal_uInt32 nTheValue)
255 : {
256 : DBG_ASSERT(GetRefCount() == 0, "CntUInt32Item::SetValue(): Pooled item");
257 708 : m_nValue = nTheValue;
258 708 : }
259 :
260 : #endif // INCLUDED_SVL_CINTITEM_HXX
261 :
262 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|