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