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_SVTOOLS_PRNSETUP_HXX
21 : #define INCLUDED_SVTOOLS_PRNSETUP_HXX
22 :
23 : #include <svtools/svtdllapi.h>
24 :
25 : #include <vcl/dialog.hxx>
26 : #include <vcl/fixed.hxx>
27 : #include <vcl/button.hxx>
28 : #include <vcl/group.hxx>
29 : #include <vcl/lstbox.hxx>
30 : #include <vcl/timer.hxx>
31 : #include <svtools/stdctrl.hxx>
32 :
33 : class Printer;
34 : class QueueInfo;
35 :
36 :
37 : // - PrinterSetupDialog -
38 :
39 :
40 : class SVT_DLLPUBLIC PrinterSetupDialog : public ModalDialog
41 : {
42 : private:
43 : ListBox* m_pLbName;
44 : PushButton* m_pBtnProperties;
45 : PushButton* m_pBtnOptions;
46 : FixedText* m_pFiStatus;
47 : FixedText* m_pFiType;
48 : FixedText* m_pFiLocation;
49 : FixedText* m_pFiComment;
50 : AutoTimer maStatusTimer;
51 : Printer* mpPrinter;
52 : Printer* mpTempPrinter;
53 :
54 : SVT_DLLPRIVATE void ImplSetInfo();
55 :
56 : DECL_DLLPRIVATE_LINK( ImplPropertiesHdl, void* );
57 : DECL_DLLPRIVATE_LINK( ImplOptionsHdl, void* );
58 : DECL_DLLPRIVATE_LINK( ImplChangePrinterHdl, void* );
59 : DECL_DLLPRIVATE_LINK( ImplStatusHdl, void* );
60 :
61 : public:
62 : PrinterSetupDialog( vcl::Window* pWindow );
63 : virtual ~PrinterSetupDialog();
64 :
65 0 : void SetPrinter( Printer* pNewPrinter ) { mpPrinter = pNewPrinter; }
66 0 : Printer* GetPrinter() const { return mpPrinter; }
67 :
68 : virtual void DataChanged( const DataChangedEvent& rDCEvt ) SAL_OVERRIDE;
69 : virtual bool Notify( NotifyEvent& rNEvt ) SAL_OVERRIDE;
70 :
71 : virtual short Execute() SAL_OVERRIDE;
72 :
73 : void SetOptionsHdl( const Link& rLink );
74 : };
75 :
76 :
77 : // - Helper functions for print dialog -
78 :
79 :
80 : #define IMPL_PRINTDLG_STATUS_UPDATE 15000
81 :
82 : void ImplFillPrnDlgListBox( const Printer* pPrinter,
83 : ListBox* pBox, PushButton* pPropBtn );
84 : void ImplFreePrnDlgListBox( ListBox* pBox, bool bClear = true );
85 : Printer* ImplPrnDlgListBoxSelect( ListBox* pBox, PushButton* pPropBtn,
86 : Printer* pPrinter, Printer* pTempPrinter );
87 : Printer* ImplPrnDlgUpdatePrinter( Printer* pPrinter, Printer* pTempPrinter );
88 : void ImplPrnDlgUpdateQueueInfo( ListBox* pBox, QueueInfo& rInfo );
89 : OUString ImplPrnDlgGetStatusText( const QueueInfo& rInfo );
90 :
91 : #endif // INCLUDED_SVTOOLS_PRNSETUP_HXX
92 :
93 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|