2 * Copyright 2022, 2024 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 DOMAINSETTINGSDIALOG_H
21 #define DOMAINSETTINGSDIALOG_H
23 // Application headers.
24 #include "helpers/UserAgentHelper.h"
26 // KDE Frameworks headers.
29 // Qt toolkit headers.
31 #include <QDoubleSpinBox>
35 class DomainSettingsDialog : public QDialog
37 // Include the Q_OBJECT macro.
41 // The primary constructor.
42 explicit DomainSettingsDialog(QWidget *parentWidgetPointer, const int &startType = SHOW_ALL_DOMAINS, const QString &domainName = QStringLiteral(""));
44 // The public static int constants.
45 static const int SHOW_ALL_DOMAINS;
46 static const int ADD_DOMAIN;
47 static const int EDIT_DOMAIN;
50 void domainSettingsUpdated() const;
56 void customZoomFactorChanged(const double &newValue) const;
57 void domStorageChanged(const int &newIndex) const;
58 void domainNameChanged(const QString &updatedDomainName) const;
59 void domainSelected(const QModelIndex &modelIndex) const;
60 void javaScriptChanged(const int &newIndex) const;
61 void localStorageChanged(const int &newIndex) const;
64 void showAddMessageBox();
65 void showDeleteMessageBox() const;
66 void userAgentChanged(const QString &updatedUserAgent) const;
67 void zoomFactorComboBoxChanged(const int &newIndex) const;
70 // The private variables.
71 QPushButton *applyButtonPointer;
72 QDoubleSpinBox *customZoomFactorSpinBoxPointer;
73 QPalette defaultPalette;
74 QPushButton *deleteDomainButtonPointer;
75 QWidget *domStorageWidgetPointer;
76 QComboBox *domStorageComboBoxPointer;
77 QLabel *domStorageLabelPointer;
78 KLineEdit *domainNameLineEditPointer;
79 QWidget *domainSettingsWidgetPointer;
80 QListView *domainsListViewPointer;
81 QSqlTableModel *domainsTableModelPointer;
82 QItemSelectionModel *domainsSelectionModelPointer;
83 QPalette highlightedPalette;
84 QWidget *javaScriptWidgetPointer;
85 QComboBox *javaScriptComboBoxPointer;
86 QLabel *javaScriptLabelPointer;
87 QWidget *localStorageWidgetPointer;
88 QComboBox *localStorageComboBoxPointer;
89 QLabel *localStorageLabelPointer;
90 QPushButton *resetButtonPointer;
91 QWidget *userAgentWidgetPointer;
92 QComboBox *userAgentComboBoxPointer;
93 UserAgentHelper *userAgentHelperPointer;
94 QLabel *userAgentLabelPointer;
95 QWidget *zoomFactorWidgetPointer;
96 QComboBox *zoomFactorComboBoxPointer;
98 // The private functions.
99 void populateDomStorageLabel() const;
100 void populateJavaScriptLabel() const;
101 void populateLocalStorageLabel() const;
102 void populateUserAgentLabel(const QString &userAgentName) const;
103 void updateDomStorageStatus() const;
104 void updateUi() const;