1 | /* $Id: UITakeSnapshotDialog.h 98779 2023-02-28 11:48:37Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * VBox Qt GUI - UITakeSnapshotDialog class declaration.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2006-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_UITakeSnapshotDialog_h
|
---|
29 | #define FEQT_INCLUDED_SRC_UITakeSnapshotDialog_h
|
---|
30 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
31 | # pragma once
|
---|
32 | #endif
|
---|
33 |
|
---|
34 | /* Qt includes: */
|
---|
35 | #include <QIcon>
|
---|
36 |
|
---|
37 | /* GUI includes: */
|
---|
38 | #include "QIDialog.h"
|
---|
39 | #include "QIWithRetranslateUI.h"
|
---|
40 | #include "UILibraryDefs.h"
|
---|
41 |
|
---|
42 | /* Forward declarations: */
|
---|
43 | class QLabel;
|
---|
44 | class QLineEdit;
|
---|
45 | class QTextEdit;
|
---|
46 | class QIDialogButtonBox;
|
---|
47 | class QILabel;
|
---|
48 |
|
---|
49 | /** QIDialog subclass for taking snapshot name/description. */
|
---|
50 | class SHARED_LIBRARY_STUFF UITakeSnapshotDialog : public QIWithRetranslateUI<QIDialog>
|
---|
51 | {
|
---|
52 | Q_OBJECT;
|
---|
53 |
|
---|
54 | public:
|
---|
55 |
|
---|
56 | /** Constructs take snapshot dialog passing @ pParent to the base-class.
|
---|
57 | * @param cImmutableMedia Brings the amount of immutable mediums. */
|
---|
58 | UITakeSnapshotDialog(QWidget *pParent, ulong cImmutableMedia);
|
---|
59 |
|
---|
60 | /** Defines snapshot @a icon. */
|
---|
61 | void setIcon(const QIcon &icon);
|
---|
62 |
|
---|
63 | /** Defines snapshot @a strName. */
|
---|
64 | void setName(const QString &strName);
|
---|
65 |
|
---|
66 | /** Returns snapshot name. */
|
---|
67 | QString name() const;
|
---|
68 | /** Returns snapshot description. */
|
---|
69 | QString description() const;
|
---|
70 |
|
---|
71 | protected:
|
---|
72 |
|
---|
73 | /** Handles any Qt @a pEvent. */
|
---|
74 | virtual bool event(QEvent *pEvent) RT_OVERRIDE;
|
---|
75 |
|
---|
76 | /** Handles translation event. */
|
---|
77 | virtual void retranslateUi() RT_OVERRIDE;
|
---|
78 |
|
---|
79 | private slots:
|
---|
80 |
|
---|
81 | /** Handles @a strName change signal. */
|
---|
82 | void sltHandleNameChanged(const QString &strName);
|
---|
83 |
|
---|
84 | private:
|
---|
85 |
|
---|
86 | /** Prepares all. */
|
---|
87 | void prepare();
|
---|
88 | /** Prepares contents. */
|
---|
89 | void prepareContents();
|
---|
90 |
|
---|
91 | /** Updates pixmap. */
|
---|
92 | void updatePixmap();
|
---|
93 |
|
---|
94 | /** Holds the amount of immutable mediums. */
|
---|
95 | const ulong m_cImmutableMedia;
|
---|
96 |
|
---|
97 | /** Holds the snapshot icon. */
|
---|
98 | QIcon m_icon;
|
---|
99 |
|
---|
100 | /** Holds the icon label instance. */
|
---|
101 | QLabel *m_pLabelIcon;
|
---|
102 |
|
---|
103 | /** Holds the name label instance. */
|
---|
104 | QLabel *m_pLabelName;
|
---|
105 | /** Holds the name editor instance. */
|
---|
106 | QLineEdit *m_pEditorName;
|
---|
107 |
|
---|
108 | /** Holds the description label instance. */
|
---|
109 | QLabel *m_pLabelDescription;
|
---|
110 | /** Holds the description editor instance. */
|
---|
111 | QTextEdit *m_pEditorDescription;
|
---|
112 |
|
---|
113 | /** Holds the information label instance. */
|
---|
114 | QILabel *m_pLabelInfo;
|
---|
115 |
|
---|
116 | /** Holds the dialog button-box instance. */
|
---|
117 | QIDialogButtonBox *m_pButtonBox;
|
---|
118 | };
|
---|
119 |
|
---|
120 | #endif /* !FEQT_INCLUDED_SRC_UITakeSnapshotDialog_h */
|
---|