2
* This file is part of the KDE Baloo Project
3
* Copyright (C) 2013 Vishesh Handa <me@vhanda.in>
5
* This library is free software; you can redistribute it and/or
6
* modify it under the terms of the GNU Lesser General Public
7
* License as published by the Free Software Foundation; either
8
* version 2.1 of the License, or (at your option) version 3, or any
9
* later version accepted by the membership of KDE e.V. (or its
10
* successor approved by the membership of KDE e.V.), which shall
11
* act as a proxy defined in Section 6 of version 3 of the license.
13
* This library is distributed in the hope that it will be useful,
14
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16
* Lesser General Public License for more details.
18
* You should have received a copy of the GNU Lesser General Public
19
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
23
#ifndef _EMAIL_QUERY_H
24
#define _EMAIL_QUERY_H
26
#include "pim_export.h"
29
#include <QStringList>
35
class BALOO_PIM_EXPORT EmailQuery : public Query
39
virtual ~EmailQuery();
46
void setSearchType(OpType op);
48
void setInvolves(const QStringList& involves);
49
void addInvolves(const QString& email);
51
void setTo(const QStringList& to);
52
void addTo(const QString& to);
54
void setFrom(const QString& from);
55
void addFrom(const QString& from);
57
void setCc(const QStringList& cc);
58
void addCc(const QString& cc);
60
void setBcc(const QStringList& bcc);
61
void addBcc(const QString& bcc);
63
void setCollection(const QList<Akonadi::Collection::Id>& collections);
64
void addCollection(Akonadi::Collection::Id id);
67
* By default the importance is ignored
69
void setImportant(bool important = true);
72
* By default the read status is ignored
74
void setRead(bool read = true);
77
* By default the attachment status is ignored
79
void setAttachment(bool hasAttachment = true);
82
* Matches the string \p match anywhere in the entire email
85
void matches(const QString& match);
88
* Matches the string \p subjectMatch specifically in the
91
void subjectMatches(const QString& subjectMatch);
94
* Matches the string \p bodyMatch specifically in the body email
96
void bodyMatches(const QString& bodyMatch);
99
void setLimit(int limit);
103
* Execute the query and return an iterator to fetch
106
ResultIterator exec();
118
#endif // _EMAIL_QUERY_H