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
33 CntByteItem(sal_uInt16 which
, sal_uInt8 nTheValue
):
34 SfxPoolItem(which
), m_nValue(nTheValue
) {}
36 virtual bool operator ==(const SfxPoolItem
& rItem
) const override
;
38 virtual bool GetPresentation(SfxItemPresentation
,
44 virtual bool QueryValue(css::uno::Any
& rVal
,
45 sal_uInt8 nMemberId
= 0) const override
;
47 virtual bool PutValue(const css::uno::Any
& rVal
,
48 sal_uInt8 nMemberId
) override
;
50 virtual CntByteItem
* Clone(SfxItemPool
* = nullptr) const override
;
52 sal_uInt8
GetValue() const { return m_nValue
; }
54 inline void SetValue(sal_uInt8 nTheValue
);
57 inline void CntByteItem::SetValue(sal_uInt8 nTheValue
)
59 DBG_ASSERT(GetRefCount() == 0, "CntByteItem::SetValue(): Pooled item");
63 class SVL_DLLPUBLIC CntUInt16Item
: public SfxPoolItem
69 CntUInt16Item(sal_uInt16 which
, sal_uInt16 nTheValue
):
70 SfxPoolItem(which
), m_nValue(nTheValue
)
73 virtual bool operator ==(const SfxPoolItem
& rItem
) const override
;
75 virtual bool GetPresentation(SfxItemPresentation
,
81 virtual bool QueryValue(css::uno::Any
& rVal
,
82 sal_uInt8 nMemberId
= 0) const override
;
84 virtual bool PutValue(const css::uno::Any
& rVal
,
85 sal_uInt8 nMemberId
) override
;
87 virtual CntUInt16Item
* Clone(SfxItemPool
* = nullptr) const override
;
89 sal_uInt16
GetValue() const { return m_nValue
; }
91 inline void SetValue(sal_uInt16 nTheValue
);
94 inline void CntUInt16Item::SetValue(sal_uInt16 nTheValue
)
96 DBG_ASSERT(GetRefCount() == 0, "CntUInt16Item::SetValue(): Pooled item");
100 class SVL_DLLPUBLIC CntInt32Item
: public SfxPoolItem
106 CntInt32Item(sal_uInt16 which
, sal_Int32 nTheValue
):
107 SfxPoolItem(which
), m_nValue(nTheValue
)
110 virtual bool operator ==(const SfxPoolItem
& rItem
) const override
;
112 virtual bool GetPresentation(SfxItemPresentation
,
118 virtual bool QueryValue(css::uno::Any
& rVal
,
119 sal_uInt8 nMemberId
= 0) const override
;
121 virtual bool PutValue(const css::uno::Any
& rVal
,
122 sal_uInt8 nMemberId
) override
;
124 virtual CntInt32Item
* Clone(SfxItemPool
* = nullptr) const override
;
126 sal_Int32
GetValue() const { return m_nValue
; }
128 inline void SetValue(sal_Int32 nTheValue
);
131 inline void CntInt32Item::SetValue(sal_Int32 nTheValue
)
133 DBG_ASSERT(GetRefCount() == 0, "CntInt32Item::SetValue(): Pooled item");
134 m_nValue
= nTheValue
;
137 class SVL_DLLPUBLIC CntUInt32Item
: public SfxPoolItem
143 CntUInt32Item(sal_uInt16 which
, sal_uInt32 nTheValue
):
144 SfxPoolItem(which
), m_nValue(nTheValue
)
147 virtual bool operator ==(const SfxPoolItem
& rItem
) const override
;
149 virtual bool GetPresentation(SfxItemPresentation
,
155 virtual bool QueryValue(css::uno::Any
& rVal
,
156 sal_uInt8 nMemberId
= 0) const override
;
158 virtual bool PutValue(const css::uno::Any
& rVal
,
159 sal_uInt8 nMemberId
) override
;
161 virtual CntUInt32Item
* Clone(SfxItemPool
* = nullptr) const override
;
163 sal_uInt32
GetValue() const { return m_nValue
; }
165 inline void SetValue(sal_uInt32 nTheValue
);
168 inline void CntUInt32Item::SetValue(sal_uInt32 nTheValue
)
170 DBG_ASSERT(GetRefCount() == 0, "CntUInt32Item::SetValue(): Pooled item");
171 m_nValue
= nTheValue
;
174 #endif // INCLUDED_SVL_CINTITEM_HXX
176 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */