]> gitweb.stoutner.com Git - PrivacyBrowserPC.git/blob - src/windows/BrowserWindow.h
Add full screen support. https://redmine.stoutner.com/issues/832
[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 <KToggleFullScreenAction>
29 #include <KXmlGuiWindow>
30
31 // Qt toolkit headers.
32 #include <QLabel>
33 #include <QProgressBar>
34
35 // C++ headers.
36 #include <list>
37
38 class BrowserWindow : public KXmlGuiWindow
39 {
40     // Include the Q_OBJECT macro.
41     Q_OBJECT
42
43 public:
44     // The default constructor.
45     BrowserWindow();
46
47     // The public functions.
48     QSize sizeHint() const override;
49
50 private Q_SLOTS:
51     // The private slots.
52     void addCookieToList(const QNetworkCookie &newCookie) const;
53     void addOrEditDomainSettings() const;
54     void back() const;
55     void clearUrlLineEditFocus() const;
56     void escape() const;
57     void fileNew() const;
58     void forward() const;
59     void fullScreenRequested(const bool toggleOn);
60     void getZoomFactorFromUser();
61     void home() const;
62     void loadUrlFromLineEdit(const QString &url) const;
63     void openCookiesDialog();
64     void openDomainSettings() const;
65     void refresh() const;
66     void removeCookieFromList(const QNetworkCookie &cookie) const;
67     void settingsConfigure();
68     void showProgressBar(const int &progress) const;
69     void toggleDomStorage() const;
70     void toggleJavaScript() const;
71     void toggleLocalStorage() const;
72     void toggleFullScreen();
73     void updateDomStorageAction(const bool &isEnabled) const;
74     void updateDomainSettingsIndicator(const bool &status, const QString &domainSettingsDomain);
75     void updateJavaScriptAction(const bool &isEnabled);
76     void updateLocalStorageAction(const bool &isEnabled);
77     void updateSearchEngineActions(const QString &searchEngine, const bool &updateCustomSearchEngineStatus);
78     void updateUserAgentActions(const QString &userAgent, const bool &updateCustomUserAgentStatus);
79     void updateZoomFactorAction(const double &zoomFactor);
80     void updateSearchEngineLabel(const QString &searchEngineString) const;
81     void updateUrlLineEdit(const QUrl &newUrl);
82     void updateUserAgentLabel(const QString &userAgentDatabaseName) const;
83
84 private:
85     // The private variables.
86     BrowserView *browserViewPointer;
87     KConfigDialog *configDialogPointer;
88     std::list<QNetworkCookie> *cookieListPointer;
89     QAction *cookiesActionPointer;
90     QString currentDomainSettingsDomain;
91     QUrl currentUrl;
92     double currentZoomFactor;
93     bool customSearchEngineEnabled;
94     bool customUserAgentEnabled;
95     QAction *domStorageActionPointer;
96     QPalette domainSettingsPalette;
97     KToggleFullScreenAction *fullScreenActionPointer;
98     QAction *javaScriptActionPointer;
99     bool javaScriptEnabled;
100     QAction *localStorageActionPointer;
101     bool localStorageEnabled;
102     KToolBar *navigationToolBarPointer;
103     QPalette noDomainSettingsPalette;
104     QProgressBar *progressBarPointer;
105     QLabel *searchEngineLabelPointer;
106     QAction *searchEngineMenuActionPointer;
107     QAction *searchEngineMojeekActionPointer;
108     QAction *searchEngineMonoclesActionPointer;
109     QAction *searchEngineMetagerActionPointer;
110     QAction *searchEngineGoogleActionPointer;
111     QAction *searchEngineBingActionPointer;
112     QAction *searchEngineYahooActionPointer;
113     QAction *searchEngineCustomActionPointer;
114     QLabel *userAgentLabelPointer;
115     QAction *userAgentMenuActionPointer;
116     QAction *userAgentPrivacyBrowserActionPointer;
117     QAction *userAgentWebEngineDefaultActionPointer;
118     QAction *userAgentFirefoxLinuxActionPointer;
119     QAction *userAgentChromiumLinuxActionPointer;
120     QAction *userAgentFirefoxWindowsActionPointer;
121     QAction *userAgentChromeWindowsActionPointer;
122     QAction *userAgentEdgeWindowsActionPointer;
123     QAction *userAgentSafariMacosActionPointer;
124     QAction *userAgentCustomActionPointer;
125     KLineEdit *urlLineEditPointer;
126     KToolBar *urlToolBarPointer;
127     QAction *zoomFactorActionPointer;
128 };
129 #endif