xref: /aoo4110/main/sc/inc/printopt.hxx (revision b1cdbd2c)
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 SC_PRINTOPT_HXX
25 #define SC_PRINTOPT_HXX
26 
27 #include <svl/poolitem.hxx>
28 #include <unotools/configitem.hxx>
29 #include "scdllapi.h"
30 
31 class SC_DLLPUBLIC ScPrintOptions
32 {
33 private:
34 	sal_Bool	bSkipEmpty;
35 	sal_Bool	bAllSheets;
36 
37 public:
38 				ScPrintOptions();
39 				ScPrintOptions( const ScPrintOptions& rCpy );
40 				~ScPrintOptions();
41 
GetSkipEmpty() const42 	sal_Bool	GetSkipEmpty() const			{ return bSkipEmpty; }
SetSkipEmpty(sal_Bool bVal)43 	void	SetSkipEmpty( sal_Bool bVal )		{ bSkipEmpty = bVal; }
GetAllSheets() const44 	sal_Bool	GetAllSheets() const			{ return bAllSheets; }
SetAllSheets(sal_Bool bVal)45 	void	SetAllSheets( sal_Bool bVal )		{ bAllSheets = bVal; }
46 
47 	void	SetDefaults();
48 
49 	const ScPrintOptions&	operator=  ( const ScPrintOptions& rCpy );
50 	int						operator== ( const ScPrintOptions& rOpt ) const;
51 	int						operator!= ( const ScPrintOptions& rOpt ) const;
52 };
53 
54 //==================================================================
55 // item for the dialog / options page
56 //==================================================================
57 
58 class SC_DLLPUBLIC ScTpPrintItem : public SfxPoolItem
59 {
60 public:
61 				TYPEINFO();
62 //UNUSED2008-05  ScTpPrintItem( sal_uInt16 nWhich );
63 				ScTpPrintItem( sal_uInt16 nWhich,
64 							   const ScPrintOptions& rOpt );
65 				ScTpPrintItem( const ScTpPrintItem& rItem );
66 				~ScTpPrintItem();
67 
68 	virtual String          GetValueText() const;
69 	virtual int             operator==( const SfxPoolItem& ) const;
70 	virtual SfxPoolItem*    Clone( SfxItemPool *pPool = 0 ) const;
71 
GetPrintOptions() const72 	const ScPrintOptions&	GetPrintOptions() const { return theOptions; }
73 
74 private:
75 	ScPrintOptions theOptions;
76 };
77 
78 //==================================================================
79 // config item
80 //==================================================================
81 
82 class ScPrintCfg : public ScPrintOptions, public utl::ConfigItem
83 {
84 	com::sun::star::uno::Sequence<rtl::OUString> GetPropertyNames();
85 
86 public:
87 			ScPrintCfg();
88 
89 	void			SetOptions( const ScPrintOptions& rNew );
90 
91 	virtual void	Commit();
92 	virtual void Notify( const ::com::sun::star::uno::Sequence< rtl::OUString >& aPropertyNames );
93 };
94 
95 #endif
96