sc: copy cache values when clone color conditional format
[LibreOffice.git] / include / svl / cintitem.hxx
blobbde59c39906b495f0503d235a3d0186f4bb534bb
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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
29 sal_uInt8 m_nValue;
31 public:
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,
39 MapUnit, MapUnit,
40 OUString & rText,
41 const IntlWrapper&)
42 const override;
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");
60 m_nValue = nTheValue;
63 class SVL_DLLPUBLIC CntUInt16Item: public SfxPoolItem
65 sal_uInt16 m_nValue;
67 public:
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,
76 MapUnit, MapUnit,
77 OUString & rText,
78 const IntlWrapper&)
79 const override;
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");
97 m_nValue = nTheValue;
100 class SVL_DLLPUBLIC CntInt32Item: public SfxPoolItem
102 sal_Int32 m_nValue;
104 public:
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,
113 MapUnit, MapUnit,
114 OUString & rText,
115 const IntlWrapper&)
116 const override;
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
139 sal_uInt32 m_nValue;
141 public:
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,
150 MapUnit, MapUnit,
151 OUString & rText,
152 const IntlWrapper&)
153 const override;
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: */