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 "views/BrowserView.h"
26 // KDE Frameworks headers.
27 #include <KConfigDialog>
28 #include <KXmlGuiWindow>
30 // Qt toolkit headers.
32 #include <QProgressBar>
34 class BrowserWindow : public KXmlGuiWindow
36 // Include the Q_OBJECT macro.
40 // The default constructor.
43 // The public functions.
44 QSize sizeHint() const override;
48 void addOrEditDomainSettings() const;
52 void getZoomFactorFromUser();
54 void loadUrlFromLineEdit(const QString &url) const;
55 void openDomainSettings() 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;
72 // The private variables.
73 BrowserView *browserViewPointer;
74 KConfigDialog *configDialogPointer;
75 QString currentDomainSettingsDomain;
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;