sync master with lastest vba changes
[ooovba.git] / padmin / source / prtsetup.hxx
blob26881560531f7f3de6d468c9b4f1e403a516d16d
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: prtsetup.hxx,v $
10 * $Revision: 1.5 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _PAD_PRTSETUP_HXX_
32 #define _PAD_PRTSETUP_HXX_
34 #include <tools/link.hxx>
35 #include <vcl/tabdlg.hxx>
36 #include <vcl/tabpage.hxx>
37 #include <vcl/tabctrl.hxx>
38 #ifndef _SV_BUTTON_HXX
39 #include <vcl/button.hxx>
40 #endif
41 #include <vcl/fixed.hxx>
42 #include <vcl/lstbox.hxx>
43 #include <vcl/field.hxx>
44 #include <vcl/combobox.hxx>
45 #ifndef _PSPPRINT_PPDPARSER_HXX_
46 #include <psprint/ppdparser.hxx>
47 #endif
48 #include <psprint/printerinfomanager.hxx>
49 #include <helper.hxx>
51 namespace padmin {
53 class RTSPaperPage;
54 class RTSDevicePage;
55 class RTSOtherPage;
56 class RTSFontSubstPage;
57 class RTSCommandPage;
59 class RTSDialog : public TabDialog
61 friend class RTSPaperPage;
62 friend class RTSDevicePage;
63 friend class RTSOtherPage;
64 friend class RTSFontSubstPage;
65 friend class RTSCommandPage;
67 ::psp::PrinterInfo m_aJobData;
68 String m_aPrinter;
70 // controls
71 TabControl m_aTabControl;
72 OKButton m_aOKButton;
73 CancelButton m_aCancelButton;
75 // pages
76 RTSPaperPage* m_pPaperPage;
77 RTSDevicePage* m_pDevicePage;
78 RTSOtherPage* m_pOtherPage;
79 RTSFontSubstPage* m_pFontSubstPage;
80 RTSCommandPage* m_pCommandPage;
82 // some resources
83 String m_aInvalidString;
84 String m_aFromDriverString;
86 DECL_LINK( ActivatePage, TabControl* );
87 DECL_LINK( ClickButton, Button* );
89 // helper functions
90 void insertAllPPDValues( ListBox&, const ::psp::PPDKey* );
92 String getPaperSize();
93 public:
94 RTSDialog( const ::psp::PrinterInfo& rJobData, const String& rPrinter, bool bAllPages, Window* pParent = NULL );
95 ~RTSDialog();
97 const ::psp::PrinterInfo& getSetup() const { return m_aJobData; }
100 class RTSPaperPage : public TabPage
102 RTSDialog* m_pParent;
104 FixedText m_aPaperText;
105 ListBox m_aPaperBox;
107 FixedText m_aOrientText;
108 ListBox m_aOrientBox;
110 FixedText m_aDuplexText;
111 ListBox m_aDuplexBox;
113 FixedText m_aSlotText;
114 ListBox m_aSlotBox;
116 DECL_LINK( SelectHdl, ListBox* );
117 public:
118 RTSPaperPage( RTSDialog* );
119 ~RTSPaperPage();
121 void update();
123 String getOrientation() { return m_aOrientBox.GetSelectEntry(); }
126 class RTSDevicePage : public TabPage
128 RTSDialog* m_pParent;
130 String m_aSpaceColor;
131 String m_aSpaceGray;
133 FixedText m_aPPDKeyText;
134 ListBox m_aPPDKeyBox;
136 FixedText m_aPPDValueText;
137 ListBox m_aPPDValueBox;
139 FixedText m_aLevelText;
140 ListBox m_aLevelBox;
142 FixedText m_aSpaceText;
143 ListBox m_aSpaceBox;
145 FixedText m_aDepthText;
146 ListBox m_aDepthBox;
148 void FillValueBox( const ::psp::PPDKey* );
150 DECL_LINK( SelectHdl, ListBox* );
151 public:
152 RTSDevicePage( RTSDialog* );
153 ~RTSDevicePage();
155 void update();
157 ULONG getLevel() { return m_aLevelBox.GetSelectEntry().ToInt32(); }
158 ULONG getDepth() { return m_aDepthBox.GetSelectEntry().ToInt32(); }
159 ULONG getColorDevice()
161 String aSpace( m_aSpaceBox.GetSelectEntry() );
162 return aSpace == m_aSpaceColor ? 1 : ( aSpace == m_aSpaceGray ? -1 : 0 );
166 class RTSOtherPage : public TabPage
168 RTSDialog* m_pParent;
170 FixedText m_aLeftTxt;
171 MetricField m_aLeftLB;
172 FixedText m_aTopTxt;
173 MetricField m_aTopLB;
174 FixedText m_aRightTxt;
175 MetricField m_aRightLB;
176 FixedText m_aBottomTxt;
177 MetricField m_aBottomLB;
178 FixedText m_aCommentTxt;
179 Edit m_aCommentEdt;
180 PushButton m_aDefaultBtn;
182 void initValues();
184 DECL_LINK( ClickBtnHdl, Button *);
186 public:
187 RTSOtherPage( RTSDialog* );
188 ~RTSOtherPage();
190 void save();
193 class RTSFontSubstPage : public TabPage
195 RTSDialog* m_pParent;
197 FixedText m_aSubstitutionsText;
198 DelMultiListBox m_aSubstitutionsBox;
199 FixedText m_aFromFontText;
200 ComboBox m_aFromFontBox;
201 FixedText m_aToFontText;
202 ListBox m_aToFontBox;
204 PushButton m_aAddButton;
205 PushButton m_aRemoveButton;
206 CheckBox m_aEnableBox;
208 DECL_LINK( ClickBtnHdl, Button* );
209 DECL_LINK( SelectHdl, ListBox* );
210 DECL_LINK( DelPressedHdl, ListBox* );
212 void update();
213 public:
214 RTSFontSubstPage( RTSDialog* );
215 ~RTSFontSubstPage();
218 } // namespace
220 #endif // _PAD_PRTSETUP_HXX