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