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

« back to all changes in this revision

Viewing changes to messagelist/core/filter.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:
21
21
#ifndef __MESSAGELIST_CORE_FILTER_H__
22
22
#define __MESSAGELIST_CORE_FILTER_H__
23
23
 
24
 
#include <QString>
25
 
 
26
 
#include <akonadi/kmime/messagestatus.h>
 
24
#include <QtCore/QObject>
 
25
#include <QtCore/QSet>
 
26
#include <QtCore/QString>
 
27
 
 
28
#include <Akonadi/KMime/MessageStatus>
 
29
#include <KUrl>
 
30
#include <Nepomuk/Query/Query>
 
31
#include <Nepomuk/Query/Result>
 
32
 
 
33
namespace Nepomuk {
 
34
  namespace Query {
 
35
    class QueryServiceClient;
 
36
  }
 
37
}
27
38
 
28
39
namespace MessageList
29
40
{
37
48
 * This class is responsable of matching messages that should be displayed
38
49
 * in the View. It's used mainly by Model and Widget.
39
50
 */
40
 
class Filter
 
51
class Filter : public QObject
41
52
{
 
53
  Q_OBJECT
 
54
 
42
55
public:
43
56
  Filter();
44
57
 
66
79
   { mStatus = status; };
67
80
 
68
81
  /**
 
82
   * Sets the current folder of this filter.
 
83
   */
 
84
  void setCurrentFolder( const KUrl &url );
 
85
 
 
86
  /**
69
87
   * Returns the currently set search string.
70
88
   */
71
89
  const QString & searchString() const
74
92
  /**
75
93
   * Sets the search string for this filter.
76
94
   */
77
 
  void setSearchString( const QString &search )
78
 
   { mSearchString = search; };
 
95
  void setSearchString( const QString &search );
79
96
 
80
97
  /**
81
98
   * Returns the currently set MessageItem::Tag id
99
116
   * and it's useless to call match() that will always return true.
100
117
   */
101
118
  bool isEmpty() const;
 
119
 
 
120
Q_SIGNALS:
 
121
  void finished();
 
122
 
 
123
private Q_SLOTS:
 
124
  void newEntries( const QList<Nepomuk::Query::Result>& );
 
125
  void finishedListing();
 
126
 
 
127
private:
 
128
  bool containString(const QString& searchInString) const;
 
129
  QStringList mSearchList;
 
130
  KUrl mCurrentFolder;
 
131
  QSet<qint64> mMatchingItemIds;
 
132
  Nepomuk::Query::QueryServiceClient *mQueryClient;
102
133
};
103
134
 
104
135
} // namespace Core