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