File indexing completed on 2024-05-12 04:58:20

0001 /* ============================================================
0002 * Falkon - Qt web browser
0003 * Copyright (C) 2010-2018 David Rosca <nowrep@gmail.com>
0004 *
0005 * This program is free software: you can redistribute it and/or modify
0006 * it under the terms of the GNU General Public License as published by
0007 * the Free Software Foundation, either version 3 of the License, or
0008 * (at your option) any later version.
0009 *
0010 * This program is distributed in the hope that it will be useful,
0011 * but WITHOUT ANY WARRANTY; without even the implied warranty of
0012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0013 * GNU General Public License for more details.
0014 *
0015 * You should have received a copy of the GNU General Public License
0016 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
0017 * ============================================================ */
0018 #ifndef PREFERENCES_H
0019 #define PREFERENCES_H
0020 
0021 #include <QUrl>
0022 #include <QDialog>
0023 #include <QPointer>
0024 
0025 #include "qzcommon.h"
0026 
0027 namespace Ui
0028 {
0029 class Preferences;
0030 }
0031 
0032 class QAbstractButton;
0033 class QListWidgetItem;
0034 
0035 class AutoFillManager;
0036 class BrowserWindow;
0037 class PluginsManager;
0038 class DesktopNotification;
0039 class ThemeManager;
0040 
0041 class FALKON_EXPORT Preferences : public QDialog
0042 {
0043     Q_OBJECT
0044 
0045 public:
0046     explicit Preferences(BrowserWindow* window);
0047     ~Preferences() override;
0048 
0049 private Q_SLOTS:
0050     void saveSettings();
0051 
0052     void buttonClicked(QAbstractButton* button);
0053     void showStackedPage(QListWidgetItem* item);
0054 
0055     void chooseDownPath();
0056     void showCookieManager();
0057     void showHtml5Permissions();
0058     void useActualHomepage();
0059     void useActualNewTab();
0060     void showAcceptLanguage();
0061     void chooseUserStyleClicked();
0062     void deleteHtml5storage();
0063     void chooseExternalDownloadManager();
0064     void openUserAgentManager();
0065     void openJsOptions();
0066     void openSearchEnginesManager();
0067     void openCertificateManager();
0068     void openProtocolHandlersManager();
0069     void openSchemesManager();
0070 
0071     void searchFromAddressBarChanged(bool state);
0072     void saveHistoryChanged(bool state);
0073     void allowHtml5storageChanged(bool state);
0074     void downLocChanged(bool state);
0075     void allowCacheChanged(bool state);
0076     void setManualProxyConfigurationEnabled(bool state);
0077     void useExternalDownManagerChanged(bool state);
0078     void changeCachePathClicked();
0079     void allowPluginsToggled(bool checked);
0080 
0081     void newTabChanged(int value);
0082     void afterLaunchChanged(int value);
0083 
0084     void createProfile();
0085     void deleteProfile();
0086     void startProfileIndexChanged(int index);
0087 
0088     void setProgressBarColorIcon(QColor col = QColor());
0089     void selectCustomProgressBarColor();
0090 
0091     void showNotificationPreview();
0092 
0093     void makeFalkonDefault();
0094 
0095 private:
0096     void closeEvent(QCloseEvent* event) override;
0097 
0098     Ui::Preferences* ui;
0099     BrowserWindow* m_window;
0100     AutoFillManager* m_autoFillManager;
0101     PluginsManager* m_pluginsList;
0102     ThemeManager* m_themesManager;
0103     QPointer<DesktopNotification> m_notification;
0104 
0105     QUrl m_homepage;
0106     QUrl m_newTabUrl;
0107     QString m_actProfileName;
0108     int m_afterLaunch;
0109     int m_onNewTab;
0110     QPoint m_notifPosition;
0111 };
0112 
0113 #endif // PREFERENCES_H