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