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