1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: zoomitem.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef _SVX_ZOOMITEM_HXX
31 #define _SVX_ZOOMITEM_HXX
33 #ifndef _SFXINTITEM_HXX //autogen
34 #include <bf_svtools/intitem.hxx>
36 #ifndef _SVX_SVXIDS_HRC
37 #include <bf_svx/svxids.hrc>
41 //-------------------------------------------------------------------------
45 SVX_ZOOM_PERCENT
, // GetValue() ist kein besonderer prozentualer Wert
46 SVX_ZOOM_OPTIMAL
, // GetValue() entspricht der optimalen Gr"o\se
47 SVX_ZOOM_WHOLEPAGE
, // GetValue() entspricht der ganzen Seite
48 SVX_ZOOM_PAGEWIDTH
, // GetValue() entspricht der Seitenbreite
49 SVX_ZOOM_PAGEWIDTH_NOBORDER
// GetValue() pagewidth without border
52 //-------------------------------------------------------------------------
54 class SvxZoomItem
: public SfxUInt16Item
56 USHORT nValueSet
; // erlaubte Werte (siehe #defines unten)
62 SvxZoomItem( SvxZoomType eZoomType
= SVX_ZOOM_PERCENT
,
63 USHORT nVal
= 0, USHORT nWhich
= SID_ATTR_ZOOM
);
64 SvxZoomItem( const SvxZoomItem
& );
67 void SetValueSet( USHORT nValues
) { nValueSet
= nValues
; }
68 USHORT
GetValueSet() const { return nValueSet
; }
69 FASTBOOL
IsValueAllowed( USHORT nValue
) const
70 { return nValue
== ( nValue
& nValueSet
); }
72 SvxZoomType
GetType() const { return eType
; }
73 void SetType( SvxZoomType eNewType
)
76 virtual SfxPoolItem
* Clone( SfxItemPool
*pPool
= 0 ) const;
77 virtual int operator==( const SfxPoolItem
& ) const;
80 //------------------------------------------------------------------------
82 #define SVX_ZOOM_ENABLE_50 0x0001
83 #define SVX_ZOOM_ENABLE_75 0x0002
84 #define SVX_ZOOM_ENABLE_100 0x0004
85 #define SVX_ZOOM_ENABLE_150 0x0008
86 #define SVX_ZOOM_ENABLE_200 0x0010
87 #define SVX_ZOOM_ENABLE_OPTIMAL 0x1000
88 #define SVX_ZOOM_ENABLE_WHOLEPAGE 0x2000
89 #define SVX_ZOOM_ENABLE_PAGEWIDTH 0x4000
90 #define SVX_ZOOM_ENABLE_ALL 0x701F
92 }//end of namespace binfilter