1 | /* $Id: VBoxLicenseViewer.h 103977 2024-03-21 02:04:52Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * VBox Qt GUI - VBoxLicenseViewer 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_VBoxLicenseViewer_h
|
---|
29 | #define FEQT_INCLUDED_SRC_VBoxLicenseViewer_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 "QIWithRetranslateUI.h"
|
---|
39 | #include "UILibraryDefs.h"
|
---|
40 |
|
---|
41 | /* Forward declarations: */
|
---|
42 | class QTextBrowser;
|
---|
43 | class QPushButton;
|
---|
44 |
|
---|
45 | /** QDialog subclass used to show a user license under linux. */
|
---|
46 | class SHARED_LIBRARY_STUFF VBoxLicenseViewer : public QIWithRetranslateUI2<QDialog>
|
---|
47 | {
|
---|
48 | Q_OBJECT;
|
---|
49 |
|
---|
50 | public:
|
---|
51 |
|
---|
52 | /** Constructs license viewer passing @a pParent to the base-class. */
|
---|
53 | VBoxLicenseViewer(QWidget *pParent = 0);
|
---|
54 |
|
---|
55 | /** Shows license from passed @a strLicenseText. */
|
---|
56 | int showLicenseFromString(const QString &strLicenseText);
|
---|
57 | /** Shows license from file with passed @a strLicenseFileName. */
|
---|
58 | int showLicenseFromFile(const QString &strLicenseFileName);
|
---|
59 |
|
---|
60 | protected:
|
---|
61 |
|
---|
62 | /** Preprocesses Qt @a pEvent for passed @a pObject. */
|
---|
63 | virtual bool eventFilter(QObject *pObject, QEvent *pEvent) RT_OVERRIDE;
|
---|
64 |
|
---|
65 | /** Handles Qt show @a pEvent. */
|
---|
66 | virtual void showEvent(QShowEvent *pEvent) RT_OVERRIDE;
|
---|
67 |
|
---|
68 | /** Handles translation event. */
|
---|
69 | virtual void retranslateUi() RT_OVERRIDE;
|
---|
70 |
|
---|
71 | private slots:
|
---|
72 |
|
---|
73 | /** Executes the dialog. */
|
---|
74 | int exec() RT_OVERRIDE;
|
---|
75 |
|
---|
76 | /** Handles scroll-bar moving by a certain @a iValue. */
|
---|
77 | void sltHandleScrollBarMoved(int iValue);
|
---|
78 |
|
---|
79 | /** Uplocks buttons. */
|
---|
80 | void sltUnlockButtons();
|
---|
81 |
|
---|
82 | private:
|
---|
83 |
|
---|
84 | /** Holds the licence text browser instance. */
|
---|
85 | QTextBrowser *m_pLicenseBrowser;
|
---|
86 |
|
---|
87 | /** Holds the licence agree button instance. */
|
---|
88 | QPushButton *m_pButtonAgree;
|
---|
89 | /** Holds the licence disagree button instance. */
|
---|
90 | QPushButton *m_pButtonDisagree;
|
---|
91 | };
|
---|
92 |
|
---|
93 | #endif /* !FEQT_INCLUDED_SRC_VBoxLicenseViewer_h */
|
---|
94 |
|
---|