1*23e9c6caSAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*23e9c6caSAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*23e9c6caSAndrew Rist * or more contributor license agreements. See the NOTICE file 5*23e9c6caSAndrew Rist * distributed with this work for additional information 6*23e9c6caSAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*23e9c6caSAndrew Rist * to you under the Apache License, Version 2.0 (the 8*23e9c6caSAndrew Rist * "License"); you may not use this file except in compliance 9*23e9c6caSAndrew Rist * with the License. You may obtain a copy of the License at 10*23e9c6caSAndrew Rist * 11*23e9c6caSAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12*23e9c6caSAndrew Rist * 13*23e9c6caSAndrew Rist * Unless required by applicable law or agreed to in writing, 14*23e9c6caSAndrew Rist * software distributed under the License is distributed on an 15*23e9c6caSAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*23e9c6caSAndrew Rist * KIND, either express or implied. See the License for the 17*23e9c6caSAndrew Rist * specific language governing permissions and limitations 18*23e9c6caSAndrew Rist * under the License. 19*23e9c6caSAndrew Rist * 20*23e9c6caSAndrew Rist *************************************************************/ 21*23e9c6caSAndrew Rist 22*23e9c6caSAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir #ifndef _PAD_PRTSETUP_HXX_ 25cdf0e10cSrcweir #define _PAD_PRTSETUP_HXX_ 26cdf0e10cSrcweir 27cdf0e10cSrcweir #include "helper.hxx" 28cdf0e10cSrcweir 29cdf0e10cSrcweir #include "tools/link.hxx" 30cdf0e10cSrcweir 31cdf0e10cSrcweir #include "vcl/tabdlg.hxx" 32cdf0e10cSrcweir #include "vcl/tabpage.hxx" 33cdf0e10cSrcweir #include "vcl/tabctrl.hxx" 34cdf0e10cSrcweir #include "vcl/button.hxx" 35cdf0e10cSrcweir #include "vcl/fixed.hxx" 36cdf0e10cSrcweir #include "vcl/lstbox.hxx" 37cdf0e10cSrcweir #include "vcl/field.hxx" 38cdf0e10cSrcweir #include "vcl/combobox.hxx" 39cdf0e10cSrcweir #include "vcl/ppdparser.hxx" 40cdf0e10cSrcweir #include "vcl/printerinfomanager.hxx" 41cdf0e10cSrcweir 42cdf0e10cSrcweir namespace padmin { 43cdf0e10cSrcweir 44cdf0e10cSrcweir class RTSPaperPage; 45cdf0e10cSrcweir class RTSDevicePage; 46cdf0e10cSrcweir class RTSOtherPage; 47cdf0e10cSrcweir class RTSFontSubstPage; 48cdf0e10cSrcweir class RTSCommandPage; 49cdf0e10cSrcweir 50cdf0e10cSrcweir class RTSDialog : public TabDialog 51cdf0e10cSrcweir { 52cdf0e10cSrcweir friend class RTSPaperPage; 53cdf0e10cSrcweir friend class RTSDevicePage; 54cdf0e10cSrcweir friend class RTSOtherPage; 55cdf0e10cSrcweir friend class RTSFontSubstPage; 56cdf0e10cSrcweir friend class RTSCommandPage; 57cdf0e10cSrcweir 58cdf0e10cSrcweir ::psp::PrinterInfo m_aJobData; 59cdf0e10cSrcweir String m_aPrinter; 60cdf0e10cSrcweir 61cdf0e10cSrcweir // controls 62cdf0e10cSrcweir TabControl m_aTabControl; 63cdf0e10cSrcweir OKButton m_aOKButton; 64cdf0e10cSrcweir CancelButton m_aCancelButton; 65cdf0e10cSrcweir 66cdf0e10cSrcweir // pages 67cdf0e10cSrcweir RTSPaperPage* m_pPaperPage; 68cdf0e10cSrcweir RTSDevicePage* m_pDevicePage; 69cdf0e10cSrcweir RTSOtherPage* m_pOtherPage; 70cdf0e10cSrcweir RTSFontSubstPage* m_pFontSubstPage; 71cdf0e10cSrcweir RTSCommandPage* m_pCommandPage; 72cdf0e10cSrcweir 73cdf0e10cSrcweir // some resources 74cdf0e10cSrcweir String m_aInvalidString; 75cdf0e10cSrcweir String m_aFromDriverString; 76cdf0e10cSrcweir 77cdf0e10cSrcweir DECL_LINK( ActivatePage, TabControl* ); 78cdf0e10cSrcweir DECL_LINK( ClickButton, Button* ); 79cdf0e10cSrcweir 80cdf0e10cSrcweir // helper functions 81cdf0e10cSrcweir void insertAllPPDValues( ListBox&, const psp::PPDParser*, const psp::PPDKey* ); 82cdf0e10cSrcweir public: 83cdf0e10cSrcweir RTSDialog( const ::psp::PrinterInfo& rJobData, const String& rPrinter, bool bAllPages, Window* pParent = NULL ); 84cdf0e10cSrcweir ~RTSDialog(); 85cdf0e10cSrcweir getSetup() const86cdf0e10cSrcweir const ::psp::PrinterInfo& getSetup() const { return m_aJobData; } 87cdf0e10cSrcweir }; 88cdf0e10cSrcweir 89cdf0e10cSrcweir class RTSPaperPage : public TabPage 90cdf0e10cSrcweir { 91cdf0e10cSrcweir RTSDialog* m_pParent; 92cdf0e10cSrcweir 93cdf0e10cSrcweir FixedText m_aPaperText; 94cdf0e10cSrcweir ListBox m_aPaperBox; 95cdf0e10cSrcweir 96cdf0e10cSrcweir FixedText m_aOrientText; 97cdf0e10cSrcweir ListBox m_aOrientBox; 98cdf0e10cSrcweir 99cdf0e10cSrcweir FixedText m_aDuplexText; 100cdf0e10cSrcweir ListBox m_aDuplexBox; 101cdf0e10cSrcweir 102cdf0e10cSrcweir FixedText m_aSlotText; 103cdf0e10cSrcweir ListBox m_aSlotBox; 104cdf0e10cSrcweir 105cdf0e10cSrcweir DECL_LINK( SelectHdl, ListBox* ); 106cdf0e10cSrcweir public: 107cdf0e10cSrcweir RTSPaperPage( RTSDialog* ); 108cdf0e10cSrcweir ~RTSPaperPage(); 109cdf0e10cSrcweir 110cdf0e10cSrcweir void update(); 111cdf0e10cSrcweir getOrientation()112cdf0e10cSrcweir String getOrientation() { return m_aOrientBox.GetSelectEntry(); } 113cdf0e10cSrcweir }; 114cdf0e10cSrcweir 115cdf0e10cSrcweir class RTSDevicePage : public TabPage 116cdf0e10cSrcweir { 117cdf0e10cSrcweir RTSDialog* m_pParent; 118cdf0e10cSrcweir 119cdf0e10cSrcweir String m_aSpaceColor; 120cdf0e10cSrcweir String m_aSpaceGray; 121cdf0e10cSrcweir 122cdf0e10cSrcweir FixedText m_aPPDKeyText; 123cdf0e10cSrcweir ListBox m_aPPDKeyBox; 124cdf0e10cSrcweir 125cdf0e10cSrcweir FixedText m_aPPDValueText; 126cdf0e10cSrcweir ListBox m_aPPDValueBox; 127cdf0e10cSrcweir 128cdf0e10cSrcweir FixedText m_aLevelText; 129cdf0e10cSrcweir ListBox m_aLevelBox; 130cdf0e10cSrcweir 131cdf0e10cSrcweir FixedText m_aSpaceText; 132cdf0e10cSrcweir ListBox m_aSpaceBox; 133cdf0e10cSrcweir 134cdf0e10cSrcweir FixedText m_aDepthText; 135cdf0e10cSrcweir ListBox m_aDepthBox; 136cdf0e10cSrcweir 137cdf0e10cSrcweir void FillValueBox( const ::psp::PPDKey* ); 138cdf0e10cSrcweir 139cdf0e10cSrcweir DECL_LINK( SelectHdl, ListBox* ); 140cdf0e10cSrcweir public: 141cdf0e10cSrcweir RTSDevicePage( RTSDialog* ); 142cdf0e10cSrcweir ~RTSDevicePage(); 143cdf0e10cSrcweir 144cdf0e10cSrcweir void update(); 145cdf0e10cSrcweir 146cdf0e10cSrcweir sal_uLong getLevel(); 147cdf0e10cSrcweir sal_uLong getPDFDevice(); getDepth()148cdf0e10cSrcweir sal_uLong getDepth() { return m_aDepthBox.GetSelectEntry().ToInt32(); } getColorDevice()149cdf0e10cSrcweir sal_uLong getColorDevice() 150cdf0e10cSrcweir { 151cdf0e10cSrcweir String aSpace( m_aSpaceBox.GetSelectEntry() ); 152cdf0e10cSrcweir return aSpace == m_aSpaceColor ? 1 : ( aSpace == m_aSpaceGray ? -1 : 0 ); 153cdf0e10cSrcweir } 154cdf0e10cSrcweir }; 155cdf0e10cSrcweir 156cdf0e10cSrcweir class RTSOtherPage : public TabPage 157cdf0e10cSrcweir { 158cdf0e10cSrcweir RTSDialog* m_pParent; 159cdf0e10cSrcweir 160cdf0e10cSrcweir FixedText m_aLeftTxt; 161cdf0e10cSrcweir MetricField m_aLeftLB; 162cdf0e10cSrcweir FixedText m_aTopTxt; 163cdf0e10cSrcweir MetricField m_aTopLB; 164cdf0e10cSrcweir FixedText m_aRightTxt; 165cdf0e10cSrcweir MetricField m_aRightLB; 166cdf0e10cSrcweir FixedText m_aBottomTxt; 167cdf0e10cSrcweir MetricField m_aBottomLB; 168cdf0e10cSrcweir FixedText m_aCommentTxt; 169cdf0e10cSrcweir Edit m_aCommentEdt; 170cdf0e10cSrcweir PushButton m_aDefaultBtn; 171cdf0e10cSrcweir 172cdf0e10cSrcweir void initValues(); 173cdf0e10cSrcweir 174cdf0e10cSrcweir DECL_LINK( ClickBtnHdl, Button *); 175cdf0e10cSrcweir 176cdf0e10cSrcweir public: 177cdf0e10cSrcweir RTSOtherPage( RTSDialog* ); 178cdf0e10cSrcweir ~RTSOtherPage(); 179cdf0e10cSrcweir 180cdf0e10cSrcweir void save(); 181cdf0e10cSrcweir }; 182cdf0e10cSrcweir 183cdf0e10cSrcweir class RTSFontSubstPage : public TabPage 184cdf0e10cSrcweir { 185cdf0e10cSrcweir RTSDialog* m_pParent; 186cdf0e10cSrcweir 187cdf0e10cSrcweir FixedText m_aSubstitutionsText; 188cdf0e10cSrcweir DelMultiListBox m_aSubstitutionsBox; 189cdf0e10cSrcweir FixedText m_aFromFontText; 190cdf0e10cSrcweir ComboBox m_aFromFontBox; 191cdf0e10cSrcweir FixedText m_aToFontText; 192cdf0e10cSrcweir ListBox m_aToFontBox; 193cdf0e10cSrcweir 194cdf0e10cSrcweir PushButton m_aAddButton; 195cdf0e10cSrcweir PushButton m_aRemoveButton; 196cdf0e10cSrcweir CheckBox m_aEnableBox; 197cdf0e10cSrcweir 198cdf0e10cSrcweir DECL_LINK( ClickBtnHdl, Button* ); 199cdf0e10cSrcweir DECL_LINK( SelectHdl, ListBox* ); 200cdf0e10cSrcweir DECL_LINK( DelPressedHdl, ListBox* ); 201cdf0e10cSrcweir 202cdf0e10cSrcweir void update(); 203cdf0e10cSrcweir public: 204cdf0e10cSrcweir RTSFontSubstPage( RTSDialog* ); 205cdf0e10cSrcweir ~RTSFontSubstPage(); 206cdf0e10cSrcweir }; 207cdf0e10cSrcweir 208cdf0e10cSrcweir } // namespace 209cdf0e10cSrcweir 210cdf0e10cSrcweir #endif // _PAD_PRTSETUP_HXX 211