]> gitweb.stoutner.com Git - PrivacyBrowserPC.git/blob - src/windows/BrowserWindow.h
Add zoom controls to the status bar. https://redmine.stoutner.com/issues/1031
[PrivacyBrowserPC.git] / src / windows / BrowserWindow.h
1 /*
2  * Copyright 2022-2023 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 "widgets/TabWidget.h"
25
26 // KDE Frameworks headers.
27 #include <KConfigDialog>
28 #include <KToggleFullScreenAction>
29 #include <KXmlGuiWindow>
30
31 // Qt toolkit headers.
32 #include <QComboBox>
33 #include <QLabel>
34 #include <QProgressBar>
35
36 class BrowserWindow : public KXmlGuiWindow
37 {
38     // Include the Q_OBJECT macro.
39     Q_OBJECT
40
41 public:
42     // The default constructor.
43     BrowserWindow(bool firstWindow=true);
44
45     // The public functions.
46     QSize sizeHint() const override;
47
48     // The public variables.
49     TabWidget *tabWidgetPointer;
50
51 private Q_SLOTS:
52     // The private slots.
53     void addOrEditDomainSettings() const;
54     void back() const;
55     void clearUrlLineEditFocus() const;
56     void decrementZoom();
57     void escape() const;
58     void findNext() const;
59     void findPrevious() const;
60     void forward() const;
61     void fullScreenRequested(const bool toggleOn);
62     void getZoomFactorFromUser();
63     void hideFindTextActions() const;
64     void home() const;
65     void incrementZoom();
66     void loadUrlFromLineEdit(const QString &url) const;
67     void newWindow() const;
68     void refresh() const;
69     void reloadAndBypassCache() const;
70     void showCookiesDialog();
71     void showDownloadLocationBrowseDialog() const;
72     void showDomainSettingsDialog() const;
73     void showFindTextActions() const;
74     void showProgressBar(const int &progress) const;
75     void showSettingsDialog();
76     void toggleDomStorage() const;
77     void toggleFindCaseSensitive() const;
78     void toggleJavaScript() const;
79     void toggleLocalStorage() const;
80     void toggleFullScreen();
81     void toggleViewSource() const;
82     void toggleViewSourceInNewTab() const;
83     void updateCookiesAction(const int numberOfCookies) const;
84     void updateDomStorageAction(const bool &isEnabled) const;
85     void updateDomainSettingsIndicator(const bool status);
86     void updateFindText(const QString &text, const bool findCaseSensitive) const;
87     void updateFindTextResults(const QWebEngineFindTextResult &findTextResult) const;
88     void updateJavaScriptAction(const bool &isEnabled);
89     void updateLocalStorageAction(const bool &isEnabled);
90     void updateSearchEngineActions(const QString &searchEngine, const bool &updateCustomSearchEngineStatus);
91     void updateUserAgentActions(const QString &userAgent, const bool &updateCustomUserAgentStatus);
92     void updateZoomFactorAction(const double &zoomFactor);
93     void updateSearchEngineLabel(const QString &searchEngineString) const;
94     void updateUrlLineEdit(const QUrl &newUrl);
95     void updateUserAgentLabel(const QString &userAgentDatabaseName) const;
96     void updateWindowTitle(const QString &title);
97
98 private:
99     // The private variables.
100     KConfigDialog *configDialogPointer;
101     QAction *cookiesActionPointer;
102     QUrl currentUrl;
103     QPushButton *currentZoomButtonPointer;
104     double currentZoomFactor;
105     bool customSearchEngineEnabled;
106     bool customUserAgentEnabled;
107     QAction *domStorageActionPointer;
108     QComboBox *downloadLocationComboBoxPointer;
109     QAction *findCaseSensitiveActionPointer;
110     QAction *findNextActionPointer;
111     QAction *findPreviousActionPointer;
112     QAction *findTextLabelActionPointer;
113     QLabel *findTextLabelPointer;
114     QAction *findTextLineEditActionPointer;
115     KLineEdit *findTextLineEditPointer;
116     KToggleFullScreenAction *fullScreenActionPointer;
117     QAction *hideFindTextActionPointer;
118     QAction *javaScriptActionPointer;
119     bool javaScriptEnabled;
120     QAction *localStorageActionPointer;
121     bool localStorageEnabled;
122     KToolBar *navigationToolBarPointer;
123     QPalette negativeBackgroundPalette;
124     QPalette normalBackgroundPalette;
125     QPalette positiveBackgroundPalette;
126     QProgressBar *progressBarPointer;
127     QLabel *searchEngineLabelPointer;
128     QAction *searchEngineMenuActionPointer;
129     QAction *searchEngineMojeekActionPointer;
130     QAction *searchEngineMonoclesActionPointer;
131     QAction *searchEngineMetagerActionPointer;
132     QAction *searchEngineGoogleActionPointer;
133     QAction *searchEngineBingActionPointer;
134     QAction *searchEngineYahooActionPointer;
135     QAction *searchEngineCustomActionPointer;
136     QLabel *userAgentLabelPointer;
137     QAction *userAgentMenuActionPointer;
138     QAction *userAgentPrivacyBrowserActionPointer;
139     QAction *userAgentWebEngineDefaultActionPointer;
140     QAction *userAgentFirefoxLinuxActionPointer;
141     QAction *userAgentChromiumLinuxActionPointer;
142     QAction *userAgentFirefoxWindowsActionPointer;
143     QAction *userAgentChromeWindowsActionPointer;
144     QAction *userAgentEdgeWindowsActionPointer;
145     QAction *userAgentSafariMacosActionPointer;
146     QAction *userAgentCustomActionPointer;
147     KLineEdit *urlLineEditPointer;
148     KToolBar *urlToolBarPointer;
149     QAction *viewSourceActionPointer;
150     QAction *viewSourceInNewTabActionPointer;
151     QAction *zoomFactorActionPointer;
152 };
153 #endif