Coverage Report

Created: 2025-07-07 10:01

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