xref: /aoo41x/main/svx/inc/svx/zoomitem.hxx (revision cdf0e10c)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 #ifndef _SVX_ZOOMITEM_HXX
28 #define _SVX_ZOOMITEM_HXX
29 
30 #include <svl/intitem.hxx>
31 #ifndef _SVX_SVXIDS_HRC
32 #include <svx/svxids.hrc>
33 #endif
34 #include "svx/svxdllapi.h"
35 
36 //-------------------------------------------------------------------------
37 
38 enum SvxZoomType
39 {
40 	SVX_ZOOM_PERCENT,   	// GetValue() ist kein besonderer prozentualer Wert
41 	SVX_ZOOM_OPTIMAL,		// GetValue() entspricht der optimalen Gr"o\se
42 	SVX_ZOOM_WHOLEPAGE,		// GetValue() entspricht der ganzen Seite
43     SVX_ZOOM_PAGEWIDTH,      // GetValue() entspricht der Seitenbreite
44     SVX_ZOOM_PAGEWIDTH_NOBORDER  // GetValue() pagewidth without border
45 };
46 
47 //-------------------------------------------------------------------------
48 
49 class SVX_DLLPUBLIC SvxZoomItem: public SfxUInt16Item
50 {
51 	sal_uInt16					nValueSet;	// erlaubte Werte (siehe #defines unten)
52 	SvxZoomType				eType;
53 
54 public:
55 	TYPEINFO();
56 
57 	SvxZoomItem( SvxZoomType eZoomType = SVX_ZOOM_PERCENT,
58 				 sal_uInt16 nVal = 0, sal_uInt16 nWhich = SID_ATTR_ZOOM );
59 	SvxZoomItem( const SvxZoomItem& );
60 	~SvxZoomItem();
61 
62 	void					SetValueSet( sal_uInt16 nValues ) { nValueSet = nValues; }
63 	sal_uInt16					GetValueSet() const { return nValueSet; }
64 	FASTBOOL				IsValueAllowed( sal_uInt16 nValue ) const
65 							{ return nValue == ( nValue & nValueSet ); }
66 
67 	SvxZoomType 			GetType() const { return eType; }
68 	void					SetType( SvxZoomType eNewType )
69 							{ eType = eNewType; }
70 
71 	virtual SfxPoolItem*	Clone( SfxItemPool *pPool = 0 ) const;
72 	virtual SfxPoolItem*	Create( SvStream& rStrm, sal_uInt16 nVersion ) const;
73 	virtual SvStream&		Store( SvStream& rStrm , sal_uInt16 nItemVersion ) const;
74 	virtual int				operator==( const SfxPoolItem& ) const;
75 	virtual	sal_Bool        	 QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
76 	virtual	sal_Bool			 PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
77 };
78 
79 //------------------------------------------------------------------------
80 
81 #define SVX_ZOOM_ENABLE_50 			0x0001
82 #define SVX_ZOOM_ENABLE_75 			0x0002
83 #define SVX_ZOOM_ENABLE_100			0x0004
84 #define SVX_ZOOM_ENABLE_150			0x0008
85 #define SVX_ZOOM_ENABLE_200			0x0010
86 #define SVX_ZOOM_ENABLE_OPTIMAL		0x1000
87 #define SVX_ZOOM_ENABLE_WHOLEPAGE	0x2000
88 #define SVX_ZOOM_ENABLE_PAGEWIDTH	0x4000
89 #define SVX_ZOOM_ENABLE_ALL         0x701F
90 
91 #endif
92