LibreOffice Module svl (master) 1
cintitem.hxx
Go to the documentation of this file.
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
28{
30
31public:
32
33 CntByteItem(sal_uInt16 which, sal_uInt8 nTheValue):
34 SfxPoolItem(which), m_nValue(nTheValue) {}
35
36 virtual bool operator ==(const SfxPoolItem & rItem) const override;
37
40 OUString & rText,
41 const IntlWrapper&)
42 const override;
43
44 virtual bool QueryValue(css::uno::Any& rVal,
45 sal_uInt8 nMemberId = 0) const override;
46
47 virtual bool PutValue(const css::uno::Any& rVal,
48 sal_uInt8 nMemberId) override;
49
50 virtual CntByteItem* Clone(SfxItemPool * = nullptr) const override;
51
52 sal_uInt8 GetValue() const { return m_nValue; }
53
54 inline void SetValue(sal_uInt8 nTheValue);
55};
56
57inline void CntByteItem::SetValue(sal_uInt8 nTheValue)
58{
59 DBG_ASSERT(GetRefCount() == 0, "CntByteItem::SetValue(): Pooled item");
60 m_nValue = nTheValue;
61}
62
64{
65 sal_uInt16 m_nValue;
66
67public:
68
69 CntUInt16Item(sal_uInt16 which, sal_uInt16 nTheValue):
70 SfxPoolItem(which), m_nValue(nTheValue)
71 {}
72
73 virtual bool operator ==(const SfxPoolItem & rItem) const override;
74
77 OUString & rText,
78 const IntlWrapper&)
79 const override;
80
81 virtual bool QueryValue(css::uno::Any& rVal,
82 sal_uInt8 nMemberId = 0) const override;
83
84 virtual bool PutValue(const css::uno::Any& rVal,
85 sal_uInt8 nMemberId) override;
86
87 virtual CntUInt16Item* Clone(SfxItemPool * = nullptr) const override;
88
89 sal_uInt16 GetValue() const { return m_nValue; }
90
91 inline void SetValue(sal_uInt16 nTheValue);
92};
93
94inline void CntUInt16Item::SetValue(sal_uInt16 nTheValue)
95{
96 DBG_ASSERT(GetRefCount() == 0, "CntUInt16Item::SetValue(): Pooled item");
97 m_nValue = nTheValue;
98}
99
101{
102 sal_Int32 m_nValue;
103
104public:
105
106 CntInt32Item(sal_uInt16 which, sal_Int32 nTheValue):
107 SfxPoolItem(which), m_nValue(nTheValue)
108 {}
109
110 virtual bool operator ==(const SfxPoolItem & rItem) const override;
111
114 OUString & rText,
115 const IntlWrapper&)
116 const override;
117
118 virtual bool QueryValue(css::uno::Any& rVal,
119 sal_uInt8 nMemberId = 0) const override;
120
121 virtual bool PutValue(const css::uno::Any& rVal,
122 sal_uInt8 nMemberId) override;
123
124 virtual CntInt32Item* Clone(SfxItemPool * = nullptr) const override;
125
126 sal_Int32 GetValue() const { return m_nValue; }
127
128 inline void SetValue(sal_Int32 nTheValue);
129};
130
131inline void CntInt32Item::SetValue(sal_Int32 nTheValue)
132{
133 DBG_ASSERT(GetRefCount() == 0, "CntInt32Item::SetValue(): Pooled item");
134 m_nValue = nTheValue;
135}
136
138{
139 sal_uInt32 m_nValue;
140
141public:
142
143 CntUInt32Item(sal_uInt16 which, sal_uInt32 nTheValue):
144 SfxPoolItem(which), m_nValue(nTheValue)
145 {}
146
147 virtual bool operator ==(const SfxPoolItem & rItem) const override;
148
151 OUString & rText,
152 const IntlWrapper&)
153 const override;
154
155 virtual bool QueryValue(css::uno::Any& rVal,
156 sal_uInt8 nMemberId = 0) const override;
157
158 virtual bool PutValue(const css::uno::Any& rVal,
159 sal_uInt8 nMemberId) override;
160
161 virtual CntUInt32Item* Clone(SfxItemPool * = nullptr) const override;
162
163 sal_uInt32 GetValue() const { return m_nValue; }
164
165 inline void SetValue(sal_uInt32 nTheValue);
166};
167
168inline void CntUInt32Item::SetValue(sal_uInt32 nTheValue)
169{
170 DBG_ASSERT(GetRefCount() == 0, "CntUInt32Item::SetValue(): Pooled item");
171 m_nValue = nTheValue;
172}
173
174#endif // INCLUDED_SVL_CINTITEM_HXX
175
176/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
sal_uInt8 m_nValue
Definition: cintitem.hxx:29
void SetValue(sal_uInt8 nTheValue)
Definition: cintitem.hxx:57
CntByteItem(sal_uInt16 which, sal_uInt8 nTheValue)
Definition: cintitem.hxx:33
sal_uInt8 GetValue() const
Definition: cintitem.hxx:52
sal_Int32 GetValue() const
Definition: cintitem.hxx:126
sal_Int32 m_nValue
Definition: cintitem.hxx:102
CntInt32Item(sal_uInt16 which, sal_Int32 nTheValue)
Definition: cintitem.hxx:106
void SetValue(sal_Int32 nTheValue)
Definition: cintitem.hxx:131
sal_uInt16 GetValue() const
Definition: cintitem.hxx:89
CntUInt16Item(sal_uInt16 which, sal_uInt16 nTheValue)
Definition: cintitem.hxx:69
sal_uInt16 m_nValue
Definition: cintitem.hxx:65
void SetValue(sal_uInt16 nTheValue)
Definition: cintitem.hxx:94
void SetValue(sal_uInt32 nTheValue)
Definition: cintitem.hxx:168
sal_uInt32 m_nValue
Definition: cintitem.hxx:139
sal_uInt32 GetValue() const
Definition: cintitem.hxx:163
CntUInt32Item(sal_uInt16 which, sal_uInt32 nTheValue)
Definition: cintitem.hxx:143
Base class for providers of defaults of SfxPoolItems.
Definition: itempool.hxx:51
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const
Definition: poolitem.cxx:604
virtual bool GetPresentation(SfxItemPresentation ePresentation, MapUnit eCoreMetric, MapUnit ePresentationMetric, OUString &rText, const IntlWrapper &rIntlWrapper) const
This virtual method allows to get a textual representation of the value for the SfxPoolItem subclasse...
Definition: poolitem.cxx:524
sal_uInt32 GetRefCount() const
Definition: poolitem.hxx:226
virtual bool operator==(const SfxPoolItem &) const =0
Definition: poolitem.cxx:478
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId)
Definition: poolitem.cxx:610
virtual SfxPoolItem * Clone(SfxItemPool *pPool=nullptr) const =0
#define DBG_ASSERT(sCon, aError)
virtual void SetValue(tools::Long nNew) override
MapUnit
SfxItemPresentation
Definition: poolitem.hxx:72
#define SVL_DLLPUBLIC
Definition: svldllapi.h:28
unsigned char sal_uInt8