22#include <officecfg/Office/Common.hxx>
30static sal_uInt16
aDPIArray[] = { 72, 96, 150, 200, 300, 600 };
33#define DPI_COUNT SAL_N_ELEMENTS(aDPIArray)
36 :
SfxTabPage(pPage, pController,
"sfx/ui/optprintpage.ui",
"OptPrintPage", &
rSet)
37 , m_xPrinterOutputRB(m_xBuilder->weld_radio_button(
"printer"))
38 , m_xPrintFileOutputRB(m_xBuilder->weld_radio_button(
"file"))
39 , m_xReduceTransparencyCB(m_xBuilder->weld_check_button(
"reducetrans"))
40 , m_xReduceTransparencyAutoRB(m_xBuilder->weld_radio_button(
"reducetransauto"))
41 , m_xReduceTransparencyNoneRB(m_xBuilder->weld_radio_button(
"reducetransnone"))
42 , m_xReduceGradientsCB(m_xBuilder->weld_check_button(
"reducegrad"))
43 , m_xReduceGradientsStripesRB(m_xBuilder->weld_radio_button(
"reducegradstripes"))
44 , m_xReduceGradientsColorRB(m_xBuilder->weld_radio_button(
"reducegradcolor"))
45 , m_xReduceGradientsStepCountNF(m_xBuilder->weld_spin_button(
"reducegradstep"))
46 , m_xReduceBitmapsCB(m_xBuilder->weld_check_button(
"reducebitmap"))
47 , m_xReduceBitmapsOptimalRB(m_xBuilder->weld_radio_button(
"reducebitmapoptimal"))
48 , m_xReduceBitmapsNormalRB(m_xBuilder->weld_radio_button(
"reducebitmapnormal"))
49 , m_xReduceBitmapsResolutionRB(m_xBuilder->weld_radio_button(
"reducebitmapresol"))
50 , m_xReduceBitmapsResolutionLB(m_xBuilder->weld_combo_box(
"reducebitmapdpi"))
51 , m_xReduceBitmapsTransparencyCB(m_xBuilder->weld_check_button(
"reducebitmaptrans"))
52 , m_xConvertToGreyscalesCB(m_xBuilder->weld_check_button(
"converttogray"))
53 , m_xPaperSizeCB(m_xBuilder->weld_check_button(
"papersize"))
54 , m_xPaperOrientationCB(m_xBuilder->weld_check_button(
"paperorient"))
55 , m_xTransparencyCB(m_xBuilder->weld_check_button(
"trans"))
79 return std::make_unique<SfxCommonPrintOptionsTabPage>(pPage, pController, *rAttrSet);
87 officecfg::Office::Common::Print::Warning::PaperSize::set(
m_xPaperSizeCB->get_active(), batch);
89 officecfg::Office::Common::Print::Warning::PaperOrientation::set(
m_xPaperOrientationCB->get_active(), batch);
91 officecfg::Office::Common::Print::Warning::Transparency::set(
m_xTransparencyCB->get_active(), batch);
105 m_xPaperSizeCB->set_active(officecfg::Office::Common::Print::Warning::PaperSize::get());
106 m_xPaperOrientationCB->set_active(officecfg::Office::Common::Print::Warning::PaperOrientation::get());
107 m_xTransparencyCB->set_active(officecfg::Office::Common::Print::Warning::Transparency::get());
157 const sal_uInt16 nDPI = pCurrentOptions->GetReducedBitmapResolution();
199 const bool bReduceTransparency = m_xReduceTransparencyCB->get_active();
201 m_xReduceTransparencyAutoRB->set_sensitive( bReduceTransparency );
202 m_xReduceTransparencyNoneRB->set_sensitive( bReduceTransparency );
204 m_xTransparencyCB->set_sensitive( !bReduceTransparency );
209 const bool bEnable = m_xReduceGradientsCB->get_active();
211 m_xReduceGradientsStripesRB->set_sensitive( bEnable );
212 m_xReduceGradientsColorRB->set_sensitive( bEnable );
213 m_xReduceGradientsStepCountNF->set_sensitive( bEnable );
215 ToggleReduceGradientsStripesRBHdl(*m_xReduceGradientsStripesRB);
220 const bool bEnable = m_xReduceBitmapsCB->get_active();
222 m_xReduceBitmapsOptimalRB->set_sensitive( bEnable );
223 m_xReduceBitmapsNormalRB->set_sensitive( bEnable );
224 m_xReduceBitmapsResolutionRB->set_sensitive( bEnable );
225 m_xReduceBitmapsTransparencyCB->set_sensitive( bEnable );
226 m_xReduceBitmapsResolutionLB->set_sensitive( bEnable );
228 ToggleReduceBitmapsResolutionRBHdl(*m_xReduceBitmapsResolutionRB);
233 const bool bEnable = m_xReduceGradientsCB->get_active() && m_xReduceGradientsStripesRB->get_active();
235 m_xReduceGradientsStepCountNF->set_sensitive(bEnable);
240 const bool bEnable = m_xReduceBitmapsCB->get_active() && m_xReduceBitmapsResolutionRB->get_active();
242 m_xReduceBitmapsResolutionLB->set_sensitive(bEnable);
247 if (rButton.get_active())
249 ImplUpdateControls( &maPrinterOptions );
253 ImplSaveControls( &maPrinterOptions );
258 if (rButton.get_active())
260 ImplUpdateControls( &maPrintFileOptions );
265 ImplSaveControls( &maPrintFileOptions );
std::unique_ptr< weld::CheckButton > m_xConvertToGreyscalesCB
std::unique_ptr< weld::ComboBox > m_xReduceBitmapsResolutionLB
virtual bool FillItemSet(SfxItemSet *rSet) override
std::unique_ptr< weld::RadioButton > m_xReduceTransparencyAutoRB
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
std::unique_ptr< weld::CheckButton > m_xReduceTransparencyCB
std::unique_ptr< weld::RadioButton > m_xReduceBitmapsResolutionRB
SAL_DLLPRIVATE void ImplUpdateControls(const vcl::printer::Options *pCurrentOptions)
std::unique_ptr< weld::RadioButton > m_xPrintFileOutputRB
vcl::printer::Options maPrintFileOptions
std::unique_ptr< weld::RadioButton > m_xReduceGradientsStripesRB
std::unique_ptr< weld::RadioButton > m_xReduceTransparencyNoneRB
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *)
SAL_DLLPRIVATE void ImplSaveControls(vcl::printer::Options *pCurrentOptions)
std::unique_ptr< weld::CheckButton > m_xReduceBitmapsCB
virtual ~SfxCommonPrintOptionsTabPage() override
std::unique_ptr< weld::RadioButton > m_xReduceBitmapsNormalRB
std::unique_ptr< weld::CheckButton > m_xPaperSizeCB
virtual void Reset(const SfxItemSet *rSet) override
vcl::printer::Options maPrinterOptions
std::unique_ptr< weld::SpinButton > m_xReduceGradientsStepCountNF
std::unique_ptr< weld::CheckButton > m_xReduceBitmapsTransparencyCB
std::unique_ptr< weld::RadioButton > m_xReduceGradientsColorRB
std::unique_ptr< weld::CheckButton > m_xReduceGradientsCB
SfxCommonPrintOptionsTabPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rSet)
std::unique_ptr< weld::RadioButton > m_xReduceBitmapsOptimalRB
std::unique_ptr< weld::CheckButton > m_xPaperOrientationCB
std::unique_ptr< weld::CheckButton > m_xTransparencyCB
std::unique_ptr< weld::RadioButton > m_xPrinterOutputRB
static std::shared_ptr< ConfigurationChanges > create()
#define LINK(Instance, Class, Member)
#define SAL_N_ELEMENTS(arr)
static bool bOutputForPrinter
IMPL_LINK_NOARG(SfxCommonPrintOptionsTabPage, ClickReduceTransparencyCBHdl, weld::Toggleable &, void)
static sal_uInt16 aDPIArray[]
IMPL_LINK(SfxCommonPrintOptionsTabPage, ToggleOutputPrinterRBHdl, weld::Toggleable &, rButton, void)