1 | /* $Id: VBoxLicenseViewer.h 93990 2022-02-28 15:34:57Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * VBox Qt GUI - VBoxLicenseViewer class declaration.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2006-2022 Oracle Corporation
|
---|
8 | *
|
---|
9 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
10 | * available from http://www.virtualbox.org. This file is free software;
|
---|
11 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
12 | * General Public License (GPL) as published by the Free Software
|
---|
13 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
14 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
15 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
16 | */
|
---|
17 |
|
---|
18 | #ifndef FEQT_INCLUDED_SRC_VBoxLicenseViewer_h
|
---|
19 | #define FEQT_INCLUDED_SRC_VBoxLicenseViewer_h
|
---|
20 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
21 | # pragma once
|
---|
22 | #endif
|
---|
23 |
|
---|
24 | /* Qt includes: */
|
---|
25 | #include <QDialog>
|
---|
26 |
|
---|
27 | /* GUI includes: */
|
---|
28 | #include "QIWithRetranslateUI.h"
|
---|
29 | #include "UILibraryDefs.h"
|
---|
30 |
|
---|
31 | /* Forward declarations: */
|
---|
32 | class QTextBrowser;
|
---|
33 | class QPushButton;
|
---|
34 |
|
---|
35 | /** QDialog subclass used to show a user license under linux. */
|
---|
36 | class SHARED_LIBRARY_STUFF VBoxLicenseViewer : public QIWithRetranslateUI2<QDialog>
|
---|
37 | {
|
---|
38 | Q_OBJECT;
|
---|
39 |
|
---|
40 | public:
|
---|
41 |
|
---|
42 | /** Constructs license viewer passing @a pParent to the base-class. */
|
---|
43 | VBoxLicenseViewer(QWidget *pParent = 0);
|
---|
44 |
|
---|
45 | /** Shows license from passed @a strLicenseText. */
|
---|
46 | int showLicenseFromString(const QString &strLicenseText);
|
---|
47 | /** Shows license from file with passed @a strLicenseFileName. */
|
---|
48 | int showLicenseFromFile(const QString &strLicenseFileName);
|
---|
49 |
|
---|
50 | protected:
|
---|
51 |
|
---|
52 | /** Preprocesses Qt @a pEvent for passed @a pObject. */
|
---|
53 | virtual bool eventFilter(QObject *pObject, QEvent *pEvent) RT_OVERRIDE;
|
---|
54 |
|
---|
55 | /** Handles Qt show @a pEvent. */
|
---|
56 | virtual void showEvent(QShowEvent *pEvent) RT_OVERRIDE;
|
---|
57 |
|
---|
58 | /** Handles translation event. */
|
---|
59 | virtual void retranslateUi() RT_OVERRIDE;
|
---|
60 |
|
---|
61 | private slots:
|
---|
62 |
|
---|
63 | /** Executes the dialog. */
|
---|
64 | int exec();
|
---|
65 |
|
---|
66 | /** Handles scroll-bar moving by a certain @a iValue. */
|
---|
67 | void sltHandleScrollBarMoved(int iValue);
|
---|
68 |
|
---|
69 | /** Uplocks buttons. */
|
---|
70 | void sltUnlockButtons();
|
---|
71 |
|
---|
72 | private:
|
---|
73 |
|
---|
74 | /** Holds the licence text browser instance. */
|
---|
75 | QTextBrowser *m_pLicenseBrowser;
|
---|
76 |
|
---|
77 | /** Holds the licence agree button instance. */
|
---|
78 | QPushButton *m_pButtonAgree;
|
---|
79 | /** Holds the licence disagree button instance. */
|
---|
80 | QPushButton *m_pButtonDisagree;
|
---|
81 | };
|
---|
82 |
|
---|
83 | #endif /* !FEQT_INCLUDED_SRC_VBoxLicenseViewer_h */
|
---|
84 |
|
---|