|
1 /**************************************************************************** |
|
2 ** |
|
3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). |
|
4 ** All rights reserved. |
|
5 ** Contact: Nokia Corporation (qt-info@nokia.com) |
|
6 ** |
|
7 ** This file is part of the Qt Mobility Components. |
|
8 ** |
|
9 ** $QT_BEGIN_LICENSE:LGPL$ |
|
10 ** No Commercial Usage |
|
11 ** This file contains pre-release code and may not be distributed. |
|
12 ** You may use this file in accordance with the terms and conditions |
|
13 ** contained in the Technology Preview License Agreement accompanying |
|
14 ** this package. |
|
15 ** |
|
16 ** GNU Lesser General Public License Usage |
|
17 ** Alternatively, this file may be used under the terms of the GNU Lesser |
|
18 ** General Public License version 2.1 as published by the Free Software |
|
19 ** Foundation and appearing in the file LICENSE.LGPL included in the |
|
20 ** packaging of this file. Please review the following information to |
|
21 ** ensure the GNU Lesser General Public License version 2.1 requirements |
|
22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. |
|
23 ** |
|
24 ** In addition, as a special exception, Nokia gives you certain additional |
|
25 ** rights. These rights are described in the Nokia Qt LGPL Exception |
|
26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. |
|
27 ** |
|
28 ** If you have questions regarding the use of this file, please contact |
|
29 ** Nokia at qt-info@nokia.com. |
|
30 ** |
|
31 ** |
|
32 ** |
|
33 ** |
|
34 ** |
|
35 ** |
|
36 ** |
|
37 ** |
|
38 ** $QT_END_LICENSE$ |
|
39 ** |
|
40 ****************************************************************************/ |
|
41 #ifndef QMESSAGEFILTER_H |
|
42 #define QMESSAGEFILTER_H |
|
43 |
|
44 #include <qmessageglobal.h> |
|
45 #include <qmessagedatacomparator.h> |
|
46 #include <qmessageid.h> |
|
47 #include <qmessageaccountid.h> |
|
48 #include <qmessagefolderid.h> |
|
49 #include <qmessageaccountfilter.h> |
|
50 #include <qmessagefolderfilter.h> |
|
51 #include <qmessage.h> |
|
52 |
|
53 QTM_BEGIN_NAMESPACE |
|
54 |
|
55 class QMessageFilterPrivate; |
|
56 |
|
57 class Q_MESSAGING_EXPORT QMessageFilter |
|
58 { |
|
59 friend class QMessageFilterPrivate; |
|
60 |
|
61 public: |
|
62 QMessageFilter(); |
|
63 QMessageFilter(const QMessageFilter &other); |
|
64 virtual ~QMessageFilter(); |
|
65 |
|
66 QMessageFilter& operator=(const QMessageFilter &other); |
|
67 |
|
68 void setMatchFlags(QMessageDataComparator::MatchFlags matchFlags); |
|
69 QMessageDataComparator::MatchFlags matchFlags() const; |
|
70 |
|
71 bool isEmpty() const; |
|
72 bool isSupported() const; |
|
73 |
|
74 QMessageFilter operator~() const; |
|
75 QMessageFilter operator&(const QMessageFilter &other) const; |
|
76 QMessageFilter operator|(const QMessageFilter &other) const; |
|
77 const QMessageFilter& operator&=(const QMessageFilter &other); |
|
78 const QMessageFilter& operator|=(const QMessageFilter &other); |
|
79 |
|
80 bool operator==(const QMessageFilter &other) const; |
|
81 bool operator!=(const QMessageFilter &other) const; |
|
82 |
|
83 static QMessageFilter byId(const QMessageId &id, QMessageDataComparator::EqualityComparator cmp = QMessageDataComparator::Equal); |
|
84 static QMessageFilter byId(const QMessageIdList &ids, QMessageDataComparator::InclusionComparator cmp = QMessageDataComparator::Includes); |
|
85 static QMessageFilter byId(const QMessageFilter &filter, QMessageDataComparator::InclusionComparator cmp = QMessageDataComparator::Includes); |
|
86 |
|
87 static QMessageFilter byType(QMessage::Type type, QMessageDataComparator::EqualityComparator cmp = QMessageDataComparator::Equal); |
|
88 static QMessageFilter byType(QMessage::TypeFlags type, QMessageDataComparator::InclusionComparator cmp); |
|
89 |
|
90 static QMessageFilter bySender(const QString &value, QMessageDataComparator::EqualityComparator cmp); |
|
91 static QMessageFilter bySender(const QString &value, QMessageDataComparator::InclusionComparator cmp = QMessageDataComparator::Includes); |
|
92 |
|
93 static QMessageFilter byRecipients(const QString &value, QMessageDataComparator::InclusionComparator cmp = QMessageDataComparator::Includes); |
|
94 |
|
95 static QMessageFilter bySubject(const QString &value, QMessageDataComparator::EqualityComparator cmp); |
|
96 static QMessageFilter bySubject(const QString &value, QMessageDataComparator::InclusionComparator cmp = QMessageDataComparator::Includes); |
|
97 |
|
98 static QMessageFilter byTimeStamp(const QDateTime &value, QMessageDataComparator::EqualityComparator cmp = QMessageDataComparator::Equal); |
|
99 static QMessageFilter byTimeStamp(const QDateTime &value, QMessageDataComparator::RelationComparator cmp); |
|
100 |
|
101 static QMessageFilter byReceptionTimeStamp(const QDateTime &value, QMessageDataComparator::EqualityComparator cmp = QMessageDataComparator::Equal); |
|
102 static QMessageFilter byReceptionTimeStamp(const QDateTime &value, QMessageDataComparator::RelationComparator cmp); |
|
103 |
|
104 static QMessageFilter byStatus(QMessage::Status value, QMessageDataComparator::EqualityComparator cmp); |
|
105 static QMessageFilter byStatus(QMessage::StatusFlags mask, QMessageDataComparator::InclusionComparator cmp = QMessageDataComparator::Includes); |
|
106 |
|
107 static QMessageFilter byPriority(QMessage::Priority priority, QMessageDataComparator::EqualityComparator cmp = QMessageDataComparator::Equal); |
|
108 |
|
109 static QMessageFilter bySize(int value, QMessageDataComparator::EqualityComparator cmp = QMessageDataComparator::Equal); |
|
110 static QMessageFilter bySize(int value, QMessageDataComparator::RelationComparator cmp); |
|
111 |
|
112 static QMessageFilter byParentAccountId(const QMessageAccountId &id, QMessageDataComparator::EqualityComparator cmp = QMessageDataComparator::Equal); |
|
113 static QMessageFilter byParentAccountId(const QMessageAccountFilter &filter, QMessageDataComparator::InclusionComparator cmp = QMessageDataComparator::Includes); |
|
114 |
|
115 static QMessageFilter byStandardFolder(QMessage::StandardFolder folder, QMessageDataComparator::EqualityComparator cmp = QMessageDataComparator::Equal); |
|
116 |
|
117 static QMessageFilter byParentFolderId(const QMessageFolderId &id, QMessageDataComparator::EqualityComparator cmp = QMessageDataComparator::Equal); |
|
118 static QMessageFilter byParentFolderId(const QMessageFolderFilter &filter, QMessageDataComparator::InclusionComparator cmp = QMessageDataComparator::Includes); |
|
119 |
|
120 static QMessageFilter byAncestorFolderIds(const QMessageFolderId &id, QMessageDataComparator::InclusionComparator cmp = QMessageDataComparator::Includes); |
|
121 static QMessageFilter byAncestorFolderIds(const QMessageFolderFilter &filter, QMessageDataComparator::InclusionComparator cmp = QMessageDataComparator::Includes); |
|
122 |
|
123 private: |
|
124 QMessageFilterPrivate *d_ptr; |
|
125 }; |
|
126 |
|
127 QTM_END_NAMESPACE |
|
128 #endif |