build fix
[LibreOffice.git] / include / svl / eitem.hxx
blob16518a7bea389d000dd7f679b2ef412224f3ffb5
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>
27 class SVL_DLLPUBLIC SfxEnumItem
28 : public SfxEnumItemInterface
30 sal_uInt16 m_nValue;
32 protected:
33 explicit SfxEnumItem(sal_uInt16 const nWhich =0, sal_uInt16 const nValue =0)
34 : SfxEnumItemInterface(nWhich)
35 , m_nValue(nValue)
36 { }
38 SfxEnumItem(const SfxEnumItem & rItem)
39 : SfxEnumItemInterface(rItem)
40 , m_nValue(rItem.m_nValue)
41 { }
43 SfxEnumItem(sal_uInt16 const nWhich, SvStream & rStream);
45 public:
47 sal_uInt16 GetValue() const { return m_nValue; }
49 void SetValue(sal_uInt16 nTheValue);
51 // SfxPoolItem
52 virtual SvStream & Store(SvStream & rStream, sal_uInt16) const override;
54 virtual sal_uInt16 GetEnumValue() const override;
56 virtual void SetEnumValue(sal_uInt16 nTheValue) override;
61 class SVL_DLLPUBLIC SfxBoolItem
62 : public SfxPoolItem
64 bool m_bValue;
66 public:
67 static SfxPoolItem* CreateDefault();
69 explicit SfxBoolItem(sal_uInt16 const nWhich = 0, bool const bValue = false)
70 : SfxPoolItem(nWhich)
71 , m_bValue(bValue)
72 { }
74 SfxBoolItem(SfxBoolItem const& rItem)
75 : SfxPoolItem(rItem)
76 , m_bValue(rItem.m_bValue)
77 { }
79 SfxBoolItem(sal_uInt16 nWhich, SvStream & rStream);
81 bool GetValue() const { return m_bValue; }
83 void SetValue(bool const bTheValue) { m_bValue = bTheValue; }
85 // SfxPoolItem
86 virtual bool operator ==(const SfxPoolItem & rItem) const override;
88 virtual bool GetPresentation(SfxItemPresentation,
89 MapUnit, MapUnit,
90 OUString & rText,
91 const IntlWrapper * = nullptr)
92 const override;
94 virtual void dumpAsXml(struct _xmlTextWriter* pWriter) const override;
96 virtual bool QueryValue(css::uno::Any& rVal, sal_uInt8 = 0) const override;
98 virtual bool PutValue(const css::uno::Any& rVal, sal_uInt8) override;
101 virtual SfxPoolItem * Create(SvStream & rStream, sal_uInt16) const
102 override;
104 virtual SvStream & Store(SvStream & rStream, sal_uInt16) const override;
106 virtual SfxPoolItem * Clone(SfxItemPool * = nullptr) const override;
108 virtual OUString GetValueTextByVal(bool bTheValue) const;
111 #endif // INCLUDED_SVL_EITEM_HXX
113 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */