update credits
[LibreOffice.git] / include / svl / intitem.hxx
bloba9cb341aec10ed61d6e801ab7704f8456765c0f7
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 _SFXINTITEM_HXX
21 #define _SFXINTITEM_HXX
23 #include "svl/svldllapi.h"
24 #include <svl/cintitem.hxx>
26 //============================================================================
27 class SVL_DLLPUBLIC SfxByteItem: public CntByteItem
29 public:
30 TYPEINFO();
32 explicit SfxByteItem(sal_uInt16 which = 0, sal_uInt8 nValue = 0):
33 CntByteItem(which, nValue) {}
35 virtual SfxPoolItem * Create(SvStream & rStream, sal_uInt16) const;
37 virtual SfxPoolItem * Clone(SfxItemPool * = 0) const
38 { return new SfxByteItem(*this); }
41 //============================================================================
42 DBG_NAMEEX_VISIBILITY(SfxInt16Item, SVL_DLLPUBLIC)
44 class SVL_DLLPUBLIC SfxInt16Item: public SfxPoolItem
46 sal_Int16 m_nValue;
48 public:
49 TYPEINFO();
51 explicit SfxInt16Item(sal_uInt16 which = 0, sal_Int16 nTheValue = 0):
52 SfxPoolItem(which), m_nValue(nTheValue)
53 { DBG_CTOR(SfxInt16Item, 0); }
55 SfxInt16Item(sal_uInt16 nWhich, SvStream & rStream);
57 SfxInt16Item(const SfxInt16Item & rItem):
58 SfxPoolItem(rItem), m_nValue(rItem.m_nValue)
59 { DBG_CTOR(SfxInt16Item, 0); }
61 virtual ~SfxInt16Item() { DBG_DTOR(SfxInt16Item, 0); }
63 virtual int operator ==(const SfxPoolItem & rItem) const;
65 using SfxPoolItem::Compare;
66 virtual int Compare(const SfxPoolItem & rWith) const;
68 virtual SfxItemPresentation GetPresentation(SfxItemPresentation,
69 SfxMapUnit, SfxMapUnit,
70 OUString & rText,
71 const IntlWrapper * = 0)
72 const;
74 virtual bool QueryValue( com::sun::star::uno::Any& rVal,
75 sal_uInt8 nMemberId = 0 ) const;
77 virtual bool PutValue( const com::sun::star::uno::Any& rVal,
78 sal_uInt8 nMemberId = 0 );
80 virtual SfxPoolItem * Create(SvStream & rStream, sal_uInt16) const;
82 virtual SvStream & Store(SvStream & rStream, sal_uInt16) const;
84 virtual SfxPoolItem * Clone(SfxItemPool * = 0) const;
86 virtual sal_Int16 GetMin() const;
88 virtual sal_Int16 GetMax() const;
90 virtual SfxFieldUnit GetUnit() const;
92 sal_Int16 GetValue() const { return m_nValue; }
94 inline void SetValue(sal_Int16 nTheValue);
97 inline void SfxInt16Item::SetValue(sal_Int16 nTheValue)
99 DBG_ASSERT(GetRefCount() == 0, "SfxInt16Item::SetValue(); Pooled item");
100 m_nValue = nTheValue;
103 //============================================================================
104 class SVL_DLLPUBLIC SfxUInt16Item: public CntUInt16Item
106 public:
107 TYPEINFO();
109 explicit SfxUInt16Item(sal_uInt16 which = 0, sal_uInt16 nValue = 0):
110 CntUInt16Item(which, nValue) {}
112 SfxUInt16Item(sal_uInt16 which, SvStream & rStream):
113 CntUInt16Item(which, rStream) {}
115 virtual SfxPoolItem * Create(SvStream & rStream, sal_uInt16) const
116 { return new SfxUInt16Item(Which(), rStream); }
118 virtual SfxPoolItem * Clone(SfxItemPool * = 0) const
119 { return new SfxUInt16Item(*this); }
122 //============================================================================
123 class SVL_DLLPUBLIC SfxInt32Item: public CntInt32Item
125 public:
126 TYPEINFO();
128 explicit SfxInt32Item(sal_uInt16 which = 0, sal_Int32 nValue = 0):
129 CntInt32Item(which, nValue) {}
131 SfxInt32Item(sal_uInt16 which, SvStream & rStream):
132 CntInt32Item(which, rStream) {}
134 virtual SfxPoolItem * Create(SvStream & rStream, sal_uInt16) const
135 { return new SfxInt32Item(Which(), rStream); }
137 virtual SfxPoolItem * Clone(SfxItemPool * = 0) const
138 { return new SfxInt32Item(*this); }
142 //============================================================================
143 class SVL_DLLPUBLIC SfxUInt32Item: public CntUInt32Item
145 public:
146 TYPEINFO();
148 explicit SfxUInt32Item(sal_uInt16 which = 0, sal_uInt32 nValue = 0):
149 CntUInt32Item(which, nValue) {}
151 SfxUInt32Item(sal_uInt16 which, SvStream & rStream):
152 CntUInt32Item(which, rStream) {}
154 virtual SfxPoolItem * Create(SvStream & rStream, sal_uInt16) const
155 { return new SfxUInt32Item(Which(), rStream); }
157 virtual SfxPoolItem * Clone(SfxItemPool * = 0) const
158 { return new SfxUInt32Item(*this); }
161 #endif // _SFXINTITEM_HXX
163 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */