xref: /aoo42x/main/sfx2/source/dialog/printopt.cxx (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 
28 // MARKER(update_precomp.py): autogen include statement, do not remove
29 #include "precompiled_sfx2.hxx"
30 
31 #ifndef GCC
32 #endif
33 #include <vcl/msgbox.hxx>
34 #include <unotools/printwarningoptions.hxx>
35 #include <svtools/printoptions.hxx>
36 #include <svl/flagitem.hxx>
37 
38 
39 #include "printopt.hrc"
40 #include "dialog.hrc"
41 #include "sfx2/sfxresid.hxx"
42 #include <sfx2/viewsh.hxx>
43 #include <sfx2/printopt.hxx>
44 
45 // -----------
46 // - statics -
47 // -----------
48 
49 static sal_uInt16   aDPIArray[] = { 72, 96, 150, 200, 300, 600 };
50 static sal_Bool     bOutputForPrinter = sal_True;
51 
52 #define DPI_COUNT (sizeof(aDPIArray)/sizeof(aDPIArray[0 ]))
53 
54 // --------------------------------
55 // - SfxCommonPrintOptionsTabPage -
56 // --------------------------------
57 
58 SfxCommonPrintOptionsTabPage::SfxCommonPrintOptionsTabPage( Window* pParent, const SfxItemSet& rSet ) :
59 	SfxTabPage( pParent, SfxResId( TP_COMMONPRINTOPTIONS ), rSet ),
60 
61     aReduceGB( this, SfxResId( GB_REDUCE ) ),
62     aOutputTypeFT( this, SfxResId( FT_OUTPUTTYPE ) ),
63     aPrinterOutputRB( this, SfxResId( RB_PRINTEROUTPUT ) ),
64     aPrintFileOutputRB( this, SfxResId( RB_PRINTFILEOUTPUT ) ),
65     aOutputGB( this, SfxResId( GB_OUTPUT ) ),
66     aReduceTransparencyCB( this, SfxResId( CB_REDUCETRANSPARENCY ) ),
67     aReduceTransparencyAutoRB( this, SfxResId( RB_REDUCETRANSPARENCY_AUTO ) ),
68     aReduceTransparencyNoneRB( this, SfxResId( RB_REDUCETRANSPARENCY_NONE ) ),
69     aReduceGradientsCB( this, SfxResId( CB_REDUCEGRADIENTS ) ),
70     aReduceGradientsStripesRB( this, SfxResId( RB_REDUCEGRADIENTS_STRIPES ) ),
71     aReduceGradientsColorRB( this, SfxResId( RB_REDUCEGRADIENTS_COLOR ) ),
72     aReduceGradientsStepCountNF( this, SfxResId( NF_REDUCEGRADIENTS_STEPCOUNT ) ),
73     aReduceBitmapsCB( this, SfxResId( CB_REDUCEBITMAPS ) ),
74     aReduceBitmapsOptimalRB( this, SfxResId( RB_REDUCEBITMAPS_OPTIMAL ) ),
75     aReduceBitmapsNormalRB( this, SfxResId( RB_REDUCEBITMAPS_NORMAL ) ),
76     aReduceBitmapsResolutionRB( this, SfxResId( RB_REDUCEBITMAPS_RESOLUTION ) ),
77     aReduceBitmapsResolutionLB( this, SfxResId( LB_REDUCEBITMAPS_RESOLUTION ) ),
78     aReduceBitmapsTransparencyCB( this, SfxResId( CB_REDUCEBITMAPS_TRANSPARENCY ) ),
79     aConvertToGreyscalesCB( this, SfxResId( CB_CONVERTTOGREYSCALES ) ),
80     aWarnGB( this, SfxResId( GB_PRINT_WARN ) ),
81     aPaperSizeCB( this, SfxResId( CB_PAPERSIZE ) ),
82     aPaperOrientationCB( this, SfxResId( CB_PAPERORIENTATION ) ),
83     aTransparencyCB( this, SfxResId( CB_TRANSPARENCY ) )
84 {
85 	FreeResource();
86 
87     aOutputGB.SetStyle( aOutputGB.GetStyle() | WB_NOLABEL );
88 
89     if( bOutputForPrinter )
90     {
91         aPrinterOutputRB.Check( sal_True );
92         aOutputGB.SetText( OutputDevice::GetNonMnemonicString( aPrinterOutputRB.GetText() ) );
93     }
94     else
95     {
96         aPrintFileOutputRB.Check( sal_True );
97         aOutputGB.SetText( OutputDevice::GetNonMnemonicString( aPrintFileOutputRB.GetText() ) );
98     }
99 
100     aPrinterOutputRB.SetToggleHdl( LINK( this, SfxCommonPrintOptionsTabPage, ToggleOutputPrinterRBHdl ) );
101     aPrintFileOutputRB.SetToggleHdl( LINK( this, SfxCommonPrintOptionsTabPage, ToggleOutputPrintFileRBHdl ) );
102 
103     aReduceTransparencyCB.SetClickHdl( LINK( this, SfxCommonPrintOptionsTabPage, ClickReduceTransparencyCBHdl ) );
104     aReduceGradientsCB.SetClickHdl( LINK( this, SfxCommonPrintOptionsTabPage, ClickReduceGradientsCBHdl ) );
105     aReduceBitmapsCB.SetClickHdl( LINK( this, SfxCommonPrintOptionsTabPage, ClickReduceBitmapsCBHdl ) );
106 
107     aReduceGradientsStripesRB.SetToggleHdl( LINK( this, SfxCommonPrintOptionsTabPage, ToggleReduceGradientsStripesRBHdl ) );
108     aReduceBitmapsResolutionRB.SetToggleHdl( LINK( this, SfxCommonPrintOptionsTabPage, ToggleReduceBitmapsResolutionRBHdl ) );
109 
110     // --> PB 2008-06-09 #i89164#
111     // calculate dynamically the width of radiobutton and listbox
112     const long nOffset = 10;
113     Size aOldSize = aReduceBitmapsResolutionRB.GetSizePixel();
114     Size aNewSize = aReduceBitmapsResolutionRB.GetOptimalSize( WINDOWSIZE_PREFERRED );
115     aNewSize.Width() += nOffset;
116     aNewSize.Height() = aOldSize.Height();
117     long nDelta = aOldSize.Width() - aNewSize.Width();
118     aReduceBitmapsResolutionRB.SetSizePixel( aNewSize );
119     Point aPos = aReduceBitmapsResolutionLB.GetPosPixel();
120     aPos.X() -= nDelta;
121     aOldSize = aReduceBitmapsResolutionLB.GetSizePixel();
122     aNewSize = aReduceBitmapsResolutionLB.GetOptimalSize( WINDOWSIZE_PREFERRED );
123     aNewSize.Width() += nOffset;
124     aNewSize.Height() = aOldSize.Height();
125     aReduceBitmapsResolutionLB.SetPosSizePixel( aPos, aNewSize );
126     // <--
127 }
128 
129 // -----------------------------------------------------------------------------
130 
131 SfxCommonPrintOptionsTabPage::~SfxCommonPrintOptionsTabPage()
132 {
133 }
134 
135 // -----------------------------------------------------------------------------
136 
137 SfxTabPage*	SfxCommonPrintOptionsTabPage::Create( Window* pParent, const SfxItemSet& rAttrSet )
138 {
139 	return( new SfxCommonPrintOptionsTabPage( pParent, rAttrSet ) );
140 }
141 
142 // -----------------------------------------------------------------------------
143 
144 Window*	SfxCommonPrintOptionsTabPage::GetParentLabeledBy( const Window* pWindow ) const
145 {
146 	if ( pWindow == (Window *)&aReduceGradientsStepCountNF )
147 		return (Window *)&aReduceGradientsStripesRB;
148 	else if ( pWindow == (Window *)&aReduceBitmapsResolutionLB )
149 		return (Window *)&aReduceBitmapsResolutionRB;
150 	else
151 		return SfxTabPage::GetParentLabeledBy( pWindow );
152 }
153 
154 Window*	SfxCommonPrintOptionsTabPage::GetParentLabelFor( const Window* pWindow ) const
155 {
156 	if ( pWindow == (Window *)&aReduceGradientsStripesRB )
157 		return (Window *)&aReduceGradientsStepCountNF;
158 	else if ( pWindow == (Window *)&aReduceBitmapsResolutionRB )
159 		return (Window *)&aReduceBitmapsResolutionLB;
160 	else
161 		return SfxTabPage::GetParentLabelFor( pWindow );
162 }
163 
164 // -----------------------------------------------------------------------------
165 
166 sal_Bool SfxCommonPrintOptionsTabPage::FillItemSet( SfxItemSet& /*rSet*/ )
167 {
168     SvtPrintWarningOptions  aWarnOptions;
169     SvtPrinterOptions       aPrinterOptions;
170     SvtPrintFileOptions     aPrintFileOptions;
171 	sal_Bool                    bModified = sal_False;
172 
173 
174     if( aPaperSizeCB.IsChecked() != aPaperSizeCB.GetSavedValue())
175         aWarnOptions.SetPaperSize(aPaperSizeCB.IsChecked());
176     if( aPaperOrientationCB.IsChecked() != aPaperOrientationCB.GetSavedValue() )
177         aWarnOptions.SetPaperOrientation(aPaperOrientationCB.IsChecked());
178 
179     if( aTransparencyCB.IsChecked() != aTransparencyCB.GetSavedValue() )
180         aWarnOptions.SetTransparency( aTransparencyCB.IsChecked() );
181 
182     ImplSaveControls( aPrinterOutputRB.IsChecked() ? &maPrinterOptions : &maPrintFileOptions );
183 
184     aPrinterOptions.SetPrinterOptions( maPrinterOptions );
185     aPrintFileOptions.SetPrinterOptions( maPrintFileOptions );
186 
187     return bModified;
188 }
189 
190 // -----------------------------------------------------------------------------
191 
192 void SfxCommonPrintOptionsTabPage::Reset( const SfxItemSet& /*rSet*/ )
193 {
194     SvtPrintWarningOptions  aWarnOptions;
195     SvtPrinterOptions       aPrinterOptions;
196     SvtPrintFileOptions     aPrintFileOptions;
197 
198     aPaperSizeCB.Check( aWarnOptions.IsPaperSize() );
199     aPaperOrientationCB.Check( aWarnOptions.IsPaperOrientation() );
200 
201     aTransparencyCB.Check( aWarnOptions.IsTransparency() );
202 
203     aPaperSizeCB.SaveValue();
204 	aPaperOrientationCB.SaveValue();
205 	aTransparencyCB.SaveValue();
206 
207     aPrinterOptions.GetPrinterOptions( maPrinterOptions );
208     aPrintFileOptions.GetPrinterOptions( maPrintFileOptions );
209 
210     ImplUpdateControls( aPrinterOutputRB.IsChecked() ? &maPrinterOptions : &maPrintFileOptions );
211 
212     // --> OD 2008-06-25 #i63982#
213     ImplSetAccessibleNames();
214     // <--
215 }
216 
217 // -----------------------------------------------------------------------------
218 
219 int SfxCommonPrintOptionsTabPage::DeactivatePage( SfxItemSet* pItemSet )
220 {
221     if( pItemSet )
222 		FillItemSet( *pItemSet );
223 
224 	return LEAVE_PAGE;
225 }
226 
227 // -----------------------------------------------------------------------------
228 
229 void SfxCommonPrintOptionsTabPage::ImplUpdateControls( const PrinterOptions* pCurrentOptions )
230 {
231     aReduceTransparencyCB.Check( pCurrentOptions->IsReduceTransparency() );
232 
233     if( pCurrentOptions->GetReducedTransparencyMode() == PRINTER_TRANSPARENCY_AUTO )
234         aReduceTransparencyAutoRB.Check( sal_True );
235     else
236         aReduceTransparencyNoneRB.Check( sal_True );
237 
238     aReduceGradientsCB.Check( pCurrentOptions->IsReduceGradients() );
239 
240     if( pCurrentOptions->GetReducedGradientMode() == PRINTER_GRADIENT_STRIPES )
241         aReduceGradientsStripesRB.Check( sal_True );
242     else
243         aReduceGradientsColorRB.Check( sal_True );
244 
245     aReduceGradientsStepCountNF.SetValue( pCurrentOptions->GetReducedGradientStepCount() );
246 
247     aReduceBitmapsCB.Check( pCurrentOptions->IsReduceBitmaps() );
248 
249     if( pCurrentOptions->GetReducedBitmapMode() == PRINTER_BITMAP_OPTIMAL )
250         aReduceBitmapsOptimalRB.Check( sal_True );
251     else if( pCurrentOptions->GetReducedBitmapMode() == PRINTER_BITMAP_NORMAL )
252         aReduceBitmapsNormalRB.Check( sal_True );
253     else
254         aReduceBitmapsResolutionRB.Check( sal_True );
255 
256     const sal_uInt16 nDPI = pCurrentOptions->GetReducedBitmapResolution();
257 
258     if( nDPI < aDPIArray[ 0 ] )
259         aReduceBitmapsResolutionLB.SelectEntryPos( 0 );
260     else
261     {
262         for( long i = ( DPI_COUNT - 1 ); i >= 0; i-- )
263         {
264             if( nDPI >= aDPIArray[ i ] )
265             {
266                 aReduceBitmapsResolutionLB.SelectEntryPos( (sal_uInt16) i );
267                 i = -1;
268             }
269         }
270     }
271 
272     aReduceBitmapsResolutionLB.SetText( aReduceBitmapsResolutionLB.GetEntry( aReduceBitmapsResolutionLB.GetSelectEntryPos() ) );
273 
274     aReduceBitmapsTransparencyCB.Check( pCurrentOptions->IsReducedBitmapIncludesTransparency() );
275     aConvertToGreyscalesCB.Check( pCurrentOptions->IsConvertToGreyscales() );
276 
277     ClickReduceTransparencyCBHdl( &aReduceTransparencyCB );
278     ClickReduceGradientsCBHdl( &aReduceGradientsCB );
279     ClickReduceBitmapsCBHdl( &aReduceBitmapsCB );
280 }
281 
282 // -----------------------------------------------------------------------------
283 
284 void SfxCommonPrintOptionsTabPage::ImplSetAccessibleNames()
285 {
286     static const String cSeparator = String::CreateFromAscii( " - " );
287 
288     String sReduceText = aReduceGB.GetDisplayText();
289     sReduceText += cSeparator;
290 
291     String sAccessibleName = sReduceText;
292     sAccessibleName += aPrinterOutputRB.GetDisplayText();
293     aPrinterOutputRB.SetAccessibleName( sAccessibleName );
294 
295     sAccessibleName = sReduceText;
296     sAccessibleName += aPrintFileOutputRB.GetDisplayText();
297     aPrintFileOutputRB.SetAccessibleName( sAccessibleName );
298 
299     String sOutputText = sReduceText;
300     sOutputText += aOutputGB.GetDisplayText();
301     sOutputText += cSeparator;
302 
303     sAccessibleName = sOutputText;
304     sAccessibleName += aReduceTransparencyCB.GetDisplayText();
305     aReduceTransparencyCB.SetAccessibleName( sAccessibleName );
306 
307     String sTransparencyText = aReduceTransparencyCB.GetAccessibleName();
308     sTransparencyText += cSeparator;
309 
310     sAccessibleName = sTransparencyText;
311     sAccessibleName += aReduceTransparencyAutoRB.GetDisplayText();
312     aReduceTransparencyAutoRB.SetAccessibleName( sAccessibleName );
313 
314     sAccessibleName = sTransparencyText;
315     sAccessibleName += aReduceTransparencyNoneRB.GetDisplayText();
316     aReduceTransparencyNoneRB.SetAccessibleName( sAccessibleName );
317 
318     sAccessibleName = sOutputText;
319     sAccessibleName += aReduceGradientsCB.GetDisplayText();
320     aReduceGradientsCB.SetAccessibleName( sAccessibleName );
321 
322     String sGradientText = aReduceGradientsCB.GetAccessibleName();
323     sGradientText += cSeparator;
324 
325     sAccessibleName = sGradientText;
326     sAccessibleName += aReduceGradientsStripesRB.GetDisplayText();
327     aReduceGradientsStripesRB.SetAccessibleName( sAccessibleName );
328 
329     sAccessibleName = aReduceGradientsStripesRB.GetAccessibleName();
330     aReduceGradientsStepCountNF.SetAccessibleName( sAccessibleName );
331 
332     sAccessibleName = sGradientText;
333     sAccessibleName += aReduceGradientsColorRB.GetDisplayText();
334     aReduceGradientsColorRB.SetAccessibleName( sAccessibleName );
335 
336     sAccessibleName = sOutputText;
337     sAccessibleName += aReduceBitmapsCB.GetDisplayText();
338     aReduceBitmapsCB.SetAccessibleName( sAccessibleName );
339 
340     String sBitmapText = aReduceBitmapsCB.GetAccessibleName();
341     sBitmapText += cSeparator;
342 
343     sAccessibleName = sBitmapText;
344     sAccessibleName += aReduceBitmapsOptimalRB.GetDisplayText();
345     aReduceBitmapsOptimalRB.SetAccessibleName( sAccessibleName );
346 
347     sAccessibleName = sBitmapText;
348     sAccessibleName += aReduceBitmapsNormalRB.GetDisplayText();
349     aReduceBitmapsNormalRB.SetAccessibleName( sAccessibleName );
350 
351     sAccessibleName = sBitmapText;
352     sAccessibleName += aReduceBitmapsResolutionRB.GetDisplayText();
353     aReduceBitmapsResolutionRB.SetAccessibleName( sAccessibleName );
354 
355     sAccessibleName = aReduceBitmapsResolutionRB.GetAccessibleName();
356     aReduceBitmapsResolutionLB.SetAccessibleName( sAccessibleName );
357 
358     sAccessibleName = sBitmapText;
359     sAccessibleName += aReduceBitmapsTransparencyCB.GetDisplayText();
360     aReduceBitmapsTransparencyCB.SetAccessibleName( sAccessibleName );
361 
362     sAccessibleName = sOutputText;
363     sAccessibleName += aConvertToGreyscalesCB.GetDisplayText();
364     aConvertToGreyscalesCB.SetAccessibleName( sAccessibleName );
365 
366     String sWarnText = aWarnGB.GetDisplayText();
367     sWarnText += cSeparator;
368 
369     sAccessibleName = sWarnText;
370     sAccessibleName += aPaperSizeCB.GetDisplayText();
371     aPaperSizeCB.SetAccessibleName( sAccessibleName );
372 
373     sAccessibleName = sWarnText;
374     sAccessibleName += aPaperOrientationCB.GetDisplayText();
375     aPaperOrientationCB.SetAccessibleName( sAccessibleName );
376 
377     sAccessibleName = sWarnText;
378     sAccessibleName += aTransparencyCB.GetDisplayText();
379     aTransparencyCB.SetAccessibleName( sAccessibleName );
380 }
381 
382 // -----------------------------------------------------------------------------
383 
384 void SfxCommonPrintOptionsTabPage::ImplSaveControls( PrinterOptions* pCurrentOptions )
385 {
386     pCurrentOptions->SetReduceTransparency( aReduceTransparencyCB.IsChecked() );
387     pCurrentOptions->SetReducedTransparencyMode( aReduceTransparencyAutoRB.IsChecked() ? PRINTER_TRANSPARENCY_AUTO : PRINTER_TRANSPARENCY_NONE );
388     pCurrentOptions->SetReduceGradients( aReduceGradientsCB.IsChecked() );
389     pCurrentOptions->SetReducedGradientMode( aReduceGradientsStripesRB.IsChecked() ? PRINTER_GRADIENT_STRIPES : PRINTER_GRADIENT_COLOR  );
390     pCurrentOptions->SetReducedGradientStepCount( (sal_uInt16) aReduceGradientsStepCountNF.GetValue() );
391     pCurrentOptions->SetReduceBitmaps( aReduceBitmapsCB.IsChecked() );
392     pCurrentOptions->SetReducedBitmapMode( aReduceBitmapsOptimalRB.IsChecked() ? PRINTER_BITMAP_OPTIMAL :
393                                            ( aReduceBitmapsNormalRB.IsChecked() ? PRINTER_BITMAP_NORMAL : PRINTER_BITMAP_RESOLUTION ) );
394     pCurrentOptions->SetReducedBitmapResolution( aDPIArray[ Min( (sal_uInt16) aReduceBitmapsResolutionLB.GetSelectEntryPos(),
395                                                             (sal_uInt16)( sizeof( aDPIArray ) / sizeof( aDPIArray[ 0 ] ) - 1 ) ) ] );
396     pCurrentOptions->SetReducedBitmapIncludesTransparency( aReduceBitmapsTransparencyCB.IsChecked() );
397     pCurrentOptions->SetConvertToGreyscales( aConvertToGreyscalesCB.IsChecked() );
398 }
399 
400 // -----------------------------------------------------------------------------
401 
402 IMPL_LINK( SfxCommonPrintOptionsTabPage, ClickReduceTransparencyCBHdl, CheckBox*, pBox )
403 {
404     (void)pBox; //unused
405     const sal_Bool bReduceTransparency = aReduceTransparencyCB.IsChecked();
406 
407     aReduceTransparencyAutoRB.Enable( bReduceTransparency );
408     aReduceTransparencyNoneRB.Enable( bReduceTransparency );
409 
410     aTransparencyCB.Enable( !bReduceTransparency );
411 
412     return 0;
413 }
414 
415 // -----------------------------------------------------------------------------
416 
417 IMPL_LINK( SfxCommonPrintOptionsTabPage, ClickReduceGradientsCBHdl, CheckBox*, pBox )
418 {
419     (void)pBox; //unused
420     const sal_Bool bEnable = aReduceGradientsCB.IsChecked();
421 
422     aReduceGradientsStripesRB.Enable( bEnable );
423     aReduceGradientsColorRB.Enable( bEnable );
424     aReduceGradientsStepCountNF.Enable( bEnable );
425 
426     ToggleReduceGradientsStripesRBHdl( &aReduceGradientsStripesRB );
427 
428     return 0;
429 }
430 
431 // -----------------------------------------------------------------------------
432 
433 IMPL_LINK( SfxCommonPrintOptionsTabPage, ClickReduceBitmapsCBHdl, CheckBox*, pBox )
434 {
435     (void)pBox; //unused
436     const sal_Bool bEnable = aReduceBitmapsCB.IsChecked();
437 
438     aReduceBitmapsOptimalRB.Enable( bEnable );
439     aReduceBitmapsNormalRB.Enable( bEnable );
440     aReduceBitmapsResolutionRB.Enable( bEnable );
441     aReduceBitmapsTransparencyCB.Enable( bEnable );
442     aReduceBitmapsResolutionLB.Enable( bEnable );
443 
444     ToggleReduceBitmapsResolutionRBHdl( &aReduceBitmapsResolutionRB );
445 
446     return 0;
447 }
448 
449 // -----------------------------------------------------------------------------
450 
451 IMPL_LINK( SfxCommonPrintOptionsTabPage, ToggleReduceGradientsStripesRBHdl, RadioButton*, pButton )
452 {
453     (void)pButton; //unused
454     const sal_Bool bEnable = aReduceGradientsCB.IsChecked() && aReduceGradientsStripesRB.IsChecked();
455 
456     aReduceGradientsStepCountNF.Enable( bEnable );
457 
458     return 0;
459 }
460 
461 // -----------------------------------------------------------------------------
462 
463 IMPL_LINK( SfxCommonPrintOptionsTabPage, ToggleReduceBitmapsResolutionRBHdl, RadioButton*, pButton )
464 {
465     (void)pButton; //unused
466     const sal_Bool bEnable = aReduceBitmapsCB.IsChecked() && aReduceBitmapsResolutionRB.IsChecked();
467 
468     aReduceBitmapsResolutionLB.Enable( bEnable );
469 
470     return 0;
471 }
472 
473 // -----------------------------------------------------------------------------
474 
475 IMPL_LINK( SfxCommonPrintOptionsTabPage, ToggleOutputPrinterRBHdl, RadioButton*, pButton )
476 {
477     if( pButton->IsChecked() )
478     {
479         aOutputGB.SetText( OutputDevice::GetNonMnemonicString( pButton->GetText() ) );
480         ImplUpdateControls( &maPrinterOptions );
481         bOutputForPrinter = sal_True;
482         // --> OD 2008-06-25 #i63982#
483         ImplSetAccessibleNames();
484         // <--
485     }
486     else
487         ImplSaveControls( &maPrinterOptions );
488 
489     return 0;
490 }
491 
492 // -----------------------------------------------------------------------------
493 
494 IMPL_LINK( SfxCommonPrintOptionsTabPage, ToggleOutputPrintFileRBHdl, RadioButton*, pButton )
495 {
496     if( pButton->IsChecked() )
497     {
498         aOutputGB.SetText( OutputDevice::GetNonMnemonicString( pButton->GetText() ) );
499         ImplUpdateControls( &maPrintFileOptions );
500         bOutputForPrinter = sal_False;
501         // --> OD 2008-06-25 #i63982#
502         ImplSetAccessibleNames();
503         // <--
504     }
505     else
506         ImplSaveControls( &maPrintFileOptions );
507 
508     return 0;
509 }
510 
511 // -------------------------------
512 // - TransparencyPrintWarningBox -
513 // -------------------------------
514 
515 TransparencyPrintWarningBox::TransparencyPrintWarningBox( Window* pParent ) :
516 	ModalDialog( pParent, SfxResId( RID_WARN_PRINTTRANSPARENCY ) ),
517 	aWarnFI		( this, SfxResId( FI_PRINTTRANSWARN ) ),
518 	aWarnFT		( this, SfxResId( FT_PRINTTRANSWARN ) ),
519 	aYesBtn		( this, SfxResId( BTN_PRINTTRANS_YES ) ),
520 	aNoBtn		( this, SfxResId( BTN_PRINTTRANS_NO ) ),
521 	aCancelBtn	( this, SfxResId( BTN_PRINTTRANS_CANCEL ) ),
522 	aNoWarnCB	( this, SfxResId( CBX_NOPRINTTRANSWARN ) )
523 {
524 	FreeResource();
525 
526 	aWarnFT.SetStyle( aWarnFT.GetStyle() | WB_INFO );
527 	aWarnFI.SetImage( WarningBox::GetStandardImage() );
528 
529     aNoBtn.SetClickHdl( LINK( this, TransparencyPrintWarningBox, ClickNoBtn ) );
530 }
531 
532 // -----------------------------------------------------------------------------
533 
534 TransparencyPrintWarningBox::~TransparencyPrintWarningBox()
535 {
536 }
537 
538 // -----------------------------------------------------------------------------
539 
540 IMPL_LINK( TransparencyPrintWarningBox, ClickNoBtn, PushButton*, pButton )
541 {
542     (void)pButton; //unused
543     EndDialog( RET_NO );
544     return 0;
545 }
546