[55401] | 1 | /* $Id: VBoxLicenseViewer.h 104358 2024-04-18 05:33:40Z vboxsync $ */
|
---|
[31877] | 2 | /** @file
|
---|
[52722] | 3 | * VBox Qt GUI - VBoxLicenseViewer class declaration.
|
---|
[31877] | 4 | */
|
---|
| 5 |
|
---|
| 6 | /*
|
---|
[98103] | 7 | * Copyright (C) 2006-2023 Oracle and/or its affiliates.
|
---|
[31877] | 8 | *
|
---|
[96407] | 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
|
---|
[31877] | 26 | */
|
---|
| 27 |
|
---|
[76581] | 28 | #ifndef FEQT_INCLUDED_SRC_VBoxLicenseViewer_h
|
---|
| 29 | #define FEQT_INCLUDED_SRC_VBoxLicenseViewer_h
|
---|
[76532] | 30 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
| 31 | # pragma once
|
---|
| 32 | #endif
|
---|
[31877] | 33 |
|
---|
[71552] | 34 | /* Qt includes: */
|
---|
| 35 | #include <QDialog>
|
---|
| 36 |
|
---|
| 37 | /* GUI includes: */
|
---|
[71630] | 38 | #include "UILibraryDefs.h"
|
---|
[31877] | 39 |
|
---|
[71552] | 40 | /* Forward declarations: */
|
---|
[31877] | 41 | class QTextBrowser;
|
---|
| 42 | class QPushButton;
|
---|
| 43 |
|
---|
[71552] | 44 | /** QDialog subclass used to show a user license under linux. */
|
---|
[104358] | 45 | class SHARED_LIBRARY_STUFF VBoxLicenseViewer : public QDialog
|
---|
[31877] | 46 | {
|
---|
| 47 | Q_OBJECT;
|
---|
| 48 |
|
---|
| 49 | public:
|
---|
| 50 |
|
---|
[71552] | 51 | /** Constructs license viewer passing @a pParent to the base-class. */
|
---|
[35103] | 52 | VBoxLicenseViewer(QWidget *pParent = 0);
|
---|
[31877] | 53 |
|
---|
[71552] | 54 | /** Shows license from passed @a strLicenseText. */
|
---|
| 55 | int showLicenseFromString(const QString &strLicenseText);
|
---|
| 56 | /** Shows license from file with passed @a strLicenseFileName. */
|
---|
[34811] | 57 | int showLicenseFromFile(const QString &strLicenseFileName);
|
---|
[31877] | 58 |
|
---|
| 59 | protected:
|
---|
| 60 |
|
---|
[71552] | 61 | /** Preprocesses Qt @a pEvent for passed @a pObject. */
|
---|
[93990] | 62 | virtual bool eventFilter(QObject *pObject, QEvent *pEvent) RT_OVERRIDE;
|
---|
[31877] | 63 |
|
---|
[71552] | 64 | /** Handles Qt show @a pEvent. */
|
---|
[93990] | 65 | virtual void showEvent(QShowEvent *pEvent) RT_OVERRIDE;
|
---|
[71552] | 66 |
|
---|
[31877] | 67 | private slots:
|
---|
| 68 |
|
---|
[71552] | 69 | /** Executes the dialog. */
|
---|
[103977] | 70 | int exec() RT_OVERRIDE;
|
---|
[34811] | 71 |
|
---|
[71552] | 72 | /** Handles scroll-bar moving by a certain @a iValue. */
|
---|
| 73 | void sltHandleScrollBarMoved(int iValue);
|
---|
[31877] | 74 |
|
---|
[71552] | 75 | /** Uplocks buttons. */
|
---|
| 76 | void sltUnlockButtons();
|
---|
[31877] | 77 |
|
---|
[104358] | 78 | /** Handles translation event. */
|
---|
| 79 | void sltRetranslateUI();
|
---|
| 80 |
|
---|
[31877] | 81 | private:
|
---|
| 82 |
|
---|
[71552] | 83 | /** Holds the licence text browser instance. */
|
---|
| 84 | QTextBrowser *m_pLicenseBrowser;
|
---|
[31877] | 85 |
|
---|
[71552] | 86 | /** Holds the licence agree button instance. */
|
---|
| 87 | QPushButton *m_pButtonAgree;
|
---|
| 88 | /** Holds the licence disagree button instance. */
|
---|
| 89 | QPushButton *m_pButtonDisagree;
|
---|
[31877] | 90 | };
|
---|
| 91 |
|
---|
[76581] | 92 | #endif /* !FEQT_INCLUDED_SRC_VBoxLicenseViewer_h */
|
---|