2 * Copyright © 2022 Soren Stoutner <soren@stoutner.com>.
4 * This file is part of Privacy Browser PC <https://www.stoutner.com/privacy-browser-pc>.
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.
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.
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/>.
20 #ifndef BROWSERWINDOW_H
21 #define BROWSERWINDOW_H
23 // Application headers.
24 #include "widgets/TabWidget.h"
26 // KDE Frameworks headers.
27 #include <KConfigDialog>
28 #include <KToggleFullScreenAction>
29 #include <KXmlGuiWindow>
31 // Qt toolkit headers.
34 #include <QProgressBar>
36 class BrowserWindow : public KXmlGuiWindow
38 // Include the Q_OBJECT macro.
42 // The default constructor.
45 // The public functions.
46 QSize sizeHint() const override;
48 // The public variables.
49 TabWidget *tabWidgetPointer;
53 void addOrEditDomainSettings() const;
55 void clearUrlLineEditFocus() const;
59 void fullScreenRequested(const bool toggleOn);
60 void getZoomFactorFromUser();
62 void loadUrlFromLineEdit(const QString &url) const;
64 void showCookiesDialog();
65 void showDownloadLocationBrowseDialog() const;
66 void showDomainSettingsDialog() const;
67 void showProgressBar(const int &progress) const;
68 void showSettingsDialog();
69 void toggleDomStorage() const;
70 void toggleJavaScript() const;
71 void toggleLocalStorage() const;
72 void toggleFullScreen();
73 void updateCookiesAction(const int numberOfCookies) const;
74 void updateDomStorageAction(const bool &isEnabled) const;
75 void updateDomainSettingsIndicator(const bool status);
76 void updateJavaScriptAction(const bool &isEnabled);
77 void updateLocalStorageAction(const bool &isEnabled);
78 void updateSearchEngineActions(const QString &searchEngine, const bool &updateCustomSearchEngineStatus);
79 void updateUserAgentActions(const QString &userAgent, const bool &updateCustomUserAgentStatus);
80 void updateZoomFactorAction(const double &zoomFactor);
81 void updateSearchEngineLabel(const QString &searchEngineString) const;
82 void updateUrlLineEdit(const QUrl &newUrl);
83 void updateUserAgentLabel(const QString &userAgentDatabaseName) const;
86 // The private variables.
87 KConfigDialog *configDialogPointer;
88 QAction *cookiesActionPointer;
90 double currentZoomFactor;
91 bool customSearchEngineEnabled;
92 bool customUserAgentEnabled;
93 QAction *domStorageActionPointer;
94 QPalette domainSettingsPalette;
95 QComboBox *downloadLocationComboBoxPointer;
96 KToggleFullScreenAction *fullScreenActionPointer;
97 QAction *javaScriptActionPointer;
98 bool javaScriptEnabled;
99 QAction *localStorageActionPointer;
100 bool localStorageEnabled;
101 KToolBar *navigationToolBarPointer;
102 QPalette noDomainSettingsPalette;
103 QProgressBar *progressBarPointer;
104 QLabel *searchEngineLabelPointer;
105 QAction *searchEngineMenuActionPointer;
106 QAction *searchEngineMojeekActionPointer;
107 QAction *searchEngineMonoclesActionPointer;
108 QAction *searchEngineMetagerActionPointer;
109 QAction *searchEngineGoogleActionPointer;
110 QAction *searchEngineBingActionPointer;
111 QAction *searchEngineYahooActionPointer;
112 QAction *searchEngineCustomActionPointer;
113 QLabel *userAgentLabelPointer;
114 QAction *userAgentMenuActionPointer;
115 QAction *userAgentPrivacyBrowserActionPointer;
116 QAction *userAgentWebEngineDefaultActionPointer;
117 QAction *userAgentFirefoxLinuxActionPointer;
118 QAction *userAgentChromiumLinuxActionPointer;
119 QAction *userAgentFirefoxWindowsActionPointer;
120 QAction *userAgentChromeWindowsActionPointer;
121 QAction *userAgentEdgeWindowsActionPointer;
122 QAction *userAgentSafariMacosActionPointer;
123 QAction *userAgentCustomActionPointer;
124 KLineEdit *urlLineEditPointer;
125 KToolBar *urlToolBarPointer;
126 QAction *zoomFactorActionPointer;