1*3334a7e6SAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*3334a7e6SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*3334a7e6SAndrew Rist * or more contributor license agreements. See the NOTICE file 5*3334a7e6SAndrew Rist * distributed with this work for additional information 6*3334a7e6SAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*3334a7e6SAndrew Rist * to you under the Apache License, Version 2.0 (the 8*3334a7e6SAndrew Rist * "License"); you may not use this file except in compliance 9*3334a7e6SAndrew Rist * with the License. You may obtain a copy of the License at 10*3334a7e6SAndrew Rist * 11*3334a7e6SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12*3334a7e6SAndrew Rist * 13*3334a7e6SAndrew Rist * Unless required by applicable law or agreed to in writing, 14*3334a7e6SAndrew Rist * software distributed under the License is distributed on an 15*3334a7e6SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*3334a7e6SAndrew Rist * KIND, either express or implied. See the License for the 17*3334a7e6SAndrew Rist * specific language governing permissions and limitations 18*3334a7e6SAndrew Rist * under the License. 19*3334a7e6SAndrew Rist * 20*3334a7e6SAndrew Rist *************************************************************/ 21*3334a7e6SAndrew Rist 22*3334a7e6SAndrew Rist 23cdf0e10cSrcweir #ifndef _SVX_ZOOMITEM_HXX 24cdf0e10cSrcweir #define _SVX_ZOOMITEM_HXX 25cdf0e10cSrcweir 26cdf0e10cSrcweir #include <svl/intitem.hxx> 27cdf0e10cSrcweir #ifndef _SVX_SVXIDS_HRC 28cdf0e10cSrcweir #include <svx/svxids.hrc> 29cdf0e10cSrcweir #endif 30cdf0e10cSrcweir #include "svx/svxdllapi.h" 31cdf0e10cSrcweir 32cdf0e10cSrcweir //------------------------------------------------------------------------- 33cdf0e10cSrcweir 34cdf0e10cSrcweir enum SvxZoomType 35cdf0e10cSrcweir { 36cdf0e10cSrcweir SVX_ZOOM_PERCENT, // GetValue() ist kein besonderer prozentualer Wert 37cdf0e10cSrcweir SVX_ZOOM_OPTIMAL, // GetValue() entspricht der optimalen Gr"o\se 38cdf0e10cSrcweir SVX_ZOOM_WHOLEPAGE, // GetValue() entspricht der ganzen Seite 39cdf0e10cSrcweir SVX_ZOOM_PAGEWIDTH, // GetValue() entspricht der Seitenbreite 40cdf0e10cSrcweir SVX_ZOOM_PAGEWIDTH_NOBORDER // GetValue() pagewidth without border 41cdf0e10cSrcweir }; 42cdf0e10cSrcweir 43cdf0e10cSrcweir //------------------------------------------------------------------------- 44cdf0e10cSrcweir 45cdf0e10cSrcweir class SVX_DLLPUBLIC SvxZoomItem: public SfxUInt16Item 46cdf0e10cSrcweir { 47cdf0e10cSrcweir sal_uInt16 nValueSet; // erlaubte Werte (siehe #defines unten) 48cdf0e10cSrcweir SvxZoomType eType; 49cdf0e10cSrcweir 50cdf0e10cSrcweir public: 51cdf0e10cSrcweir TYPEINFO(); 52cdf0e10cSrcweir 53cdf0e10cSrcweir SvxZoomItem( SvxZoomType eZoomType = SVX_ZOOM_PERCENT, 54cdf0e10cSrcweir sal_uInt16 nVal = 0, sal_uInt16 nWhich = SID_ATTR_ZOOM ); 55cdf0e10cSrcweir SvxZoomItem( const SvxZoomItem& ); 56cdf0e10cSrcweir ~SvxZoomItem(); 57cdf0e10cSrcweir SetValueSet(sal_uInt16 nValues)58cdf0e10cSrcweir void SetValueSet( sal_uInt16 nValues ) { nValueSet = nValues; } GetValueSet() const59cdf0e10cSrcweir sal_uInt16 GetValueSet() const { return nValueSet; } IsValueAllowed(sal_uInt16 nValue) const60cdf0e10cSrcweir FASTBOOL IsValueAllowed( sal_uInt16 nValue ) const 61cdf0e10cSrcweir { return nValue == ( nValue & nValueSet ); } 62cdf0e10cSrcweir GetType() const63cdf0e10cSrcweir SvxZoomType GetType() const { return eType; } SetType(SvxZoomType eNewType)64cdf0e10cSrcweir void SetType( SvxZoomType eNewType ) 65cdf0e10cSrcweir { eType = eNewType; } 66cdf0e10cSrcweir 67cdf0e10cSrcweir virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; 68cdf0e10cSrcweir virtual SfxPoolItem* Create( SvStream& rStrm, sal_uInt16 nVersion ) const; 69cdf0e10cSrcweir virtual SvStream& Store( SvStream& rStrm , sal_uInt16 nItemVersion ) const; 70cdf0e10cSrcweir virtual int operator==( const SfxPoolItem& ) const; 71cdf0e10cSrcweir virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const; 72cdf0e10cSrcweir virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ); 73cdf0e10cSrcweir }; 74cdf0e10cSrcweir 75cdf0e10cSrcweir //------------------------------------------------------------------------ 76cdf0e10cSrcweir 77cdf0e10cSrcweir #define SVX_ZOOM_ENABLE_50 0x0001 78cdf0e10cSrcweir #define SVX_ZOOM_ENABLE_75 0x0002 79cdf0e10cSrcweir #define SVX_ZOOM_ENABLE_100 0x0004 80cdf0e10cSrcweir #define SVX_ZOOM_ENABLE_150 0x0008 81cdf0e10cSrcweir #define SVX_ZOOM_ENABLE_200 0x0010 82cdf0e10cSrcweir #define SVX_ZOOM_ENABLE_OPTIMAL 0x1000 83cdf0e10cSrcweir #define SVX_ZOOM_ENABLE_WHOLEPAGE 0x2000 84cdf0e10cSrcweir #define SVX_ZOOM_ENABLE_PAGEWIDTH 0x4000 85cdf0e10cSrcweir #define SVX_ZOOM_ENABLE_ALL 0x701F 86cdf0e10cSrcweir 87cdf0e10cSrcweir #endif 88