Branch libreoffice-5-0-4
[LibreOffice.git] / vcl / generic / print / prtsetup.hxx
blob1be4927c6f9995c2acec1d83163c8e1af4606fc4
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef INCLUDED_VCL_GENERIC_PRINT_PRTSETUP_HXX
21 #define INCLUDED_VCL_GENERIC_PRINT_PRTSETUP_HXX
23 #include "tools/link.hxx"
25 #include "vcl/tabdlg.hxx"
26 #include "vcl/tabpage.hxx"
27 #include "vcl/tabctrl.hxx"
28 #include "vcl/button.hxx"
29 #include "vcl/edit.hxx"
30 #include "vcl/fixed.hxx"
31 #include "vcl/lstbox.hxx"
32 #include "vcl/field.hxx"
33 #include "vcl/combobox.hxx"
34 #include "vcl/ppdparser.hxx"
35 #include "vcl/printerinfomanager.hxx"
37 class RTSPaperPage;
38 class RTSDevicePage;
40 class RTSDialog : public TabDialog
42 friend class RTSPaperPage;
43 friend class RTSDevicePage;
45 ::psp::PrinterInfo m_aJobData;
47 // controls
48 VclPtr<TabControl> m_pTabControl;
49 VclPtr<OKButton> m_pOKButton;
50 VclPtr<CancelButton> m_pCancelButton;
52 // pages
53 VclPtr<RTSPaperPage> m_pPaperPage;
54 VclPtr<RTSDevicePage> m_pDevicePage;
56 // some resources
57 OUString m_aInvalidString;
59 bool mbDataModified;
61 DECL_LINK( ActivatePage, TabControl* );
62 DECL_LINK( ClickButton, Button* );
64 // helper functions
65 void insertAllPPDValues( ListBox&, const psp::PPDParser*, const psp::PPDKey* );
66 public:
67 RTSDialog(const ::psp::PrinterInfo& rJobData, vcl::Window* pParent = NULL);
68 virtual ~RTSDialog();
69 virtual void dispose() SAL_OVERRIDE;
71 const ::psp::PrinterInfo& getSetup() const { return m_aJobData; }
73 void SetDataModified( bool bModified ) { mbDataModified = bModified; }
74 bool GetDataModified() const { return mbDataModified; }
77 class RTSPaperPage : public TabPage
79 VclPtr<RTSDialog> m_pParent;
81 VclPtr<FixedText> m_pPaperText;
82 VclPtr<ListBox> m_pPaperBox;
84 VclPtr<ListBox> m_pOrientBox;
86 VclPtr<FixedText> m_pDuplexText;
87 VclPtr<ListBox> m_pDuplexBox;
89 VclPtr<FixedText> m_pSlotText;
90 VclPtr<ListBox> m_pSlotBox;
92 DECL_LINK( SelectHdl, ListBox* );
93 public:
94 RTSPaperPage( RTSDialog* );
95 virtual ~RTSPaperPage();
96 virtual void dispose() SAL_OVERRIDE;
98 void update();
100 sal_Int32 getOrientation() const { return m_pOrientBox->GetSelectEntryPos(); }
103 class RTSDevicePage : public TabPage
105 VclPtr<RTSDialog> m_pParent;
107 VclPtr<ListBox> m_pPPDKeyBox;
108 VclPtr<ListBox> m_pPPDValueBox;
109 const psp::PPDValue* m_pCustomValue;
110 VclPtr<Edit> m_pCustomEdit;
112 VclPtr<ListBox> m_pLevelBox;
113 VclPtr<ListBox> m_pSpaceBox;
114 VclPtr<ListBox> m_pDepthBox;
116 void FillValueBox( const ::psp::PPDKey* );
118 DECL_LINK( SelectHdl, ListBox* );
119 DECL_LINK( ModifyHdl, Edit* );
120 public:
121 RTSDevicePage( RTSDialog* );
122 virtual ~RTSDevicePage();
123 virtual void dispose() SAL_OVERRIDE;
125 sal_uLong getLevel();
126 sal_uLong getPDFDevice();
127 sal_uLong getDepth();
128 sal_uLong getColorDevice();
131 int SetupPrinterDriver(::psp::PrinterInfo& rJobData);
133 #endif // _PAD_PRTSETUP_HXX
135 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */