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_INTITEM_HXX
21 #define INCLUDED_SVL_INTITEM_HXX
23 #include <svl/svldllapi.h>
24 #include <svl/cintitem.hxx>
27 class SVL_DLLPUBLIC SfxByteItem
: public CntByteItem
30 static SfxPoolItem
* CreateDefault();
32 explicit SfxByteItem(sal_uInt16 which
= 0, sal_uInt8 nValue
= 0):
33 CntByteItem(which
, nValue
) {}
35 virtual SfxPoolItem
* Clone(SfxItemPool
* = nullptr) const override
36 { return new SfxByteItem(*this); }
39 class SVL_DLLPUBLIC SfxInt16Item
: public SfxPoolItem
44 static SfxPoolItem
* CreateDefault();
46 explicit SfxInt16Item(sal_uInt16 which
= 0, sal_Int16 nTheValue
= 0):
47 SfxPoolItem(which
), m_nValue(nTheValue
)
50 virtual bool operator ==(const SfxPoolItem
& rItem
) const override
;
52 virtual bool GetPresentation(SfxItemPresentation
,
58 virtual bool QueryValue( css::uno::Any
& rVal
,
59 sal_uInt8 nMemberId
= 0 ) const override
;
61 virtual bool PutValue( const css::uno::Any
& rVal
,
62 sal_uInt8 nMemberId
) override
;
64 virtual SfxPoolItem
* Clone(SfxItemPool
* = nullptr) const override
;
66 sal_Int16
GetValue() const { return m_nValue
; }
68 inline void SetValue(sal_Int16 nTheValue
);
71 inline void SfxInt16Item::SetValue(sal_Int16 nTheValue
)
73 DBG_ASSERT(GetRefCount() == 0, "SfxInt16Item::SetValue(); Pooled item");
78 class SVL_DLLPUBLIC SfxUInt16Item
: public CntUInt16Item
81 static SfxPoolItem
* CreateDefault();
83 explicit SfxUInt16Item(sal_uInt16 which
= 0, sal_uInt16 nValue
= 0):
84 CntUInt16Item(which
, nValue
) {}
86 virtual SfxPoolItem
* Clone(SfxItemPool
* = nullptr) const override
87 { return new SfxUInt16Item(*this); }
89 void dumpAsXml(xmlTextWriterPtr pWriter
) const override
;
93 class SVL_DLLPUBLIC SfxInt32Item
: public CntInt32Item
96 static SfxPoolItem
* CreateDefault();
98 explicit SfxInt32Item(sal_uInt16 which
= 0, sal_Int32 nValue
= 0):
99 CntInt32Item(which
, nValue
) {}
101 virtual SfxPoolItem
* Clone(SfxItemPool
* = nullptr) const override
102 { return new SfxInt32Item(*this); }
104 void dumpAsXml(xmlTextWriterPtr pWriter
) const override
;
108 class SVL_DLLPUBLIC SfxUInt32Item
: public CntUInt32Item
111 static SfxPoolItem
* CreateDefault();
113 explicit SfxUInt32Item(sal_uInt16 which
= 0, sal_uInt32 nValue
= 0):
114 CntUInt32Item(which
, nValue
) {}
116 virtual SfxPoolItem
* Clone(SfxItemPool
* = nullptr) const override
117 { return new SfxUInt32Item(*this); }
119 void dumpAsXml(xmlTextWriterPtr pWriter
) const override
;
122 #endif // INCLUDED_SVL_INTITEM_HXX
124 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */