2012-03-15 19:35:37 +01:00
|
|
|
/* ============================================================
|
|
|
|
* QupZilla - WebKit based browser
|
2014-01-11 16:11:42 +01:00
|
|
|
* Copyright (C) 2010-2014 David Rosca <nowrep@gmail.com>
|
2012-03-15 19:35:37 +01:00
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
* ============================================================ */
|
2012-06-24 23:46:32 +02:00
|
|
|
#ifndef ADBLOCKTREEWIDGET_H
|
|
|
|
#define ADBLOCKTREEWIDGET_H
|
2012-03-15 19:35:37 +01:00
|
|
|
|
2014-02-26 20:03:20 +01:00
|
|
|
#include "qzcommon.h"
|
2012-06-24 23:46:32 +02:00
|
|
|
#include "treewidget.h"
|
|
|
|
|
|
|
|
class AdBlockSubscription;
|
2012-06-25 21:01:30 +02:00
|
|
|
class AdBlockRule;
|
2012-06-24 23:46:32 +02:00
|
|
|
|
2014-02-19 22:12:32 +01:00
|
|
|
class QUPZILLA_EXPORT AdBlockTreeWidget : public TreeWidget
|
2012-03-15 19:35:37 +01:00
|
|
|
{
|
2012-06-24 23:46:32 +02:00
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
explicit AdBlockTreeWidget(AdBlockSubscription* subscription, QWidget* parent = 0);
|
|
|
|
|
|
|
|
AdBlockSubscription* subscription() const;
|
|
|
|
|
2012-07-01 18:13:49 +02:00
|
|
|
void showRule(const AdBlockRule* rule);
|
2012-07-11 18:30:00 +02:00
|
|
|
void refresh();
|
2012-07-01 18:13:49 +02:00
|
|
|
|
2012-06-24 23:46:32 +02:00
|
|
|
public slots:
|
|
|
|
void addRule();
|
|
|
|
void removeRule();
|
|
|
|
|
|
|
|
private slots:
|
|
|
|
void contextMenuRequested(const QPoint &pos);
|
|
|
|
void itemChanged(QTreeWidgetItem* item);
|
2012-07-04 10:08:55 +02:00
|
|
|
void copyFilter();
|
2012-06-24 23:46:32 +02:00
|
|
|
|
|
|
|
void subscriptionUpdated();
|
2014-02-14 10:38:43 +01:00
|
|
|
void subscriptionError(const QString &message);
|
2012-06-24 23:46:32 +02:00
|
|
|
|
|
|
|
private:
|
2013-02-26 10:42:48 +01:00
|
|
|
void adjustItemFeatures(QTreeWidgetItem* item, const AdBlockRule* rule);
|
2012-07-01 14:44:42 +02:00
|
|
|
void keyPressEvent(QKeyEvent* event);
|
2012-06-25 21:01:30 +02:00
|
|
|
|
2012-06-24 23:46:32 +02:00
|
|
|
AdBlockSubscription* m_subscription;
|
|
|
|
QTreeWidgetItem* m_topItem;
|
|
|
|
|
2012-07-01 18:13:49 +02:00
|
|
|
QString m_ruleToBeSelected;
|
2012-06-24 23:46:32 +02:00
|
|
|
bool m_itemChangingBlock;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // ADBLOCKTREEWIDGET_H
|