~ubuntu-branches/ubuntu/raring/kdepim/raring-proposed

« back to all changes in this revision

Viewing changes to mailcommon/filter/filtercontroller.h

  • Committer: Package Import Robot
  • Author(s): Jonathan Riddell
  • Date: 2012-06-07 07:56:38 UTC
  • mfrom: (0.2.27)
  • Revision ID: package-import@ubuntu.com-20120607075638-0luhdq11z7sgvs4m
Tags: 4:4.8.80-0ubuntu1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
  Copyright (C) 2010 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.net,
 
3
    Author Tobias Koenig <tokoe@kdab.com>
 
4
 
 
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.
 
9
 
 
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.
 
14
 
 
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
 
18
  02110-1301, USA.
 
19
*/
 
20
 
 
21
#ifndef MAILCOMMON_FILTERCONTROLLER_H
 
22
#define MAILCOMMON_FILTERCONTROLLER_H
 
23
 
 
24
#include "../mailcommon_export.h"
 
25
 
 
26
#include <QObject>
 
27
 
 
28
class QAbstractItemModel;
 
29
class QAction;
 
30
class QItemSelectionModel;
 
31
 
 
32
namespace MailCommon {
 
33
 
 
34
class MAILCOMMON_EXPORT FilterController : public QObject
 
35
{
 
36
  Q_OBJECT
 
37
 
 
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 )
 
43
 
 
44
  public:
 
45
    /**
 
46
     * Creates a new filter controller.
 
47
     *
 
48
     * @param parent The parent object.
 
49
     */
 
50
    FilterController( QObject *parent = 0 );
 
51
 
 
52
    /**
 
53
     * Destroys the filter controller.
 
54
     */
 
55
    ~FilterController();
 
56
 
 
57
    /**
 
58
     * Returns the model that represents the list of filters.
 
59
     */
 
60
    QAbstractItemModel *model() const;
 
61
 
 
62
    /**
 
63
     * Returns the item selection model, which is used for adapting
 
64
     * the state of the actions.
 
65
     */
 
66
    QItemSelectionModel *selectionModel() const;
 
67
 
 
68
    /**
 
69
     * Returns the action for adding a new filter.
 
70
     */
 
71
    QAction *addAction() const;
 
72
 
 
73
    /**
 
74
     * Returns the action for editing the currently selected filter.
 
75
     */
 
76
    QAction *editAction() const;
 
77
 
 
78
    /**
 
79
     * Returns the action for removing the currently selected filter.
 
80
     */
 
81
    QAction *removeAction() const;
 
82
 
 
83
    /**
 
84
     * Returns the action for moving up the currently selected filter.
 
85
     */
 
86
    QAction *moveUpAction() const;
 
87
 
 
88
    /**
 
89
     * Returns the action for moving down the currently selected filter.
 
90
     */
 
91
    QAction *moveDownAction() const;
 
92
 
 
93
  private:
 
94
    //@cond PRIVATE
 
95
    class Private;
 
96
    Private *const d;
 
97
 
 
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() )
 
104
    //@endcond
 
105
};
 
106
 
 
107
}
 
108
 
 
109
#endif