Line data Source code
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 _PAD_PRTSETUP_HXX_
21 : #define _PAD_PRTSETUP_HXX_
22 :
23 : #include "helper.hxx"
24 :
25 : #include "tools/link.hxx"
26 :
27 : #include "vcl/tabdlg.hxx"
28 : #include "vcl/tabpage.hxx"
29 : #include "vcl/tabctrl.hxx"
30 : #include "vcl/button.hxx"
31 : #include "vcl/fixed.hxx"
32 : #include "vcl/lstbox.hxx"
33 : #include "vcl/field.hxx"
34 : #include "vcl/combobox.hxx"
35 : #include "vcl/ppdparser.hxx"
36 : #include "vcl/printerinfomanager.hxx"
37 :
38 : namespace padmin {
39 :
40 : class RTSPaperPage;
41 : class RTSDevicePage;
42 : class RTSOtherPage;
43 : class RTSFontSubstPage;
44 : class RTSCommandPage;
45 :
46 : class RTSDialog : public TabDialog
47 : {
48 : friend class RTSPaperPage;
49 : friend class RTSDevicePage;
50 : friend class RTSOtherPage;
51 : friend class RTSFontSubstPage;
52 : friend class RTSCommandPage;
53 :
54 : ::psp::PrinterInfo m_aJobData;
55 : String m_aPrinter;
56 :
57 : // controls
58 : TabControl m_aTabControl;
59 : OKButton m_aOKButton;
60 : CancelButton m_aCancelButton;
61 :
62 : // pages
63 : RTSPaperPage* m_pPaperPage;
64 : RTSDevicePage* m_pDevicePage;
65 : RTSOtherPage* m_pOtherPage;
66 : RTSFontSubstPage* m_pFontSubstPage;
67 : RTSCommandPage* m_pCommandPage;
68 :
69 : // some resources
70 : String m_aInvalidString;
71 :
72 : DECL_LINK( ActivatePage, TabControl* );
73 : DECL_LINK( ClickButton, Button* );
74 :
75 : // helper functions
76 : void insertAllPPDValues( ListBox&, const psp::PPDParser*, const psp::PPDKey* );
77 : public:
78 : RTSDialog( const ::psp::PrinterInfo& rJobData, const String& rPrinter, bool bAllPages, Window* pParent = NULL );
79 : ~RTSDialog();
80 :
81 0 : const ::psp::PrinterInfo& getSetup() const { return m_aJobData; }
82 : };
83 :
84 : class RTSPaperPage : public TabPage
85 : {
86 : RTSDialog* m_pParent;
87 :
88 : FixedText m_aPaperText;
89 : ListBox m_aPaperBox;
90 :
91 : FixedText m_aOrientText;
92 : ListBox m_aOrientBox;
93 :
94 : FixedText m_aDuplexText;
95 : ListBox m_aDuplexBox;
96 :
97 : FixedText m_aSlotText;
98 : ListBox m_aSlotBox;
99 :
100 : DECL_LINK( SelectHdl, ListBox* );
101 : public:
102 : RTSPaperPage( RTSDialog* );
103 : ~RTSPaperPage();
104 :
105 : void update();
106 :
107 0 : String getOrientation() { return m_aOrientBox.GetSelectEntry(); }
108 : };
109 :
110 : class RTSDevicePage : public TabPage
111 : {
112 : RTSDialog* m_pParent;
113 :
114 : String m_aSpaceColor;
115 : String m_aSpaceGray;
116 :
117 : ListBox* m_pPPDKeyBox;
118 : ListBox* m_pPPDValueBox;
119 :
120 : ListBox* m_pLevelBox;
121 : ListBox* m_pSpaceBox;
122 : ListBox* m_pDepthBox;
123 :
124 : void FillValueBox( const ::psp::PPDKey* );
125 :
126 : DECL_LINK( SelectHdl, ListBox* );
127 : public:
128 : RTSDevicePage( RTSDialog* );
129 : ~RTSDevicePage();
130 :
131 : void update();
132 :
133 : sal_uLong getLevel();
134 : sal_uLong getPDFDevice();
135 : sal_uLong getDepth();
136 : sal_uLong getColorDevice();
137 : };
138 :
139 : class RTSOtherPage : public TabPage
140 : {
141 : RTSDialog* m_pParent;
142 :
143 : FixedText m_aLeftTxt;
144 : MetricField m_aLeftLB;
145 : FixedText m_aTopTxt;
146 : MetricField m_aTopLB;
147 : FixedText m_aRightTxt;
148 : MetricField m_aRightLB;
149 : FixedText m_aBottomTxt;
150 : MetricField m_aBottomLB;
151 : FixedText m_aCommentTxt;
152 : Edit m_aCommentEdt;
153 : PushButton m_aDefaultBtn;
154 :
155 : void initValues();
156 :
157 : DECL_LINK( ClickBtnHdl, Button *);
158 :
159 : public:
160 : RTSOtherPage( RTSDialog* );
161 : ~RTSOtherPage();
162 :
163 : void save();
164 : };
165 :
166 : class RTSFontSubstPage : public TabPage
167 : {
168 : RTSDialog* m_pParent;
169 :
170 : FixedText m_aSubstitutionsText;
171 : DelMultiListBox m_aSubstitutionsBox;
172 : FixedText m_aFromFontText;
173 : ComboBox m_aFromFontBox;
174 : FixedText m_aToFontText;
175 : ListBox m_aToFontBox;
176 :
177 : PushButton m_aAddButton;
178 : PushButton m_aRemoveButton;
179 : CheckBox m_aEnableBox;
180 :
181 : DECL_LINK( ClickBtnHdl, Button* );
182 : DECL_LINK( SelectHdl, ListBox* );
183 : DECL_LINK( DelPressedHdl, ListBox* );
184 :
185 : void update();
186 : public:
187 : RTSFontSubstPage( RTSDialog* );
188 : ~RTSFontSubstPage();
189 : };
190 :
191 : } // namespace
192 :
193 : #endif // _PAD_PRTSETUP_HXX
194 :
195 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|