update credits
[LibreOffice.git] / include / svl / eitem.hxx
blobd01ce77a33675dd645689f4c657da237ec3b4516
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_EITEM_HXX
21 #define INCLUDED_SVL_EITEM_HXX
23 #include <svl/svldllapi.h>
24 #include <svl/cenumitm.hxx>
28 class SVL_DLLPUBLIC SfxEnumItem
29 : public SfxEnumItemInterface
31 sal_uInt16 m_nValue;
33 protected:
34 explicit SfxEnumItem(sal_uInt16 const nWhich =0, sal_uInt16 const nValue =0)
35 : SfxEnumItemInterface(nWhich)
36 , m_nValue(nValue)
37 { }
39 SfxEnumItem(const SfxEnumItem & rItem)
40 : SfxEnumItemInterface(rItem)
41 , m_nValue(rItem.m_nValue)
42 { }
44 SfxEnumItem(sal_uInt16 const nWhich, SvStream & rStream);
46 public:
47 TYPEINFO_OVERRIDE();
49 sal_uInt16 GetValue() const { return m_nValue; }
51 void SetValue(sal_uInt16 nTheValue);
53 // SfxPoolItem
54 virtual SvStream & Store(SvStream & rStream, sal_uInt16) const SAL_OVERRIDE;
56 virtual sal_uInt16 GetEnumValue() const SAL_OVERRIDE;
58 virtual void SetEnumValue(sal_uInt16 nTheValue) SAL_OVERRIDE;
64 class SVL_DLLPUBLIC SfxBoolItem
65 : public SfxPoolItem
67 bool m_bValue;
69 public:
70 TYPEINFO_OVERRIDE();
72 explicit SfxBoolItem(sal_uInt16 const nWhich = 0, bool const bValue = false)
73 : SfxPoolItem(nWhich)
74 , m_bValue(bValue)
75 { }
77 SfxBoolItem(SfxBoolItem const& rItem)
78 : SfxPoolItem(rItem)
79 , m_bValue(rItem.m_bValue)
80 { }
82 SfxBoolItem(sal_uInt16 nWhich, SvStream & rStream);
84 bool GetValue() const { return m_bValue; }
86 void SetValue(bool const bTheValue) { m_bValue = bTheValue; }
88 // SfxPoolItem
89 virtual bool operator ==(const SfxPoolItem & rItem) const SAL_OVERRIDE;
91 using SfxPoolItem::Compare;
92 virtual int Compare(const SfxPoolItem & rWith) const SAL_OVERRIDE;
94 virtual bool GetPresentation(SfxItemPresentation,
95 SfxMapUnit, SfxMapUnit,
96 OUString & rText,
97 const IntlWrapper * = 0)
98 const SAL_OVERRIDE;
100 virtual bool QueryValue(com::sun::star::uno::Any& rVal, sal_uInt8 = 0)
101 const SAL_OVERRIDE;
103 virtual bool PutValue(const com::sun::star::uno::Any& rVal, sal_uInt8 = 0)
104 SAL_OVERRIDE;
107 virtual SfxPoolItem * Create(SvStream & rStream, sal_uInt16) const
108 SAL_OVERRIDE;
110 virtual SvStream & Store(SvStream & rStream, sal_uInt16) const SAL_OVERRIDE;
112 virtual SfxPoolItem * Clone(SfxItemPool * = 0) const SAL_OVERRIDE;
114 virtual OUString GetValueTextByVal(bool bTheValue) const;
117 #endif // INCLUDED_SVL_EITEM_HXX
119 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */