1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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
33 explicit SfxEnumItem(sal_uInt16
const nWhich
=0, sal_uInt16
const nValue
=0)
34 : SfxEnumItemInterface(nWhich
)
38 SfxEnumItem(const SfxEnumItem
& rItem
)
39 : SfxEnumItemInterface(rItem
)
40 , m_nValue(rItem
.m_nValue
)
43 SfxEnumItem(sal_uInt16
const nWhich
, SvStream
& rStream
);
47 sal_uInt16
GetValue() const { return m_nValue
; }
49 void SetValue(sal_uInt16 nTheValue
);
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
67 static SfxPoolItem
* CreateDefault();
69 explicit SfxBoolItem(sal_uInt16
const nWhich
= 0, bool const bValue
= false)
74 SfxBoolItem(SfxBoolItem
const& rItem
)
76 , m_bValue(rItem
.m_bValue
)
79 SfxBoolItem(sal_uInt16 nWhich
, SvStream
& rStream
);
81 bool GetValue() const { return m_bValue
; }
83 void SetValue(bool const bTheValue
) { m_bValue
= bTheValue
; }
86 virtual bool operator ==(const SfxPoolItem
& rItem
) const override
;
88 virtual bool GetPresentation(SfxItemPresentation
,
91 const IntlWrapper
* = nullptr)
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
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: */