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 1972 : CntByteItem(sal_uInt16 which = 0, sal_uInt8 nTheValue = 0):
35 1972 : SfxPoolItem(which), m_nValue(nTheValue) {}
36 :
37 15080 : CntByteItem(const CntByteItem & rItem):
38 15080 : SfxPoolItem(rItem), m_nValue(rItem.m_nValue)
39 15080 : {}
40 :
41 16981 : 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 49782 : sal_uInt8 GetValue() const { return m_nValue; }
67 :
68 : inline void SetValue(sal_uInt8 nTheValue);
69 : };
70 :
71 72 : inline void CntByteItem::SetValue(sal_uInt8 nTheValue)
72 : {
73 : DBG_ASSERT(GetRefCount() == 0, "CntByteItem::SetValue(): Pooled item");
74 72 : m_nValue = nTheValue;
75 72 : }
76 :
77 : class SVL_DLLPUBLIC CntUInt16Item: public SfxPoolItem
78 : {
79 : sal_uInt16 m_nValue;
80 :
81 : public:
82 : TYPEINFO_OVERRIDE();
83 :
84 733857 : CntUInt16Item(sal_uInt16 which = 0, sal_uInt16 nTheValue = 0):
85 733857 : SfxPoolItem(which), m_nValue(nTheValue)
86 733857 : {}
87 :
88 : CntUInt16Item(sal_uInt16 which, SvStream & rStream);
89 :
90 430123 : CntUInt16Item(const CntUInt16Item & rItem):
91 430123 : SfxPoolItem(rItem), m_nValue(rItem.m_nValue)
92 430123 : {}
93 :
94 1152556 : virtual ~CntUInt16Item() {}
95 :
96 : virtual bool operator ==(const SfxPoolItem & rItem) const SAL_OVERRIDE;
97 :
98 : using SfxPoolItem::Compare;
99 : virtual int Compare(const SfxPoolItem & rWith) const SAL_OVERRIDE;
100 :
101 : virtual bool GetPresentation(SfxItemPresentation,
102 : SfxMapUnit, SfxMapUnit,
103 : OUString & rText,
104 : const IntlWrapper * = 0)
105 : const SAL_OVERRIDE;
106 :
107 : virtual bool QueryValue(com::sun::star::uno::Any& rVal,
108 : sal_uInt8 nMemberId = 0) const SAL_OVERRIDE;
109 :
110 : virtual bool PutValue(const com::sun::star::uno::Any& rVal,
111 : sal_uInt8 nMemberId = 0) SAL_OVERRIDE;
112 :
113 : virtual SfxPoolItem * Create(SvStream & rStream, sal_uInt16) const SAL_OVERRIDE;
114 :
115 : virtual SvStream & Store(SvStream & rStream, sal_uInt16) const SAL_OVERRIDE;
116 :
117 : virtual SfxPoolItem * Clone(SfxItemPool * = 0) const SAL_OVERRIDE;
118 :
119 7372854 : sal_uInt16 GetValue() const { return m_nValue; }
120 :
121 : inline void SetValue(sal_uInt16 nTheValue);
122 : };
123 :
124 57736 : inline void CntUInt16Item::SetValue(sal_uInt16 nTheValue)
125 : {
126 : DBG_ASSERT(GetRefCount() == 0, "CntUInt16Item::SetValue(): Pooled item");
127 57736 : m_nValue = nTheValue;
128 57736 : }
129 :
130 : class SVL_DLLPUBLIC CntInt32Item: public SfxPoolItem
131 : {
132 : sal_Int32 m_nValue;
133 :
134 : public:
135 : TYPEINFO_OVERRIDE();
136 :
137 661213 : CntInt32Item(sal_uInt16 which = 0, sal_Int32 nTheValue = 0):
138 661213 : SfxPoolItem(which), m_nValue(nTheValue)
139 661213 : {}
140 :
141 : CntInt32Item(sal_uInt16 which, SvStream & rStream);
142 :
143 80503 : CntInt32Item(const CntInt32Item & rItem):
144 80503 : SfxPoolItem(rItem), m_nValue(rItem.m_nValue)
145 80503 : {}
146 :
147 732340 : virtual ~CntInt32Item() {}
148 :
149 : virtual bool operator ==(const SfxPoolItem & rItem) const SAL_OVERRIDE;
150 :
151 : using SfxPoolItem::Compare;
152 : virtual int Compare(const SfxPoolItem & rWith) const SAL_OVERRIDE;
153 :
154 : virtual bool GetPresentation(SfxItemPresentation,
155 : SfxMapUnit, SfxMapUnit,
156 : OUString & rText,
157 : const IntlWrapper * = 0)
158 : const SAL_OVERRIDE;
159 :
160 : virtual bool QueryValue(com::sun::star::uno::Any& rVal,
161 : sal_uInt8 nMemberId = 0) const SAL_OVERRIDE;
162 :
163 : virtual bool PutValue(const com::sun::star::uno::Any& rVal,
164 : sal_uInt8 nMemberId = 0) SAL_OVERRIDE;
165 :
166 : virtual SfxPoolItem * Create(SvStream & rStream, sal_uInt16) const SAL_OVERRIDE;
167 :
168 : virtual SvStream & Store(SvStream &, sal_uInt16) const SAL_OVERRIDE;
169 :
170 : virtual SfxPoolItem * Clone(SfxItemPool * = 0) const SAL_OVERRIDE;
171 :
172 4541977 : sal_Int32 GetValue() const { return m_nValue; }
173 :
174 : inline void SetValue(sal_Int32 nTheValue);
175 : };
176 :
177 31994 : inline void CntInt32Item::SetValue(sal_Int32 nTheValue)
178 : {
179 : DBG_ASSERT(GetRefCount() == 0, "CntInt32Item::SetValue(): Pooled item");
180 31994 : m_nValue = nTheValue;
181 31994 : }
182 :
183 : class SVL_DLLPUBLIC CntUInt32Item: public SfxPoolItem
184 : {
185 : sal_uInt32 m_nValue;
186 :
187 : public:
188 : TYPEINFO_OVERRIDE();
189 :
190 48031 : CntUInt32Item(sal_uInt16 which = 0, sal_uInt32 nTheValue = 0):
191 48031 : SfxPoolItem(which), m_nValue(nTheValue)
192 48031 : {}
193 :
194 : CntUInt32Item(sal_uInt16 nWhich, SvStream & rStream);
195 :
196 21373 : CntUInt32Item(const CntUInt32Item & rItem):
197 21373 : SfxPoolItem(rItem), m_nValue(rItem.m_nValue)
198 21373 : {}
199 :
200 68271 : virtual ~CntUInt32Item() {}
201 :
202 : virtual bool operator ==(const SfxPoolItem & rItem) const SAL_OVERRIDE;
203 :
204 : using SfxPoolItem::Compare;
205 : virtual int Compare(const SfxPoolItem & rWith) const SAL_OVERRIDE;
206 :
207 : virtual bool GetPresentation(SfxItemPresentation,
208 : SfxMapUnit, SfxMapUnit,
209 : OUString & rText,
210 : const IntlWrapper * = 0)
211 : const SAL_OVERRIDE;
212 :
213 : virtual bool QueryValue(com::sun::star::uno::Any& rVal,
214 : sal_uInt8 nMemberId = 0) const SAL_OVERRIDE;
215 :
216 : virtual bool PutValue(const com::sun::star::uno::Any& rVal,
217 : sal_uInt8 nMemberId = 0) SAL_OVERRIDE;
218 :
219 : virtual SfxPoolItem * Create(SvStream & rStream, sal_uInt16) const SAL_OVERRIDE;
220 :
221 : virtual SvStream & Store(SvStream & rStream, sal_uInt16) const SAL_OVERRIDE;
222 :
223 : virtual SfxPoolItem * Clone(SfxItemPool * = 0) const SAL_OVERRIDE;
224 :
225 161655 : sal_uInt32 GetValue() const { return m_nValue; }
226 :
227 : inline void SetValue(sal_uInt32 nTheValue);
228 : };
229 :
230 1759 : inline void CntUInt32Item::SetValue(sal_uInt32 nTheValue)
231 : {
232 : DBG_ASSERT(GetRefCount() == 0, "CntUInt32Item::SetValue(): Pooled item");
233 1759 : m_nValue = nTheValue;
234 1759 : }
235 :
236 : #endif // INCLUDED_SVL_CINTITEM_HXX
237 :
238 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|