Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
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/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
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 .
18 : */
19 :
20 : #ifndef INCLUDED_VCL_GENERIC_PRINT_PRTSETUP_HXX
21 : #define INCLUDED_VCL_GENERIC_PRINT_PRTSETUP_HXX
22 :
23 : #include "tools/link.hxx"
24 :
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"
36 :
37 : class RTSPaperPage;
38 : class RTSDevicePage;
39 :
40 : class RTSDialog : public TabDialog
41 : {
42 : friend class RTSPaperPage;
43 : friend class RTSDevicePage;
44 :
45 : ::psp::PrinterInfo m_aJobData;
46 :
47 : // controls
48 : VclPtr<TabControl> m_pTabControl;
49 : VclPtr<OKButton> m_pOKButton;
50 : VclPtr<CancelButton> m_pCancelButton;
51 :
52 : // pages
53 : VclPtr<RTSPaperPage> m_pPaperPage;
54 : VclPtr<RTSDevicePage> m_pDevicePage;
55 :
56 : // some resources
57 : OUString m_aInvalidString;
58 :
59 : DECL_LINK( ActivatePage, TabControl* );
60 : DECL_LINK( ClickButton, Button* );
61 :
62 : // helper functions
63 : void insertAllPPDValues( ListBox&, const psp::PPDParser*, const psp::PPDKey* );
64 : public:
65 : RTSDialog(const ::psp::PrinterInfo& rJobData, vcl::Window* pParent = NULL);
66 : virtual ~RTSDialog();
67 : virtual void dispose() SAL_OVERRIDE;
68 :
69 0 : const ::psp::PrinterInfo& getSetup() const { return m_aJobData; }
70 : };
71 :
72 : class RTSPaperPage : public TabPage
73 : {
74 : VclPtr<RTSDialog> m_pParent;
75 :
76 : VclPtr<FixedText> m_pPaperText;
77 : VclPtr<ListBox> m_pPaperBox;
78 :
79 : VclPtr<ListBox> m_pOrientBox;
80 :
81 : VclPtr<FixedText> m_pDuplexText;
82 : VclPtr<ListBox> m_pDuplexBox;
83 :
84 : VclPtr<FixedText> m_pSlotText;
85 : VclPtr<ListBox> m_pSlotBox;
86 :
87 : DECL_LINK( SelectHdl, ListBox* );
88 : public:
89 : explicit RTSPaperPage( RTSDialog* );
90 : virtual ~RTSPaperPage();
91 : virtual void dispose() SAL_OVERRIDE;
92 :
93 : void update();
94 :
95 0 : sal_Int32 getOrientation() const { return m_pOrientBox->GetSelectEntryPos(); }
96 : };
97 :
98 : class RTSDevicePage : public TabPage
99 : {
100 : VclPtr<RTSDialog> m_pParent;
101 :
102 : VclPtr<ListBox> m_pPPDKeyBox;
103 : VclPtr<ListBox> m_pPPDValueBox;
104 : const psp::PPDValue* m_pCustomValue;
105 : VclPtr<Edit> m_pCustomEdit;
106 :
107 : VclPtr<ListBox> m_pLevelBox;
108 : VclPtr<ListBox> m_pSpaceBox;
109 : VclPtr<ListBox> m_pDepthBox;
110 :
111 : void FillValueBox( const ::psp::PPDKey* );
112 :
113 : DECL_LINK( SelectHdl, ListBox* );
114 : DECL_LINK( ModifyHdl, Edit* );
115 : public:
116 : explicit RTSDevicePage( RTSDialog* );
117 : virtual ~RTSDevicePage();
118 : virtual void dispose() SAL_OVERRIDE;
119 :
120 : sal_uLong getLevel();
121 : sal_uLong getPDFDevice();
122 : sal_uLong getDepth();
123 : sal_uLong getColorDevice();
124 : };
125 :
126 : int SetupPrinterDriver(::psp::PrinterInfo& rJobData);
127 :
128 : #endif // _PAD_PRTSETUP_HXX
129 :
130 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|