Falkon Develop
Cross-platform Qt-based web browser
adblockdialog.h
Go to the documentation of this file.
1/* ============================================================
2* Falkon - Qt web browser
3* Copyright (C) 2010-2018 David Rosca <nowrep@gmail.com>
4*
5* This program is free software: you can redistribute it and/or modify
6* it under the terms of the GNU General Public License as published by
7* the Free Software Foundation, either version 3 of the License, or
8* (at your option) any later version.
9*
10* This program is distributed in the hope that it will be useful,
11* but WITHOUT ANY WARRANTY; without even the implied warranty of
12* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13* GNU General Public License for more details.
14*
15* You should have received a copy of the GNU General Public License
16* along with this program. If not, see <http://www.gnu.org/licenses/>.
17* ============================================================ */
18#ifndef ADBLOCKDIALOG_H
19#define ADBLOCKDIALOG_H
20
21#include <QDialog>
22
23#include "qzcommon.h"
24#include "ui_adblockdialog.h"
25
28class AdBlockManager;
29class AdBlockRule;
30
31class FALKON_EXPORT AdBlockDialog : public QDialog, public Ui_AdBlockDialog
32{
33 Q_OBJECT
34
35public:
36 explicit AdBlockDialog(QWidget* parent = nullptr);
37
38 void showRule(const AdBlockRule* rule) const;
39
40private Q_SLOTS:
41 void addRule();
42 void removeRule();
43
44 void addSubscription();
45 void removeSubscription();
46
47 void currentChanged(int index);
48 void filterString(const QString &string);
49 void enableAdBlock(bool state);
50
51 void aboutToShowMenu();
52 void learnAboutRules();
53
54 void loadSubscriptions();
55 void load();
56
57private:
58 AdBlockManager* m_manager;
59 AdBlockTreeWidget* m_currentTreeWidget;
60 AdBlockSubscription* m_currentSubscription;
61
62 QAction* m_actionAddRule;
63 QAction* m_actionRemoveRule;
64 QAction* m_actionAddSubscription;
65 QAction* m_actionRemoveSubscription;
66
67 bool m_loaded;
68};
69
70#endif // ADBLOCKDIALOG_H
71
State state
#define FALKON_EXPORT
Definition: qzcommon.h:28