1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #ifndef INCLUDED_VCL_GENERIC_PRINT_PRTSETUP_HXX
21 #define INCLUDED_VCL_GENERIC_PRINT_PRTSETUP_HXX
23 #include <vcl/idle.hxx>
24 #include <vcl/ppdparser.hxx>
25 #include <vcl/weld.hxx>
26 #include <printerinfomanager.hxx>
31 class RTSDialog
: public weld::GenericDialogController
33 friend class RTSPaperPage
;
34 friend class RTSDevicePage
;
36 ::psp::PrinterInfo m_aJobData
;
41 std::unique_ptr
<weld::Notebook
> m_xTabControl
;
42 std::unique_ptr
<weld::Button
> m_xOKButton
;
43 std::unique_ptr
<weld::Button
> m_xCancelButton
;
46 std::unique_ptr
<RTSPaperPage
> m_xPaperPage
;
47 std::unique_ptr
<RTSDevicePage
> m_xDevicePage
;
49 DECL_LINK(ActivatePage
, const OString
&, void );
50 DECL_LINK(ClickButton
, weld::Button
&, void );
53 void insertAllPPDValues(weld::ComboBox
&, const psp::PPDParser
*, const psp::PPDKey
*);
55 RTSDialog(const ::psp::PrinterInfo
& rJobData
, weld::Window
* pParent
);
56 virtual ~RTSDialog() override
;
58 const ::psp::PrinterInfo
& getSetup() const { return m_aJobData
; }
60 void SetDataModified( bool bModified
) { m_bDataModified
= bModified
; }
61 bool GetDataModified() const { return m_bDataModified
; }
67 std::unique_ptr
<weld::Builder
> m_xBuilder
;
71 std::unique_ptr
<weld::Widget
> m_xContainer
;
73 std::unique_ptr
<weld::CheckButton
> m_xCbFromSetup
;
75 std::unique_ptr
<weld::Label
> m_xPaperText
;
76 std::unique_ptr
<weld::ComboBox
> m_xPaperBox
;
78 std::unique_ptr
<weld::Label
> m_xOrientText
;
79 std::unique_ptr
<weld::ComboBox
> m_xOrientBox
;
81 std::unique_ptr
<weld::Label
> m_xDuplexText
;
82 std::unique_ptr
<weld::ComboBox
> m_xDuplexBox
;
84 std::unique_ptr
<weld::Label
> m_xSlotText
;
85 std::unique_ptr
<weld::ComboBox
> m_xSlotBox
;
87 DECL_LINK(SelectHdl
, weld::ComboBox
&, void);
88 DECL_LINK(CheckBoxHdl
, weld::ToggleButton
&, void);
90 RTSPaperPage(weld::Widget
* pPage
, RTSDialog
* pDialog
);
95 sal_Int32
getOrientation() const { return m_xOrientBox
->get_active(); }
101 std::unique_ptr
<weld::Builder
> m_xBuilder
;
103 const psp::PPDValue
* m_pCustomValue
;
104 RTSDialog
* m_pParent
;
106 std::unique_ptr
<weld::Widget
> m_xContainer
;
107 std::unique_ptr
<weld::TreeView
> m_xPPDKeyBox
;
108 std::unique_ptr
<weld::TreeView
> m_xPPDValueBox
;
109 std::unique_ptr
<weld::Entry
> m_xCustomEdit
;
111 std::unique_ptr
<weld::ComboBox
> m_xLevelBox
;
112 std::unique_ptr
<weld::ComboBox
> m_xSpaceBox
;
113 std::unique_ptr
<weld::ComboBox
> m_xDepthBox
;
115 void FillValueBox( const ::psp::PPDKey
* );
116 void ValueBoxChanged( const ::psp::PPDKey
* );
118 Idle m_aReselectCustomIdle
;
120 DECL_LINK(SelectHdl
, weld::TreeView
&, void);
121 DECL_LINK(ModifyHdl
, weld::Entry
&, void);
122 DECL_LINK(ImplHandleReselectHdl
, Timer
*, void);
124 RTSDevicePage(weld::Widget
* pPage
, RTSDialog
* pDialog
);
127 sal_uLong
getLevel() const;
128 sal_uLong
getPDFDevice() const;
129 sal_uLong
getDepth() const;
130 sal_uLong
getColorDevice() const;
133 int SetupPrinterDriver(weld::Window
* pParent
, ::psp::PrinterInfo
& rJobData
);
135 #endif // _PAD_PRTSETUP_HXX
137 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */