LibreOffice Module svl (master) 1
intitem.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_INTITEM_HXX
21#define INCLUDED_SVL_INTITEM_HXX
22
23#include <svl/svldllapi.h>
24#include <svl/cintitem.hxx>
25#include <boost/property_tree/ptree_fwd.hpp>
26
27
29{
30public:
31 static SfxPoolItem* CreateDefault();
32
33 explicit SfxByteItem(sal_uInt16 which = 0, sal_uInt8 nValue = 0):
34 CntByteItem(which, nValue) {}
35
36 virtual SfxByteItem* Clone(SfxItemPool * = nullptr) const override
37 { return new SfxByteItem(*this); }
38};
39
41{
42 sal_Int16 m_nValue;
43
44public:
45 static SfxPoolItem* CreateDefault();
46
47 explicit SfxInt16Item(sal_uInt16 which = 0, sal_Int16 nTheValue = 0):
48 SfxPoolItem(which), m_nValue(nTheValue)
49 {}
50
51 virtual bool operator ==(const SfxPoolItem & rItem) const override;
52
55 OUString & rText,
56 const IntlWrapper&)
57 const override;
58
59 virtual boost::property_tree::ptree dumpAsJSON() const override;
60
61 virtual bool QueryValue( css::uno::Any& rVal,
62 sal_uInt8 nMemberId = 0 ) const override;
63
64 virtual bool PutValue( const css::uno::Any& rVal,
65 sal_uInt8 nMemberId ) override;
66
67 virtual SfxInt16Item* Clone(SfxItemPool * = nullptr) const override;
68
69 sal_Int16 GetValue() const { return m_nValue; }
70
71 inline void SetValue(sal_Int16 nTheValue);
72};
73
74inline void SfxInt16Item::SetValue(sal_Int16 nTheValue)
75{
76 DBG_ASSERT(GetRefCount() == 0, "SfxInt16Item::SetValue(); Pooled item");
77 m_nValue = nTheValue;
78}
79
80
82{
83public:
84 static SfxPoolItem* CreateDefault();
85
86 explicit SfxUInt16Item(sal_uInt16 which = 0, sal_uInt16 nValue = 0):
87 CntUInt16Item(which, nValue) {}
88
89 virtual SfxUInt16Item* Clone(SfxItemPool * = nullptr) const override
90 { return new SfxUInt16Item(*this); }
91
92 void dumpAsXml(xmlTextWriterPtr pWriter) const override;
93 virtual boost::property_tree::ptree dumpAsJSON() const override;
94};
95
96
98{
99public:
100 static SfxPoolItem* CreateDefault();
101
102 explicit SfxInt32Item(sal_uInt16 which = 0, sal_Int32 nValue = 0):
103 CntInt32Item(which, nValue) {}
104
105 virtual SfxInt32Item* Clone(SfxItemPool * = nullptr) const override
106 { return new SfxInt32Item(*this); }
107
108 void dumpAsXml(xmlTextWriterPtr pWriter) const override;
109 virtual boost::property_tree::ptree dumpAsJSON() const override;
110};
111
112
114{
115public:
116 static SfxPoolItem* CreateDefault();
117
118 explicit SfxUInt32Item(sal_uInt16 which = 0, sal_uInt32 nValue = 0):
119 CntUInt32Item(which, nValue) {}
120
121 virtual SfxUInt32Item* Clone(SfxItemPool * = nullptr) const override
122 { return new SfxUInt32Item(*this); }
123
124 void dumpAsXml(xmlTextWriterPtr pWriter) const override;
125 virtual boost::property_tree::ptree dumpAsJSON() const override;
126};
127
128#endif // INCLUDED_SVL_INTITEM_HXX
129
130/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
sal_uInt8 m_nValue
Definition: cintitem.hxx:29
void SetValue(sal_uInt8 nTheValue)
Definition: cintitem.hxx:57
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
Definition: cintitem.cxx:50
virtual CntByteItem * Clone(SfxItemPool *=nullptr) const override
Definition: cintitem.cxx:64
virtual bool GetPresentation(SfxItemPresentation, MapUnit, MapUnit, OUString &rText, const IntlWrapper &) const override
This virtual method allows to get a textual representation of the value for the SfxPoolItem subclasse...
Definition: cintitem.cxx:33
virtual bool operator==(const SfxPoolItem &rItem) const override
Definition: cintitem.cxx:26
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
Definition: cintitem.cxx:42
SfxByteItem(sal_uInt16 which=0, sal_uInt8 nValue=0)
Definition: intitem.hxx:33
virtual SfxByteItem * Clone(SfxItemPool *=nullptr) const override
Definition: intitem.hxx:36
sal_Int16 GetValue() const
Definition: intitem.hxx:69
void SetValue(sal_Int16 nTheValue)
Definition: intitem.hxx:74
SfxInt16Item(sal_uInt16 which=0, sal_Int16 nTheValue=0)
Definition: intitem.hxx:47
sal_Int16 m_nValue
Definition: intitem.hxx:42
virtual SfxInt32Item * Clone(SfxItemPool *=nullptr) const override
Definition: intitem.hxx:105
SfxInt32Item(sal_uInt16 which=0, sal_Int32 nValue=0)
Definition: intitem.hxx:102
Base class for providers of defaults of SfxPoolItems.
Definition: itempool.hxx:51
sal_uInt32 GetRefCount() const
Definition: poolitem.hxx:226
virtual void dumpAsXml(xmlTextWriterPtr pWriter) const
Definition: poolitem.cxx:534
virtual boost::property_tree::ptree dumpAsJSON() const
Definition: poolitem.cxx:551
virtual SfxUInt16Item * Clone(SfxItemPool *=nullptr) const override
Definition: intitem.hxx:89
SfxUInt16Item(sal_uInt16 which=0, sal_uInt16 nValue=0)
Definition: intitem.hxx:86
virtual SfxUInt32Item * Clone(SfxItemPool *=nullptr) const override
Definition: intitem.hxx:121
SfxUInt32Item(sal_uInt16 which=0, sal_uInt32 nValue=0)
Definition: intitem.hxx:118
#define DBG_ASSERT(sCon, aError)
struct _xmlTextWriter * xmlTextWriterPtr
sal_Int16 nValue
MapUnit
SfxItemPresentation
Definition: poolitem.hxx:72
#define SVL_DLLPUBLIC
Definition: svldllapi.h:28
unsigned char sal_uInt8