xref: /aoo4110/main/sfx2/inc/sfx2/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 _SFX_PRINTOPT_HXX
25 #define _SFX_PRINTOPT_HXX
26 
27 #include "sal/config.h"
28 #include "sfx2/dllapi.h"
29 #include "sal/types.h"
30 #ifndef _SV_BUTTON_HXX
31 #include <vcl/button.hxx>
32 #endif
33 #include <vcl/field.hxx>
34 #include <vcl/fixed.hxx>
35 #ifndef _SV_BUTTON_HXX //autogen wg. FixedText
36 #include <vcl/button.hxx>
37 #endif
38 #include <vcl/lstbox.hxx>
39 #include <vcl/print.hxx>
40 
41 #include <sfx2/tabdlg.hxx>
42 
43 // --------------------------------
44 // - SfxCommonPrintOptionsTabPage -
45 // --------------------------------
46 
47 class SvtBasePrintOptions;
48 
49 class SFX2_DLLPUBLIC SfxCommonPrintOptionsTabPage : public SfxTabPage
50 {
51 private:
52 
53     FixedLine           aReduceGB;
54 
55     FixedText           aOutputTypeFT;
56     RadioButton         aPrinterOutputRB;
57     RadioButton         aPrintFileOutputRB;
58 
59     FixedLine           aOutputGB;
60 
61     CheckBox            aReduceTransparencyCB;
62     RadioButton         aReduceTransparencyAutoRB;
63     RadioButton         aReduceTransparencyNoneRB;
64 
65     CheckBox            aReduceGradientsCB;
66     RadioButton         aReduceGradientsStripesRB;
67     RadioButton         aReduceGradientsColorRB;
68     NumericField        aReduceGradientsStepCountNF;
69 
70     CheckBox            aReduceBitmapsCB;
71     RadioButton         aReduceBitmapsOptimalRB;
72     RadioButton         aReduceBitmapsNormalRB;
73     RadioButton         aReduceBitmapsResolutionRB;
74     ListBox             aReduceBitmapsResolutionLB;
75     CheckBox            aReduceBitmapsTransparencyCB;
76 
77     CheckBox            aConvertToGreyscalesCB;
78 
79     FixedLine           aWarnGB;
80 
81     CheckBox            aPaperSizeCB;
82     CheckBox            aPaperOrientationCB;
83     CheckBox            aTransparencyCB;
84 
85 private:
86 
87     PrinterOptions      maPrinterOptions;
88     PrinterOptions      maPrintFileOptions;
89 
90                         DECL_DLLPRIVATE_LINK( ToggleOutputPrinterRBHdl, RadioButton* pButton );
91                         DECL_DLLPRIVATE_LINK( ToggleOutputPrintFileRBHdl, RadioButton* pButton );
92 
93                         DECL_DLLPRIVATE_LINK( ClickReduceTransparencyCBHdl, CheckBox* pBox );
94                         DECL_DLLPRIVATE_LINK( ClickReduceGradientsCBHdl, CheckBox* pBox );
95                         DECL_DLLPRIVATE_LINK( ClickReduceBitmapsCBHdl, CheckBox* pBox );
96 
97                         DECL_DLLPRIVATE_LINK( ToggleReduceGradientsStripesRBHdl, RadioButton* pButton );
98                         DECL_DLLPRIVATE_LINK( ToggleReduceBitmapsResolutionRBHdl, RadioButton* pButton );
99 
100     SAL_DLLPRIVATE void ImplUpdateControls( const PrinterOptions* pCurrentOptions );
101     SAL_DLLPRIVATE void ImplSaveControls( PrinterOptions* pCurrentOptions );
102 
103     // --> OD 2008-06-25 #i63982#
104     SAL_DLLPRIVATE void ImplSetAccessibleNames();
105     // <--
106 
107 protected:
108 
109     using TabPage::DeactivatePage;
110     virtual int         DeactivatePage( SfxItemSet* pSet = NULL );
111 
112 public:
113 
114                         SfxCommonPrintOptionsTabPage( Window* pParent, const SfxItemSet& rSet );
115 	                    ~SfxCommonPrintOptionsTabPage();
116 
117 	virtual	sal_Bool 		FillItemSet( SfxItemSet& rSet );
118 	virtual	void 		Reset( const SfxItemSet& rSet );
119 	virtual Window*		GetParentLabeledBy( const Window* pLabel ) const;
120 	virtual Window*		GetParentLabelFor( const Window* pLabel ) const;
121 
122 	static SfxTabPage*	Create( Window* pParent, const SfxItemSet& rAttrSet );
123 };
124 
125 // -------------------------------
126 // - TransparencyPrintWarningBox -
127 // -------------------------------
128 
129 class TransparencyPrintWarningBox : public ModalDialog
130 {
131 private:
132 
133 	FixedImage		aWarnFI;
134 	FixedText		aWarnFT;
135 	OKButton		aYesBtn;
136 	PushButton	    aNoBtn;
137     CancelButton    aCancelBtn;
138 	CheckBox		aNoWarnCB;
139 
140                     DECL_LINK( ClickNoBtn, PushButton* );
141 
142 public:
143 
144 					TransparencyPrintWarningBox( Window* pParent );
145 					~TransparencyPrintWarningBox();
146 
IsNoWarningChecked() const147 	sal_Bool			IsNoWarningChecked() const { return aNoWarnCB.IsChecked(); }
148 };
149 
150 #endif // #ifndef _SFX_PRINTOPT_HXX
151 
152