update dev300-m58
[ooovba.git] / padmin / source / prtsetup.hxx
blobb7e126c3911d32194b0937eea79f277df711192b
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 "helper.hxx"
36 #include "tools/link.hxx"
38 #include "vcl/tabdlg.hxx"
39 #include "vcl/tabpage.hxx"
40 #include "vcl/tabctrl.hxx"
41 #include "vcl/button.hxx"
42 #include "vcl/fixed.hxx"
43 #include "vcl/lstbox.hxx"
44 #include "vcl/field.hxx"
45 #include "vcl/combobox.hxx"
46 #include "vcl/ppdparser.hxx"
47 #include "vcl/printerinfomanager.hxx"
49 namespace padmin {
51 class RTSPaperPage;
52 class RTSDevicePage;
53 class RTSOtherPage;
54 class RTSFontSubstPage;
55 class RTSCommandPage;
57 class RTSDialog : public TabDialog
59 friend class RTSPaperPage;
60 friend class RTSDevicePage;
61 friend class RTSOtherPage;
62 friend class RTSFontSubstPage;
63 friend class RTSCommandPage;
65 ::psp::PrinterInfo m_aJobData;
66 String m_aPrinter;
68 // controls
69 TabControl m_aTabControl;
70 OKButton m_aOKButton;
71 CancelButton m_aCancelButton;
73 // pages
74 RTSPaperPage* m_pPaperPage;
75 RTSDevicePage* m_pDevicePage;
76 RTSOtherPage* m_pOtherPage;
77 RTSFontSubstPage* m_pFontSubstPage;
78 RTSCommandPage* m_pCommandPage;
80 // some resources
81 String m_aInvalidString;
82 String m_aFromDriverString;
84 DECL_LINK( ActivatePage, TabControl* );
85 DECL_LINK( ClickButton, Button* );
87 // helper functions
88 void insertAllPPDValues( ListBox&, const ::psp::PPDKey* );
89 public:
90 RTSDialog( const ::psp::PrinterInfo& rJobData, const String& rPrinter, bool bAllPages, Window* pParent = NULL );
91 ~RTSDialog();
93 const ::psp::PrinterInfo& getSetup() const { return m_aJobData; }
96 class RTSPaperPage : public TabPage
98 RTSDialog* m_pParent;
100 FixedText m_aPaperText;
101 ListBox m_aPaperBox;
103 FixedText m_aOrientText;
104 ListBox m_aOrientBox;
106 FixedText m_aDuplexText;
107 ListBox m_aDuplexBox;
109 FixedText m_aSlotText;
110 ListBox m_aSlotBox;
112 DECL_LINK( SelectHdl, ListBox* );
113 public:
114 RTSPaperPage( RTSDialog* );
115 ~RTSPaperPage();
117 void update();
119 String getOrientation() { return m_aOrientBox.GetSelectEntry(); }
122 class RTSDevicePage : public TabPage
124 RTSDialog* m_pParent;
126 String m_aSpaceColor;
127 String m_aSpaceGray;
129 FixedText m_aPPDKeyText;
130 ListBox m_aPPDKeyBox;
132 FixedText m_aPPDValueText;
133 ListBox m_aPPDValueBox;
135 FixedText m_aLevelText;
136 ListBox m_aLevelBox;
138 FixedText m_aSpaceText;
139 ListBox m_aSpaceBox;
141 FixedText m_aDepthText;
142 ListBox m_aDepthBox;
144 void FillValueBox( const ::psp::PPDKey* );
146 DECL_LINK( SelectHdl, ListBox* );
147 public:
148 RTSDevicePage( RTSDialog* );
149 ~RTSDevicePage();
151 void update();
153 ULONG getLevel() { return m_aLevelBox.GetSelectEntry().ToInt32(); }
154 ULONG getDepth() { return m_aDepthBox.GetSelectEntry().ToInt32(); }
155 ULONG getColorDevice()
157 String aSpace( m_aSpaceBox.GetSelectEntry() );
158 return aSpace == m_aSpaceColor ? 1 : ( aSpace == m_aSpaceGray ? -1 : 0 );
162 class RTSOtherPage : public TabPage
164 RTSDialog* m_pParent;
166 FixedText m_aLeftTxt;
167 MetricField m_aLeftLB;
168 FixedText m_aTopTxt;
169 MetricField m_aTopLB;
170 FixedText m_aRightTxt;
171 MetricField m_aRightLB;
172 FixedText m_aBottomTxt;
173 MetricField m_aBottomLB;
174 FixedText m_aCommentTxt;
175 Edit m_aCommentEdt;
176 PushButton m_aDefaultBtn;
178 void initValues();
180 DECL_LINK( ClickBtnHdl, Button *);
182 public:
183 RTSOtherPage( RTSDialog* );
184 ~RTSOtherPage();
186 void save();
189 class RTSFontSubstPage : public TabPage
191 RTSDialog* m_pParent;
193 FixedText m_aSubstitutionsText;
194 DelMultiListBox m_aSubstitutionsBox;
195 FixedText m_aFromFontText;
196 ComboBox m_aFromFontBox;
197 FixedText m_aToFontText;
198 ListBox m_aToFontBox;
200 PushButton m_aAddButton;
201 PushButton m_aRemoveButton;
202 CheckBox m_aEnableBox;
204 DECL_LINK( ClickBtnHdl, Button* );
205 DECL_LINK( SelectHdl, ListBox* );
206 DECL_LINK( DelPressedHdl, ListBox* );
208 void update();
209 public:
210 RTSFontSubstPage( RTSDialog* );
211 ~RTSFontSubstPage();
214 } // namespace
216 #endif // _PAD_PRTSETUP_HXX