1 | /* $Id: QIDialogContainer.h 104358 2024-04-18 05:33:40Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * VBox Qt GUI - Qt extensions: QIDialogContainer class declaration.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2019-2023 Oracle and/or its affiliates.
|
---|
8 | *
|
---|
9 | * This file is part of VirtualBox base platform packages, as
|
---|
10 | * available from https://www.virtualbox.org.
|
---|
11 | *
|
---|
12 | * This program is free software; you can redistribute it and/or
|
---|
13 | * modify it under the terms of the GNU General Public License
|
---|
14 | * as published by the Free Software Foundation, in version 3 of the
|
---|
15 | * License.
|
---|
16 | *
|
---|
17 | * This program is distributed in the hope that it will be useful, but
|
---|
18 | * WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
---|
20 | * General Public License for more details.
|
---|
21 | *
|
---|
22 | * You should have received a copy of the GNU General Public License
|
---|
23 | * along with this program; if not, see <https://www.gnu.org/licenses>.
|
---|
24 | *
|
---|
25 | * SPDX-License-Identifier: GPL-3.0-only
|
---|
26 | */
|
---|
27 |
|
---|
28 | #ifndef FEQT_INCLUDED_SRC_extensions_QIDialogContainer_h
|
---|
29 | #define FEQT_INCLUDED_SRC_extensions_QIDialogContainer_h
|
---|
30 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
31 | # pragma once
|
---|
32 | #endif
|
---|
33 |
|
---|
34 | /* Qt includes: */
|
---|
35 | #include <QDialog>
|
---|
36 |
|
---|
37 | /* GUI includes: */
|
---|
38 | #include "UILibraryDefs.h"
|
---|
39 |
|
---|
40 | /* Forward declarations: */
|
---|
41 | class QGridLayout;
|
---|
42 | class QLabel;
|
---|
43 | class QProgressBar;
|
---|
44 | class QWidget;
|
---|
45 | class QIDialogButtonBox;
|
---|
46 |
|
---|
47 | /** QDialog sub-class used as executable input container for passed widget.
|
---|
48 | * Should be used as popup or modal dialog wrapping functionality of the passed widget. */
|
---|
49 | class SHARED_LIBRARY_STUFF QIDialogContainer : public QDialog
|
---|
50 | {
|
---|
51 | Q_OBJECT;
|
---|
52 |
|
---|
53 | public:
|
---|
54 |
|
---|
55 | /** Constructs QIDialogContainer passing @a pParent & @a enmFlags to the base-class. */
|
---|
56 | QIDialogContainer(QWidget *pParent = 0, Qt::WindowFlags enmFlags = Qt::WindowFlags());
|
---|
57 |
|
---|
58 | /** Defines containing @a pWidget. */
|
---|
59 | void setWidget(QWidget *pWidget);
|
---|
60 |
|
---|
61 | public slots:
|
---|
62 |
|
---|
63 | /** Activates window. */
|
---|
64 | void sltActivateWindow() { activateWindow(); }
|
---|
65 |
|
---|
66 | /** Sets progress-bar to be @a fHidden. */
|
---|
67 | void setProgressBarHidden(bool fHidden);
|
---|
68 |
|
---|
69 | /** Sets Ok button to be @a fEnabled. */
|
---|
70 | void setOkButtonEnabled(bool fEnabled);
|
---|
71 |
|
---|
72 | private slots:
|
---|
73 |
|
---|
74 | /** Handles translation event. */
|
---|
75 | void sltRetranslateUI();
|
---|
76 |
|
---|
77 | private:
|
---|
78 |
|
---|
79 | /** Prepares all. */
|
---|
80 | void prepare();
|
---|
81 |
|
---|
82 | /** Holds the layout instance. */
|
---|
83 | QGridLayout *m_pLayout;
|
---|
84 | /** Holds the widget reference. */
|
---|
85 | QWidget *m_pWidget;
|
---|
86 | /** Holds the progress-bar instance. */
|
---|
87 | QLabel *m_pProgressLabel;
|
---|
88 | /** Holds the progress-bar instance. */
|
---|
89 | QProgressBar *m_pProgressBar;
|
---|
90 | /** Holds the button-box instance. */
|
---|
91 | QIDialogButtonBox *m_pButtonBox;
|
---|
92 | };
|
---|
93 |
|
---|
94 | #endif /* !FEQT_INCLUDED_SRC_extensions_QIDialogContainer_h */
|
---|