]> gitweb.stoutner.com Git - PrivacyBrowserPC.git/blob - src/windows/BrowserWindow.h
Add a progress bar.
[PrivacyBrowserPC.git] / src / windows / BrowserWindow.h
1 /*
2  * Copyright © 2022 Soren Stoutner <soren@stoutner.com>.
3  *
4  * This file is part of Privacy Browser PC <https://www.stoutner.com/privacy-browser-pc>.
5  *
6  * Privacy Browser PC is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation, either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * Privacy Browser PC is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with Privacy Browser PC.  If not, see <http://www.gnu.org/licenses/>.
18  */
19
20 #ifndef BROWSERWINDOW_H
21 #define BROWSERWINDOW_H
22
23 // Application headers.
24 #include "views/BrowserView.h"
25
26 // KDE Frameworks headers.
27 #include <KConfigDialog>
28 #include <KXmlGuiWindow>
29
30 // Qt toolkit headers.
31 #include <QLabel>
32 #include <QProgressBar>
33
34 class BrowserWindow : public KXmlGuiWindow
35 {
36     // Include the Q_OBJECT macro.
37     Q_OBJECT
38
39 public:
40     // The default constructor.
41     BrowserWindow();
42
43     // The public functions.
44     QSize sizeHint() const override;
45
46 private Q_SLOTS:
47     // The private slots.
48     void back() const;
49     void fileNew() const;
50     void forward() const;
51     void getZoomFactorFromUser();
52     void home() const;
53     void loadUrlFromLineEdit(const QString &url) const;
54     void openDomainSettings() const;
55     void refresh() const;
56     void settingsConfigure();
57     void showProgressBar(const int &progress) const;
58     void toggleJavaScript() const;
59     void updateDomainSettingsIndicator(const bool &status) const;
60     void updateJavaScriptAction(const bool &isEnabled) const;
61     void updateSearchEngineActions(const QString &searchEngine) const;
62     void updateUserAgentActions(const QString &userAgent) const;
63     void updateZoomFactorAction(const double &zoomFactor);
64     void updateSearchEngineLabel(const QString &searchEngineString) const;
65     void updateUrlLineEdit(const QString &newUrl) const;
66     void updateUserAgentLabel(const QString &userAgentDatabaseName) const;
67
68 private:
69     // The private variables.
70     BrowserView *browserViewPointer;
71     KConfigDialog *configDialogPointer;
72     QAction *domainSettingsActionPointer;
73     QPalette domainSettingsPalette;
74     double currentZoomFactor;
75     QAction *javaScriptActionPointer;
76     QPalette noDomainSettingsPalette;
77     QProgressBar *progressBarPointer;
78     QLabel *searchEngineLabelPointer;
79     QAction *searchEngineMojeekActionPointer;
80     QAction *searchEngineMonoclesActionPointer;
81     QAction *searchEngineMetagerActionPointer;
82     QAction *searchEngineGoogleActionPointer;
83     QAction *searchEngineBingActionPointer;
84     QAction *searchEngineYahooActionPointer;
85     QAction *searchEngineCustomActionPointer;
86     QLabel *userAgentLabelPointer;
87     QAction *userAgentPrivacyBrowserActionPointer;
88     QAction *userAgentFirefoxLinuxActionPointer;
89     QAction *userAgentChromiumLinuxActionPointer;
90     QAction *userAgentFirefoxWindowsActionPointer;
91     QAction *userAgentChromeWindowsActionPointer;
92     QAction *userAgentEdgeWindowsActionPointer;
93     QAction *userAgentSafariMacosActionPointer;
94     QAction *userAgentCustomActionPointer;
95     KLineEdit *urlLineEditPointer;
96     QAction *zoomFactorActionPointer;
97 };
98 #endif