Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*
3 : : * This file is part of the LibreOffice project.
4 : : *
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/.
8 : : *
9 : : * This file incorporates work covered by the following license notice:
10 : : *
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 .
18 : : */
19 : :
20 : : #ifndef _SFXVISIBILITYITEM_HXX
21 : : #define _SFXVISIBILITYITEM_HXX
22 : :
23 : : #include "svl/svldllapi.h"
24 : : #include <tools/debug.hxx>
25 : : #include <svl/poolitem.hxx>
26 : : #include <com/sun/star/frame/status/Visibility.hpp>
27 : :
28 : : //============================================================================
29 : : DBG_NAMEEX_VISIBILITY(SfxVisibilityItem, SVL_DLLPUBLIC)
30 : :
31 : : class SVL_DLLPUBLIC SfxVisibilityItem: public SfxPoolItem
32 : : {
33 : : ::com::sun::star::frame::status::Visibility m_nValue;
34 : :
35 : : public:
36 : : TYPEINFO();
37 : :
38 : 8 : SfxVisibilityItem(sal_uInt16 which = 0, sal_Bool bVisible = sal_True):
39 : 8 : SfxPoolItem(which)
40 : : {
41 : 8 : m_nValue.bVisible = bVisible;
42 : : DBG_CTOR(SfxVisibilityItem, 0);
43 : 8 : }
44 : :
45 : : SfxVisibilityItem(sal_uInt16 which, SvStream & rStream);
46 : :
47 : 16 : SfxVisibilityItem(const SfxVisibilityItem & rItem):
48 : 16 : SfxPoolItem(rItem), m_nValue(rItem.m_nValue)
49 : 16 : { DBG_CTOR(SfxVisibilityItem, 0); }
50 : :
51 [ - + ]: 40 : virtual ~SfxVisibilityItem() { DBG_DTOR(SfxVisibilityItem, 0); }
52 : :
53 : : virtual int operator ==(const SfxPoolItem & rItem) const;
54 : :
55 : : using SfxPoolItem::Compare;
56 : : virtual int Compare(const SfxPoolItem & rWith) const;
57 : :
58 : : virtual SfxItemPresentation GetPresentation(SfxItemPresentation,
59 : : SfxMapUnit, SfxMapUnit,
60 : : XubString & rText,
61 : : const IntlWrapper * = 0)
62 : : const;
63 : :
64 : : virtual bool QueryValue( com::sun::star::uno::Any& rVal,
65 : : sal_uInt8 nMemberId = 0 ) const;
66 : :
67 : : virtual bool PutValue( const com::sun::star::uno::Any& rVal,
68 : : sal_uInt8 nMemberId = 0 );
69 : :
70 : : virtual SfxPoolItem * Create(SvStream & rStream, sal_uInt16) const;
71 : :
72 : : virtual SvStream & Store(SvStream & rStream, sal_uInt16) const;
73 : :
74 : : virtual SfxPoolItem * Clone(SfxItemPool * = 0) const;
75 : :
76 : : virtual sal_uInt16 GetValueCount() const;
77 : :
78 : : virtual rtl::OUString GetValueTextByVal(sal_Bool bTheValue) const;
79 : :
80 : 2 : sal_Bool GetValue() const { return m_nValue.bVisible; }
81 : :
82 : : void SetValue(sal_Bool bVisible) { m_nValue.bVisible = bVisible; }
83 : : };
84 : :
85 : : #endif // _SFXVISIBILITYITEM_HXX
86 : :
87 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|