1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: prtsetup.hxx,v $
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>
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>
48 #include <psprint/printerinfomanager.hxx>
56 class RTSFontSubstPage
;
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
;
71 TabControl m_aTabControl
;
73 CancelButton m_aCancelButton
;
76 RTSPaperPage
* m_pPaperPage
;
77 RTSDevicePage
* m_pDevicePage
;
78 RTSOtherPage
* m_pOtherPage
;
79 RTSFontSubstPage
* m_pFontSubstPage
;
80 RTSCommandPage
* m_pCommandPage
;
83 String m_aInvalidString
;
84 String m_aFromDriverString
;
86 DECL_LINK( ActivatePage
, TabControl
* );
87 DECL_LINK( ClickButton
, Button
* );
90 void insertAllPPDValues( ListBox
&, const ::psp::PPDKey
* );
92 String
getPaperSize();
94 RTSDialog( const ::psp::PrinterInfo
& rJobData
, const String
& rPrinter
, bool bAllPages
, Window
* pParent
= NULL
);
97 const ::psp::PrinterInfo
& getSetup() const { return m_aJobData
; }
100 class RTSPaperPage
: public TabPage
102 RTSDialog
* m_pParent
;
104 FixedText m_aPaperText
;
107 FixedText m_aOrientText
;
108 ListBox m_aOrientBox
;
110 FixedText m_aDuplexText
;
111 ListBox m_aDuplexBox
;
113 FixedText m_aSlotText
;
116 DECL_LINK( SelectHdl
, ListBox
* );
118 RTSPaperPage( RTSDialog
* );
123 String
getOrientation() { return m_aOrientBox
.GetSelectEntry(); }
126 class RTSDevicePage
: public TabPage
128 RTSDialog
* m_pParent
;
130 String m_aSpaceColor
;
133 FixedText m_aPPDKeyText
;
134 ListBox m_aPPDKeyBox
;
136 FixedText m_aPPDValueText
;
137 ListBox m_aPPDValueBox
;
139 FixedText m_aLevelText
;
142 FixedText m_aSpaceText
;
145 FixedText m_aDepthText
;
148 void FillValueBox( const ::psp::PPDKey
* );
150 DECL_LINK( SelectHdl
, ListBox
* );
152 RTSDevicePage( RTSDialog
* );
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
;
173 MetricField m_aTopLB
;
174 FixedText m_aRightTxt
;
175 MetricField m_aRightLB
;
176 FixedText m_aBottomTxt
;
177 MetricField m_aBottomLB
;
178 FixedText m_aCommentTxt
;
180 PushButton m_aDefaultBtn
;
184 DECL_LINK( ClickBtnHdl
, Button
*);
187 RTSOtherPage( RTSDialog
* );
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
* );
214 RTSFontSubstPage( RTSDialog
* );
220 #endif // _PAD_PRTSETUP_HXX