2
Copyright (C) 2010 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.net,
3
Author Tobias Koenig <tokoe@kdab.com>
5
This library is free software; you can redistribute it and/or modify it
6
under the terms of the GNU Library General Public License as published by
7
the Free Software Foundation; either version 2 of the License, or (at your
8
option) any later version.
10
This library is distributed in the hope that it will be useful, but WITHOUT
11
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
13
License for more details.
15
You should have received a copy of the GNU Library General Public License
16
along with this library; see the file COPYING.LIB. If not, write to the
17
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
21
#ifndef MAILCOMMON_FILTERCONTROLLER_H
22
#define MAILCOMMON_FILTERCONTROLLER_H
24
#include "../mailcommon_export.h"
28
class QAbstractItemModel;
30
class QItemSelectionModel;
32
namespace MailCommon {
34
class MAILCOMMON_EXPORT FilterController : public QObject
38
Q_PROPERTY( QAction *addAction READ addAction )
39
Q_PROPERTY( QAction *editAction READ editAction )
40
Q_PROPERTY( QAction *removeAction READ removeAction )
41
Q_PROPERTY( QAction *moveUpAction READ moveUpAction )
42
Q_PROPERTY( QAction *moveDownAction READ moveDownAction )
46
* Creates a new filter controller.
48
* @param parent The parent object.
50
FilterController( QObject *parent = 0 );
53
* Destroys the filter controller.
58
* Returns the model that represents the list of filters.
60
QAbstractItemModel *model() const;
63
* Returns the item selection model, which is used for adapting
64
* the state of the actions.
66
QItemSelectionModel *selectionModel() const;
69
* Returns the action for adding a new filter.
71
QAction *addAction() const;
74
* Returns the action for editing the currently selected filter.
76
QAction *editAction() const;
79
* Returns the action for removing the currently selected filter.
81
QAction *removeAction() const;
84
* Returns the action for moving up the currently selected filter.
86
QAction *moveUpAction() const;
89
* Returns the action for moving down the currently selected filter.
91
QAction *moveDownAction() const;
98
Q_PRIVATE_SLOT( d, void selectionChanged() )
99
Q_PRIVATE_SLOT( d, void addFilter() )
100
Q_PRIVATE_SLOT( d, void editFilter() )
101
Q_PRIVATE_SLOT( d, void removeFilter() )
102
Q_PRIVATE_SLOT( d, void moveUpFilter() )
103
Q_PRIVATE_SLOT( d, void moveDownFilter() )