1 | /* $Id: UISettingsWarningPane.h 100967 2023-08-25 11:37:51Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * VBox Qt GUI - UISettingsWarningPane class declaration.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2009-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_settings_UISettingsWarningPane_h
|
---|
29 | #define FEQT_INCLUDED_SRC_settings_UISettingsWarningPane_h
|
---|
30 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
31 | # pragma once
|
---|
32 | #endif
|
---|
33 |
|
---|
34 | /* Qt includes: */
|
---|
35 | #include <QWidget>
|
---|
36 |
|
---|
37 | /* GUI includes: */
|
---|
38 | #include "UILibraryDefs.h"
|
---|
39 |
|
---|
40 | /* Forward declarations: */
|
---|
41 | class QHBoxLayout;
|
---|
42 | class QEvent;
|
---|
43 | class QLabel;
|
---|
44 | class QObject;
|
---|
45 | class QString;
|
---|
46 | class QTimer;
|
---|
47 | class QWidget;
|
---|
48 | class UISettingsPageValidator;
|
---|
49 |
|
---|
50 | /** QWidget sub-class,
|
---|
51 | * used a settings dialog warning-pane. */
|
---|
52 | class SHARED_LIBRARY_STUFF UISettingsWarningPane : public QWidget
|
---|
53 | {
|
---|
54 | Q_OBJECT;
|
---|
55 |
|
---|
56 | signals:
|
---|
57 |
|
---|
58 | /** Notifies about hover enter event.
|
---|
59 | * @param pValidator Brings the validator reference. */
|
---|
60 | void sigHoverEnter(UISettingsPageValidator *pValidator);
|
---|
61 | /** Notifies about hover leave event.
|
---|
62 | * @param pValidator Brings the validator reference. */
|
---|
63 | void sigHoverLeave(UISettingsPageValidator *pValidator);
|
---|
64 |
|
---|
65 | public:
|
---|
66 |
|
---|
67 | /** Constructs warning-pane passing @a pParent to the base-class. */
|
---|
68 | UISettingsWarningPane(QWidget *pParent = 0);
|
---|
69 |
|
---|
70 | /** Defines current warning-label @a strText. */
|
---|
71 | void setWarningLabelText(const QString &strText);
|
---|
72 | /** Defines whether warning-label should be @a fVisible. */
|
---|
73 | void setWarningLabelVisible(bool fVisible);
|
---|
74 |
|
---|
75 | /** Registers corresponding @a pValidator. */
|
---|
76 | void registerValidator(UISettingsPageValidator *pValidator);
|
---|
77 |
|
---|
78 | protected:
|
---|
79 |
|
---|
80 | /** Preprocesses Qt @a pEvent for passed @a pObject. */
|
---|
81 | virtual bool eventFilter(QObject *pObject, QEvent *pEvent) RT_OVERRIDE;
|
---|
82 |
|
---|
83 | private slots:
|
---|
84 |
|
---|
85 | /** Handles hover timer timeout. */
|
---|
86 | void sltHandleHoverTimer();
|
---|
87 |
|
---|
88 | private:
|
---|
89 |
|
---|
90 | /** Prepares all. */
|
---|
91 | void prepare();
|
---|
92 |
|
---|
93 | /** Holds the icon layout instance. */
|
---|
94 | QHBoxLayout *m_pIconLayout;
|
---|
95 | /** Holds the text label instance. */
|
---|
96 | QLabel *m_pTextLabel;
|
---|
97 |
|
---|
98 | /** Holds the page validators list. */
|
---|
99 | QList<UISettingsPageValidator*> m_validators;
|
---|
100 | /** Holds the page icons list. */
|
---|
101 | QList<QLabel*> m_icons;
|
---|
102 | /** Holds the icons hovered-states list. */
|
---|
103 | QList<bool> m_hovered;
|
---|
104 |
|
---|
105 | /** Holds the hover timer instance. */
|
---|
106 | QTimer *m_pHoverTimer;
|
---|
107 | /** Holds the hovered icon-label position. */
|
---|
108 | int m_iHoveredIconLabelPosition;
|
---|
109 | };
|
---|
110 |
|
---|
111 | #endif /* !FEQT_INCLUDED_SRC_settings_UISettingsWarningPane_h */
|
---|