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;
51 void getZoomFactorFromUser();
53 void loadUrlFromLineEdit(const QString &url) const;
54 void openDomainSettings() const;
56 void settingsConfigure();
57 void showProgressBar(const int &progress) const;
58 void toggleJavaScript() const;
59 void toggleLocalStorage() const;
60 void updateDomainSettingsIndicator(const bool &status) const;
61 void updateJavaScriptAction(const bool &isEnabled) const;
62 void updateLocalStorageAction(const bool &isEnabled) const;
63 void updateSearchEngineActions(const QString &searchEngine) const;
64 void updateUserAgentActions(const QString &userAgent) const;
65 void updateZoomFactorAction(const double &zoomFactor);
66 void updateSearchEngineLabel(const QString &searchEngineString) const;
67 void updateUrlLineEdit(const QString &newUrl) const;
68 void updateUserAgentLabel(const QString &userAgentDatabaseName) const;
71 // The private variables.
72 BrowserView *browserViewPointer;
73 KConfigDialog *configDialogPointer;
74 QAction *domainSettingsActionPointer;
75 QPalette domainSettingsPalette;
76 double currentZoomFactor;
77 QAction *javaScriptActionPointer;
78 QAction *localStorageActionPointer;
79 QPalette noDomainSettingsPalette;
80 QProgressBar *progressBarPointer;
81 QLabel *searchEngineLabelPointer;
82 QAction *searchEngineMojeekActionPointer;
83 QAction *searchEngineMonoclesActionPointer;
84 QAction *searchEngineMetagerActionPointer;
85 QAction *searchEngineGoogleActionPointer;
86 QAction *searchEngineBingActionPointer;
87 QAction *searchEngineYahooActionPointer;
88 QAction *searchEngineCustomActionPointer;
89 QLabel *userAgentLabelPointer;
90 QAction *userAgentPrivacyBrowserActionPointer;
91 QAction *userAgentFirefoxLinuxActionPointer;
92 QAction *userAgentChromiumLinuxActionPointer;
93 QAction *userAgentFirefoxWindowsActionPointer;
94 QAction *userAgentChromeWindowsActionPointer;
95 QAction *userAgentEdgeWindowsActionPointer;
96 QAction *userAgentSafariMacosActionPointer;
97 QAction *userAgentCustomActionPointer;
98 KLineEdit *urlLineEditPointer;
99 QAction *zoomFactorActionPointer;