Version 7.6.3.2-android, tag libreoffice-7.6.3.2-android
[LibreOffice.git] / include / svtools / prnsetup.hxx
blob2ec0cfbfef6d27e4ed00e35a49394a38373f6a48
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 #pragma once
22 #include <svtools/svtdllapi.h>
23 #include <vcl/print.hxx>
24 #include <vcl/weld.hxx>
25 #include <vcl/timer.hxx>
27 class Printer;
28 class QueueInfo;
29 class VclSimpleEvent;
31 class SVT_DLLPUBLIC PrinterSetupDialog final : public weld::GenericDialogController
33 private:
34 std::unique_ptr<weld::ComboBox> m_xLbName;
35 std::unique_ptr<weld::Button> m_xBtnProperties;
36 std::unique_ptr<weld::Button> m_xBtnOptions;
37 std::unique_ptr<weld::Label> m_xFiStatus;
38 std::unique_ptr<weld::Label> m_xFiType;
39 std::unique_ptr<weld::Label> m_xFiLocation;
40 std::unique_ptr<weld::Label> m_xFiComment;
41 AutoTimer maStatusTimer;
42 VclPtr<Printer> mpPrinter;
43 VclPtr<Printer> mpTempPrinter;
45 SVT_DLLPRIVATE void ImplSetInfo();
47 DECL_DLLPRIVATE_LINK( ImplPropertiesHdl, weld::Button&, void );
48 DECL_DLLPRIVATE_LINK( ImplChangePrinterHdl, weld::ComboBox&, void );
49 DECL_DLLPRIVATE_LINK( ImplGetFocusHdl, weld::Widget&, void );
50 DECL_DLLPRIVATE_LINK( ImplStatusHdl, Timer*, void );
51 DECL_DLLPRIVATE_LINK( ImplDataChangedHdl, VclSimpleEvent&, void);
53 public:
54 PrinterSetupDialog(weld::Window* pWindow);
55 virtual ~PrinterSetupDialog() override;
57 void SetPrinter( Printer* pNewPrinter ) { mpPrinter = pNewPrinter; }
58 Printer* GetPrinter() const { return mpPrinter; }
60 virtual short run() override;
62 weld::Window* GetFrameWeld() const { return m_xDialog.get(); }
64 void SetOptionsHdl( const Link<weld::Button&,void>& rLink );
68 #define IMPL_PRINTDLG_STATUS_UPDATE 15000
70 void ImplFillPrnDlgListBox( const Printer* pPrinter,
71 weld::ComboBox* pBox, weld::Button* pPropBtn );
72 void ImplFreePrnDlgListBox( weld::ComboBox* pBox, bool bClear = true );
73 Printer* ImplPrnDlgListBoxSelect( weld::ComboBox const * pBox, weld::Button* pPropBtn,
74 Printer const * pPrinter, Printer* pTempPrinter );
75 Printer* ImplPrnDlgUpdatePrinter( Printer const * pPrinter, Printer* pTempPrinter );
76 void ImplPrnDlgUpdateQueueInfo( weld::ComboBox const * pBox, QueueInfo& rInfo );
77 OUString ImplPrnDlgGetStatusText( const QueueInfo& rInfo );
79 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */