• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdepim API Reference
  • KDE Home
  • Contact Us
 

messagelist

  • sources
  • kde-4.12
  • kdepim
  • messagelist
  • core
filter.h
Go to the documentation of this file.
1 /******************************************************************************
2  *
3  * Copyright 2008 Szymon Tomasz Stefanek <pragma@kvirc.net>
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 2 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, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18  *
19  *******************************************************************************/
20 
21 #ifndef __MESSAGELIST_CORE_FILTER_H__
22 #define __MESSAGELIST_CORE_FILTER_H__
23 
24 #include <QtCore/QObject>
25 #include <QtCore/QSet>
26 #include <QtCore/QString>
27 
28 #include <Akonadi/KMime/MessageStatus>
29 #include <KUrl>
30 #include <Nepomuk2/Query/Query>
31 #include <Nepomuk2/Query/Result>
32 
33 namespace Nepomuk2 {
34  namespace Query {
35  class QueryServiceClient;
36  }
37 }
38 
39 namespace MessageList
40 {
41 
42 namespace Core
43 {
44 
45 class MessageItem;
46 
51 class Filter : public QObject
52 {
53  Q_OBJECT
54 
55 public:
56  Filter();
57 
58 public:
63  bool match( const MessageItem * item ) const;
64 
68  Akonadi::MessageStatus status() const
69  { return mStatus; }
70 
74  void setStatus( const Akonadi::MessageStatus &status )
75  { mStatus = status; }
76 
80  void setCurrentFolder( const KUrl &url );
81 
85  const QString & searchString() const
86  { return mSearchString; }
87 
91  void setSearchString( const QString &search );
92 
96  const QString & tagId() const
97  { return mTagId; }
98 
102  void setTagId( const QString &tagId )
103  { mTagId = tagId; }
104 
108  void clear();
109 
114  bool isEmpty() const;
115 
116 Q_SIGNALS:
117  void finished();
118 
119 private Q_SLOTS:
120  void newEntries( const QList<Nepomuk2::Query::Result>& );
121  void finishedListing();
122 
123 private:
124  bool containString(const QString& searchInString) const;
125  Akonadi::MessageStatus mStatus;
126  QString mSearchString;
127  QString mTagId;
128  QStringList mSearchList;
129  KUrl mCurrentFolder;
130  QSet<qint64> mMatchingItemIds;
131  Nepomuk2::Query::QueryServiceClient *mQueryClient;
132 };
133 
134 } // namespace Core
135 
136 } // namespace MessageList
137 
138 #endif
MessageList::Core::MessageItem
Definition: messageitem.h:50
MessageList::Core::Filter::finished
void finished()
MessageList::Core::Filter::setCurrentFolder
void setCurrentFolder(const KUrl &url)
Sets the current folder of this filter.
Definition: filter.cpp:119
QObject
MessageList::Core::Filter::Filter
Filter()
Definition: filter.cpp:38
MessageList::Core::Filter::searchString
const QString & searchString() const
Returns the currently set search string.
Definition: filter.h:85
MessageList::Core::Filter::isEmpty
bool isEmpty() const
Returns true if this filter is empty (0 status mask, empty search string and empty tag) and it's usel...
Definition: filter.cpp:95
MessageList::Core::Filter::setStatus
void setStatus(const Akonadi::MessageStatus &status)
Sets the status mask for this filter.
Definition: filter.h:74
MessageList::Core::Filter::clear
void clear()
Clears this filter (sets status to 0, search string and tag id to empty strings)
Definition: filter.cpp:109
MessageList::Core::Filter::tagId
const QString & tagId() const
Returns the currently set MessageItem::Tag id.
Definition: filter.h:96
MessageList::Core::Filter::match
bool match(const MessageItem *item) const
Returns true if the specified parameters match this filter and false otherwise.
Definition: filter.cpp:61
MessageList::Core::Filter::status
Akonadi::MessageStatus status() const
Returns the currently set status mask.
Definition: filter.h:68
MessageList::Core::Filter
This class is responsable of matching messages that should be displayed in the View.
Definition: filter.h:51
MessageList::Core::Filter::setTagId
void setTagId(const QString &tagId)
Sets the id of a MessageItem::Tag that the matching messages must contain.
Definition: filter.h:102
MessageList::Core::Filter::setSearchString
void setSearchString(const QString &search)
Sets the search string for this filter.
Definition: filter.cpp:124
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:55:32 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

messagelist

Skip menu "messagelist"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

kdepim API Reference

Skip menu "kdepim API Reference"
  • akonadi_next
  • akregator
  • blogilo
  • calendarsupport
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt2
  • kjots
  • kleopatra
  • kmail
  • knode
  • knotes
  • kontact
  • korgac
  • korganizer
  • ktimetracker
  • libkdepim
  • libkleo
  • libkpgp
  • mailcommon
  • messagelist
  • messageviewer

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal