1 | /* $Id: VBoxLicenseViewer.h 71630 2018-04-03 16:37:08Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * VBox Qt GUI - VBoxLicenseViewer class declaration.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2006-2018 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 ___VBoxLicenseViewer___
|
---|
19 | #define ___VBoxLicenseViewer___
|
---|
20 |
|
---|
21 | /* Qt includes: */
|
---|
22 | #include <QDialog>
|
---|
23 |
|
---|
24 | /* GUI includes: */
|
---|
25 | #include "QIWithRetranslateUI.h"
|
---|
26 | #include "UILibraryDefs.h"
|
---|
27 |
|
---|
28 | /* Forward declarations: */
|
---|
29 | class QTextBrowser;
|
---|
30 | class QPushButton;
|
---|
31 |
|
---|
32 | /** QDialog subclass used to show a user license under linux. */
|
---|
33 | class SHARED_LIBRARY_STUFF VBoxLicenseViewer : public QIWithRetranslateUI2<QDialog>
|
---|
34 | {
|
---|
35 | Q_OBJECT;
|
---|
36 |
|
---|
37 | public:
|
---|
38 |
|
---|
39 | /** Constructs license viewer passing @a pParent to the base-class. */
|
---|
40 | VBoxLicenseViewer(QWidget *pParent = 0);
|
---|
41 |
|
---|
42 | /** Shows license from passed @a strLicenseText. */
|
---|
43 | int showLicenseFromString(const QString &strLicenseText);
|
---|
44 | /** Shows license from file with passed @a strLicenseFileName. */
|
---|
45 | int showLicenseFromFile(const QString &strLicenseFileName);
|
---|
46 |
|
---|
47 | protected:
|
---|
48 |
|
---|
49 | /** Preprocesses Qt @a pEvent for passed @a pObject. */
|
---|
50 | virtual bool eventFilter(QObject *pObject, QEvent *pEvent) /* override */;
|
---|
51 |
|
---|
52 | /** Handles Qt show @a pEvent. */
|
---|
53 | virtual void showEvent(QShowEvent *pEvent) /* override */;
|
---|
54 |
|
---|
55 | /** Handles translation event. */
|
---|
56 | virtual void retranslateUi() /* override */;
|
---|
57 |
|
---|
58 | private slots:
|
---|
59 |
|
---|
60 | /** Executes the dialog. */
|
---|
61 | int exec();
|
---|
62 |
|
---|
63 | /** Handles scroll-bar moving by a certain @a iValue. */
|
---|
64 | void sltHandleScrollBarMoved(int iValue);
|
---|
65 |
|
---|
66 | /** Uplocks buttons. */
|
---|
67 | void sltUnlockButtons();
|
---|
68 |
|
---|
69 | private:
|
---|
70 |
|
---|
71 | /** Holds the licence text browser instance. */
|
---|
72 | QTextBrowser *m_pLicenseBrowser;
|
---|
73 |
|
---|
74 | /** Holds the licence agree button instance. */
|
---|
75 | QPushButton *m_pButtonAgree;
|
---|
76 | /** Holds the licence disagree button instance. */
|
---|
77 | QPushButton *m_pButtonDisagree;
|
---|
78 | };
|
---|
79 |
|
---|
80 | #endif /* !___VBoxLicenseViewer___ */
|
---|
81 |
|
---|