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_
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"
54 class RTSFontSubstPage
;
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
;
69 TabControl m_aTabControl
;
71 CancelButton m_aCancelButton
;
74 RTSPaperPage
* m_pPaperPage
;
75 RTSDevicePage
* m_pDevicePage
;
76 RTSOtherPage
* m_pOtherPage
;
77 RTSFontSubstPage
* m_pFontSubstPage
;
78 RTSCommandPage
* m_pCommandPage
;
81 String m_aInvalidString
;
82 String m_aFromDriverString
;
84 DECL_LINK( ActivatePage
, TabControl
* );
85 DECL_LINK( ClickButton
, Button
* );
88 void insertAllPPDValues( ListBox
&, const ::psp::PPDKey
* );
90 RTSDialog( const ::psp::PrinterInfo
& rJobData
, const String
& rPrinter
, bool bAllPages
, Window
* pParent
= NULL
);
93 const ::psp::PrinterInfo
& getSetup() const { return m_aJobData
; }
96 class RTSPaperPage
: public TabPage
100 FixedText m_aPaperText
;
103 FixedText m_aOrientText
;
104 ListBox m_aOrientBox
;
106 FixedText m_aDuplexText
;
107 ListBox m_aDuplexBox
;
109 FixedText m_aSlotText
;
112 DECL_LINK( SelectHdl
, ListBox
* );
114 RTSPaperPage( RTSDialog
* );
119 String
getOrientation() { return m_aOrientBox
.GetSelectEntry(); }
122 class RTSDevicePage
: public TabPage
124 RTSDialog
* m_pParent
;
126 String m_aSpaceColor
;
129 FixedText m_aPPDKeyText
;
130 ListBox m_aPPDKeyBox
;
132 FixedText m_aPPDValueText
;
133 ListBox m_aPPDValueBox
;
135 FixedText m_aLevelText
;
138 FixedText m_aSpaceText
;
141 FixedText m_aDepthText
;
144 void FillValueBox( const ::psp::PPDKey
* );
146 DECL_LINK( SelectHdl
, ListBox
* );
148 RTSDevicePage( RTSDialog
* );
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
;
169 MetricField m_aTopLB
;
170 FixedText m_aRightTxt
;
171 MetricField m_aRightLB
;
172 FixedText m_aBottomTxt
;
173 MetricField m_aBottomLB
;
174 FixedText m_aCommentTxt
;
176 PushButton m_aDefaultBtn
;
180 DECL_LINK( ClickBtnHdl
, Button
*);
183 RTSOtherPage( RTSDialog
* );
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
* );
210 RTSFontSubstPage( RTSDialog
* );
216 #endif // _PAD_PRTSETUP_HXX