1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 24 #ifndef _SFXVISIBILITYITEM_HXX 25 #define _SFXVISIBILITYITEM_HXX 26 27 #include "svl/svldllapi.h" 28 #include <tools/debug.hxx> 29 #include <svl/poolitem.hxx> 30 #include <com/sun/star/frame/status/Visibility.hpp> 31 32 //============================================================================ 33 DBG_NAMEEX_VISIBILITY(SfxVisibilityItem, SVL_DLLPUBLIC) 34 35 class SVL_DLLPUBLIC SfxVisibilityItem: public SfxPoolItem 36 { 37 ::com::sun::star::frame::status::Visibility m_nValue; 38 39 public: 40 TYPEINFO(); 41 SfxVisibilityItem(sal_uInt16 which=0,sal_Bool bVisible=sal_True)42 SfxVisibilityItem(sal_uInt16 which = 0, sal_Bool bVisible = sal_True): 43 SfxPoolItem(which) 44 { 45 m_nValue.bVisible = bVisible; 46 DBG_CTOR(SfxVisibilityItem, 0); 47 } 48 49 SfxVisibilityItem(sal_uInt16 which, SvStream & rStream); 50 SfxVisibilityItem(const SfxVisibilityItem & rItem)51 SfxVisibilityItem(const SfxVisibilityItem & rItem): 52 SfxPoolItem(rItem), m_nValue(rItem.m_nValue) 53 { DBG_CTOR(SfxVisibilityItem, 0); } 54 ~SfxVisibilityItem()55 virtual ~SfxVisibilityItem() { DBG_DTOR(SfxVisibilityItem, 0); } 56 57 virtual int operator ==(const SfxPoolItem & rItem) const; 58 59 using SfxPoolItem::Compare; 60 virtual int Compare(const SfxPoolItem & rWith) const; 61 62 virtual SfxItemPresentation GetPresentation(SfxItemPresentation, 63 SfxMapUnit, SfxMapUnit, 64 XubString & rText, 65 const IntlWrapper * = 0) 66 const; 67 68 virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, 69 sal_uInt8 nMemberId = 0 ) const; 70 71 virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, 72 sal_uInt8 nMemberId = 0 ); 73 74 virtual SfxPoolItem * Create(SvStream & rStream, sal_uInt16) const; 75 76 virtual SvStream & Store(SvStream & rStream, sal_uInt16) const; 77 78 virtual SfxPoolItem * Clone(SfxItemPool * = 0) const; 79 80 virtual sal_uInt16 GetValueCount() const; 81 82 virtual UniString GetValueTextByVal(sal_Bool bTheValue) const; 83 GetValue() const84 sal_Bool GetValue() const { return m_nValue.bVisible; } 85 SetValue(sal_Bool bVisible)86 void SetValue(sal_Bool bVisible) { m_nValue.bVisible = bVisible; } 87 }; 88 89 #endif // _SFXVISIBILITYITEM_HXX 90