]> gitweb.stoutner.com Git - PrivacyBrowserPC.git/blob - src/windows/BrowserWindow.h
Implement manual adding of cookies.
[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 addCookieToList(const QNetworkCookie &newCookie) const;
49     void addOrEditDomainSettings() const;
50     void back() const;
51     void clearUrlLineEditFocus() const;
52     void fileNew() const;
53     void forward() const;
54     void getZoomFactorFromUser();
55     void home() const;
56     void loadUrlFromLineEdit(const QString &url) const;
57     void openCookiesDialog();
58     void openDomainSettings() const;
59     void refresh() const;
60     void settingsConfigure();
61     void showProgressBar(const int &progress) const;
62     void toggleJavaScript() const;
63     void toggleLocalStorage() const;
64     void updateDomainSettingsIndicator(const bool &status, const QString &domainSettingsDomain);
65     void updateJavaScriptAction(const bool &isEnabled) const;
66     void updateLocalStorageAction(const bool &isEnabled) const;
67     void updateSearchEngineActions(const QString &searchEngine) const;
68     void updateUserAgentActions(const QString &userAgent) const;
69     void updateZoomFactorAction(const double &zoomFactor);
70     void updateSearchEngineLabel(const QString &searchEngineString) const;
71     void updateUrlLineEdit(const QUrl &newUrl);
72     void updateUserAgentLabel(const QString &userAgentDatabaseName) const;
73
74 private:
75     // The private variables.
76     BrowserView *browserViewPointer;
77     KConfigDialog *configDialogPointer;
78     QList<QNetworkCookie> *cookieListPointer;
79     QString currentDomainSettingsDomain;
80     QUrl currentUrl;
81     double currentZoomFactor;
82     QPalette domainSettingsPalette;
83     QAction *javaScriptActionPointer;
84     QAction *localStorageActionPointer;
85     QPalette noDomainSettingsPalette;
86     QProgressBar *progressBarPointer;
87     QLabel *searchEngineLabelPointer;
88     QAction *searchEngineMojeekActionPointer;
89     QAction *searchEngineMonoclesActionPointer;
90     QAction *searchEngineMetagerActionPointer;
91     QAction *searchEngineGoogleActionPointer;
92     QAction *searchEngineBingActionPointer;
93     QAction *searchEngineYahooActionPointer;
94     QAction *searchEngineCustomActionPointer;
95     QLabel *userAgentLabelPointer;
96     QAction *userAgentPrivacyBrowserActionPointer;
97     QAction *userAgentWebEngineDefaultActionPointer;
98     QAction *userAgentFirefoxLinuxActionPointer;
99     QAction *userAgentChromiumLinuxActionPointer;
100     QAction *userAgentFirefoxWindowsActionPointer;
101     QAction *userAgentChromeWindowsActionPointer;
102     QAction *userAgentEdgeWindowsActionPointer;
103     QAction *userAgentSafariMacosActionPointer;
104     QAction *userAgentCustomActionPointer;
105     KLineEdit *urlLineEditPointer;
106     QAction *zoomFactorActionPointer;
107 };
108 #endif