update credits
[LibreOffice.git] / include / svl / intitem.hxx
blob12536c4c9de7836d8d67604ae4b04a45914f5ca9
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_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
29 public:
30 TYPEINFO_OVERRIDE();
32 explicit SfxByteItem(sal_uInt16 which = 0, sal_uInt8 nValue = 0):
33 CntByteItem(which, nValue) {}
35 virtual SfxPoolItem * Create(SvStream & rStream, sal_uInt16) const SAL_OVERRIDE;
37 virtual SfxPoolItem * Clone(SfxItemPool * = 0) const SAL_OVERRIDE
38 { return new SfxByteItem(*this); }
41 class SVL_DLLPUBLIC SfxInt16Item: public SfxPoolItem
43 sal_Int16 m_nValue;
45 public:
46 TYPEINFO_OVERRIDE();
48 explicit SfxInt16Item(sal_uInt16 which = 0, sal_Int16 nTheValue = 0):
49 SfxPoolItem(which), m_nValue(nTheValue)
52 SfxInt16Item(sal_uInt16 nWhich, SvStream & rStream);
54 SfxInt16Item(const SfxInt16Item & rItem):
55 SfxPoolItem(rItem), m_nValue(rItem.m_nValue)
58 virtual ~SfxInt16Item() {}
60 virtual bool operator ==(const SfxPoolItem & rItem) const SAL_OVERRIDE;
62 using SfxPoolItem::Compare;
63 virtual int Compare(const SfxPoolItem & rWith) const SAL_OVERRIDE;
65 virtual bool GetPresentation(SfxItemPresentation,
66 SfxMapUnit, SfxMapUnit,
67 OUString & rText,
68 const IntlWrapper * = 0)
69 const SAL_OVERRIDE;
71 virtual bool QueryValue( com::sun::star::uno::Any& rVal,
72 sal_uInt8 nMemberId = 0 ) const SAL_OVERRIDE;
74 virtual bool PutValue( const com::sun::star::uno::Any& rVal,
75 sal_uInt8 nMemberId = 0 ) SAL_OVERRIDE;
77 virtual SfxPoolItem * Create(SvStream & rStream, sal_uInt16) const SAL_OVERRIDE;
79 virtual SvStream & Store(SvStream & rStream, sal_uInt16) const SAL_OVERRIDE;
81 virtual SfxPoolItem * Clone(SfxItemPool * = 0) const SAL_OVERRIDE;
83 sal_Int16 GetValue() const { return m_nValue; }
85 inline void SetValue(sal_Int16 nTheValue);
88 inline void SfxInt16Item::SetValue(sal_Int16 nTheValue)
90 DBG_ASSERT(GetRefCount() == 0, "SfxInt16Item::SetValue(); Pooled item");
91 m_nValue = nTheValue;
95 class SVL_DLLPUBLIC SfxUInt16Item: public CntUInt16Item
97 public:
98 TYPEINFO_OVERRIDE();
100 explicit SfxUInt16Item(sal_uInt16 which = 0, sal_uInt16 nValue = 0):
101 CntUInt16Item(which, nValue) {}
103 SfxUInt16Item(sal_uInt16 which, SvStream & rStream):
104 CntUInt16Item(which, rStream) {}
106 virtual SfxPoolItem * Create(SvStream & rStream, sal_uInt16) const SAL_OVERRIDE
107 { return new SfxUInt16Item(Which(), rStream); }
109 virtual SfxPoolItem * Clone(SfxItemPool * = 0) const SAL_OVERRIDE
110 { return new SfxUInt16Item(*this); }
112 void dumpAsXml(struct _xmlTextWriter* pWriter) const SAL_OVERRIDE;
116 class SVL_DLLPUBLIC SfxInt32Item: public CntInt32Item
118 public:
119 TYPEINFO_OVERRIDE();
121 explicit SfxInt32Item(sal_uInt16 which = 0, sal_Int32 nValue = 0):
122 CntInt32Item(which, nValue) {}
124 SfxInt32Item(sal_uInt16 which, SvStream & rStream):
125 CntInt32Item(which, rStream) {}
127 virtual SfxPoolItem * Create(SvStream & rStream, sal_uInt16) const SAL_OVERRIDE
128 { return new SfxInt32Item(Which(), rStream); }
130 virtual SfxPoolItem * Clone(SfxItemPool * = 0) const SAL_OVERRIDE
131 { return new SfxInt32Item(*this); }
136 class SVL_DLLPUBLIC SfxUInt32Item: public CntUInt32Item
138 public:
139 TYPEINFO_OVERRIDE();
141 explicit SfxUInt32Item(sal_uInt16 which = 0, sal_uInt32 nValue = 0):
142 CntUInt32Item(which, nValue) {}
144 SfxUInt32Item(sal_uInt16 which, SvStream & rStream):
145 CntUInt32Item(which, rStream) {}
147 virtual SfxPoolItem * Create(SvStream & rStream, sal_uInt16) const SAL_OVERRIDE
148 { return new SfxUInt32Item(Which(), rStream); }
150 virtual SfxPoolItem * Clone(SfxItemPool * = 0) const SAL_OVERRIDE
151 { return new SfxUInt32Item(*this); }
154 #endif // INCLUDED_SVL_INTITEM_HXX
156 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */