1 | /* $Id: UIHelpBrowserDialog.h 99973 2023-05-25 10:14:39Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * VBox Qt GUI - UIHelpBrowserDialog class declaration.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2010-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_helpbrowser_UIHelpBrowserDialog_h
|
---|
29 | #define FEQT_INCLUDED_SRC_helpbrowser_UIHelpBrowserDialog_h
|
---|
30 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
31 | # pragma once
|
---|
32 | #endif
|
---|
33 |
|
---|
34 | /* Qt includes: */
|
---|
35 | #include <QPointer>
|
---|
36 |
|
---|
37 | /* GUI includes: */
|
---|
38 | #include "QIWithRestorableGeometry.h"
|
---|
39 | #include "QIWithRetranslateUI.h"
|
---|
40 |
|
---|
41 |
|
---|
42 | /* Forward declarations: */
|
---|
43 | class QLabel;
|
---|
44 | class UIHelpBrowserWidget;
|
---|
45 |
|
---|
46 | class SHARED_LIBRARY_STUFF UIHelpBrowserDialog : public QIWithRetranslateUI<QIWithRestorableGeometry<QMainWindow> >
|
---|
47 | {
|
---|
48 | Q_OBJECT;
|
---|
49 |
|
---|
50 | public:
|
---|
51 |
|
---|
52 | static void findManualFileAndShow(const QString &strKeyword = QString());
|
---|
53 |
|
---|
54 | /** @name Remove default ctor, and copying.
|
---|
55 | * @{ */
|
---|
56 | UIHelpBrowserDialog() = delete;
|
---|
57 | UIHelpBrowserDialog(const UIHelpBrowserDialog &other) = delete;
|
---|
58 | void operator=(const UIHelpBrowserDialog &other) = delete;
|
---|
59 | /** @} */
|
---|
60 |
|
---|
61 | protected:
|
---|
62 |
|
---|
63 | /** Handles translation event. */
|
---|
64 | virtual void retranslateUi() RT_OVERRIDE;
|
---|
65 | virtual bool event(QEvent *pEvent) RT_OVERRIDE;
|
---|
66 |
|
---|
67 | /** @name Prepare/cleanup cascade.
|
---|
68 | * @{ */
|
---|
69 | virtual void prepareCentralWidget();
|
---|
70 | virtual void loadSettings();
|
---|
71 | virtual void saveDialogGeometry();
|
---|
72 | /** @} */
|
---|
73 |
|
---|
74 | /** Returns whether the window should be maximized when geometry being restored. */
|
---|
75 | virtual bool shouldBeMaximized() const RT_OVERRIDE;
|
---|
76 |
|
---|
77 | private slots:
|
---|
78 |
|
---|
79 | void sltStatusBarMessage(const QString& strLink, int iTimeOut);
|
---|
80 | void sltStatusBarVisibilityChange(bool fVisible);
|
---|
81 | void sltZoomPercentageChanged(int iPercentage);
|
---|
82 |
|
---|
83 | private:
|
---|
84 |
|
---|
85 | UIHelpBrowserDialog(QWidget *pParent, QWidget *pCenterWidget, const QString &strHelpFilePath);
|
---|
86 | static void showUserManual(const QString &strHelpFilePath, const QString &strKeyword);
|
---|
87 |
|
---|
88 | /** A passthru function for QHelpIndexWidget::showHelpForKeyword. */
|
---|
89 | void showHelpForKeyword(const QString &strKeyword);
|
---|
90 |
|
---|
91 | QString m_strHelpFilePath;
|
---|
92 | UIHelpBrowserWidget *m_pWidget;
|
---|
93 | QWidget *m_pCenterWidget;
|
---|
94 | int m_iGeometrySaveTimerId;
|
---|
95 | QLabel *m_pZoomLabel;
|
---|
96 | static QPointer<UIHelpBrowserDialog> m_pInstance;
|
---|
97 | };
|
---|
98 |
|
---|
99 |
|
---|
100 | #endif /* !FEQT_INCLUDED_SRC_helpbrowser_UIHelpBrowserDialog_h */
|
---|