1 | /* $Id: UIHelpBrowserDialog.h 104358 2024-04-18 05:33:40Z 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 |
|
---|
40 | /* Forward declarations: */
|
---|
41 | class QLabel;
|
---|
42 | class UIHelpBrowserWidget;
|
---|
43 |
|
---|
44 | class SHARED_LIBRARY_STUFF UIHelpBrowserDialog : public QIWithRestorableGeometry<QMainWindow>
|
---|
45 | {
|
---|
46 | Q_OBJECT;
|
---|
47 |
|
---|
48 | public:
|
---|
49 |
|
---|
50 | static void findManualFileAndShow(const QString &strKeyword = QString());
|
---|
51 |
|
---|
52 | /** @name Remove default ctor, and copying.
|
---|
53 | * @{ */
|
---|
54 | UIHelpBrowserDialog() = delete;
|
---|
55 | UIHelpBrowserDialog(const UIHelpBrowserDialog &other) = delete;
|
---|
56 | void operator=(const UIHelpBrowserDialog &other) = delete;
|
---|
57 | /** @} */
|
---|
58 |
|
---|
59 | protected:
|
---|
60 |
|
---|
61 | virtual bool event(QEvent *pEvent) RT_OVERRIDE;
|
---|
62 |
|
---|
63 | /** @name Prepare/cleanup cascade.
|
---|
64 | * @{ */
|
---|
65 | virtual void prepareCentralWidget();
|
---|
66 | virtual void loadSettings();
|
---|
67 | virtual void saveDialogGeometry();
|
---|
68 | /** @} */
|
---|
69 |
|
---|
70 | /** Returns whether the window should be maximized when geometry being restored. */
|
---|
71 | virtual bool shouldBeMaximized() const RT_OVERRIDE;
|
---|
72 |
|
---|
73 | private slots:
|
---|
74 |
|
---|
75 | void sltStatusBarMessage(const QString& strLink, int iTimeOut);
|
---|
76 | void sltStatusBarVisibilityChange(bool fVisible);
|
---|
77 | void sltZoomPercentageChanged(int iPercentage);
|
---|
78 | void sltRetranslateUI();
|
---|
79 |
|
---|
80 | private:
|
---|
81 |
|
---|
82 | UIHelpBrowserDialog(QWidget *pParent, QWidget *pCenterWidget, const QString &strHelpFilePath);
|
---|
83 | static void showUserManual(const QString &strHelpFilePath, const QString &strKeyword);
|
---|
84 |
|
---|
85 | /** A passthru function for QHelpIndexWidget::showHelpForKeyword. */
|
---|
86 | void showHelpForKeyword(const QString &strKeyword);
|
---|
87 |
|
---|
88 | QString m_strHelpFilePath;
|
---|
89 | UIHelpBrowserWidget *m_pWidget;
|
---|
90 | QWidget *m_pCenterWidget;
|
---|
91 | int m_iGeometrySaveTimerId;
|
---|
92 | QLabel *m_pZoomLabel;
|
---|
93 | static QPointer<UIHelpBrowserDialog> m_pInstance;
|
---|
94 | };
|
---|
95 |
|
---|
96 |
|
---|
97 | #endif /* !FEQT_INCLUDED_SRC_helpbrowser_UIHelpBrowserDialog_h */
|
---|