1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
11  *   Licensed to the Apache Software Foundation (ASF) under one or more
12  *   contributor license agreements. See the NOTICE file distributed
13  *   with this work for additional information regarding copyright
14  *   ownership. The ASF licenses this file to you under the Apache
15  *   License, Version 2.0 (the "License"); you may not use this file
16  *   except in compliance with the License. You may obtain a copy of
17  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
18  */
19 
20 #ifndef INCLUDED_SFX2_PRINTOPT_HXX
21 #define INCLUDED_SFX2_PRINTOPT_HXX
22 
23 #include <sal/config.h>
24 #include <sfx2/dllapi.h>
25 #include <sfx2/tabdlg.hxx>
26 #include <sal/types.h>
27 #include <vcl/print.hxx>
28 
29 
30 class SFX2_DLLPUBLIC SfxCommonPrintOptionsTabPage final : public SfxTabPage
31 {
32 private:
33 
34     std::unique_ptr<weld::RadioButton> m_xPrinterOutputRB;
35     std::unique_ptr<weld::RadioButton> m_xPrintFileOutputRB;
36     std::unique_ptr<weld::CheckButton> m_xReduceTransparencyCB;
37     std::unique_ptr<weld::RadioButton> m_xReduceTransparencyAutoRB;
38     std::unique_ptr<weld::RadioButton> m_xReduceTransparencyNoneRB;
39     std::unique_ptr<weld::CheckButton> m_xReduceGradientsCB;
40     std::unique_ptr<weld::RadioButton> m_xReduceGradientsStripesRB;
41     std::unique_ptr<weld::RadioButton> m_xReduceGradientsColorRB;
42     std::unique_ptr<weld::SpinButton> m_xReduceGradientsStepCountNF;
43     std::unique_ptr<weld::CheckButton> m_xReduceBitmapsCB;
44     std::unique_ptr<weld::RadioButton> m_xReduceBitmapsOptimalRB;
45     std::unique_ptr<weld::RadioButton> m_xReduceBitmapsNormalRB;
46     std::unique_ptr<weld::RadioButton> m_xReduceBitmapsResolutionRB;
47     std::unique_ptr<weld::ComboBox> m_xReduceBitmapsResolutionLB;
48     std::unique_ptr<weld::CheckButton> m_xReduceBitmapsTransparencyCB;
49     std::unique_ptr<weld::CheckButton> m_xConvertToGreyscalesCB;
50     std::unique_ptr<weld::CheckButton> m_xPDFCB;
51     std::unique_ptr<weld::CheckButton> m_xPaperSizeCB;
52     std::unique_ptr<weld::CheckButton> m_xPaperOrientationCB;
53     std::unique_ptr<weld::CheckButton> m_xTransparencyCB;
54 
55 private:
56 
57     PrinterOptions      maPrinterOptions;
58     PrinterOptions      maPrintFileOptions;
59 
60                         DECL_DLLPRIVATE_LINK( ToggleOutputPrinterRBHdl, weld::ToggleButton&, void );
61                         DECL_DLLPRIVATE_LINK( ToggleOutputPrintFileRBHdl, weld::ToggleButton&, void);
62 
63                         DECL_DLLPRIVATE_LINK( ClickReduceTransparencyCBHdl, weld::Button&, void );
64                         DECL_DLLPRIVATE_LINK( ClickReduceGradientsCBHdl, weld::Button&, void );
65                         DECL_DLLPRIVATE_LINK( ClickReduceBitmapsCBHdl, weld::Button&, void );
66 
67                         DECL_DLLPRIVATE_LINK( ToggleReduceGradientsStripesRBHdl, weld::ToggleButton&, void );
68                         DECL_DLLPRIVATE_LINK( ToggleReduceBitmapsResolutionRBHdl, weld::ToggleButton&, void );
69 
70     SAL_DLLPRIVATE void ImplUpdateControls( const PrinterOptions* pCurrentOptions );
71     SAL_DLLPRIVATE void ImplSaveControls( PrinterOptions* pCurrentOptions );
72 
73     virtual DeactivateRC DeactivatePage( SfxItemSet* pSet ) override;
74 
75 public:
76 
77     SfxCommonPrintOptionsTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rSet);
78     virtual             ~SfxCommonPrintOptionsTabPage() override;
79     virtual bool        FillItemSet( SfxItemSet* rSet ) override;
80     virtual void        Reset( const SfxItemSet* rSet ) override;
81 
82     static std::unique_ptr<SfxTabPage> Create(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet*);
83 };
84 
85 #endif // INCLUDED_SFX2_PRINTOPT_HXX
86 
87 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
88