|
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 #include "qmessagesortorder.h" |
|
42 #include "qmessagesortorder_p.h" |
|
43 |
|
44 |
|
45 QTM_BEGIN_NAMESPACE |
|
46 |
|
47 /*! |
|
48 \class QMessageSortOrder |
|
49 |
|
50 \brief The QMessageSortOrder class defines the parameters used for sorting a subset of |
|
51 queried messages from the messaging store. |
|
52 \ingroup messaging |
|
53 |
|
54 A QMessageSortOrder is composed of a message property to sort and a sort order. |
|
55 The QMessageSortOrder class is used in conjunction with the QMessageManager::queryMessages() |
|
56 and QMessageService::queryMessages() functions to sort message results according to |
|
57 the criteria defined by the sort order. |
|
58 |
|
59 For example: |
|
60 To create a query for all messages sorted by their timestamp in decending order: |
|
61 \code |
|
62 QMessageSortOrder sortOrder(QMessageSortOrder::byTimeStamp(Qt::DescendingOrder)); |
|
63 QMessageIdList results = QMessageManager().queryMessages(QMessageFilter(), sortOrder); |
|
64 \endcode |
|
65 |
|
66 \sa QMessageManager, QMessageFilter |
|
67 */ |
|
68 |
|
69 /*! |
|
70 \fn QMessageSortOrder::QMessageSortOrder() |
|
71 |
|
72 Create a QMessageSortOrder with specifying matching parameters. |
|
73 |
|
74 A default-constructed sort order (one for which isEmpty() returns true) sorts no messages. |
|
75 |
|
76 The result of combining an empty sort order with a non-empty sort order is the same as the original |
|
77 non-empty sort order. |
|
78 |
|
79 The result of combining two empty sort orders is an empty sort order. |
|
80 |
|
81 Windows mobile and desktop platforms do not support sorting bySender() and byRecipients(), |
|
82 additionally the Windows mobile platform does not support sorting byTimeStamp() and bySize(). |
|
83 */ |
|
84 |
|
85 /*! |
|
86 \fn QMessageSortOrder::QMessageSortOrder(const QMessageSortOrder &other) |
|
87 |
|
88 Constructs a copy of \a other. |
|
89 */ |
|
90 |
|
91 /*! |
|
92 \fn QMessageSortOrder::~QMessageSortOrder() |
|
93 |
|
94 Destroys the sort order. |
|
95 */ |
|
96 |
|
97 /*! |
|
98 \internal |
|
99 \fn QMessageSortOrder::operator=(const QMessageSortOrder& other) |
|
100 */ |
|
101 |
|
102 /*! |
|
103 \fn QMessageSortOrder::isEmpty() const |
|
104 |
|
105 Returns true if the sort order remains empty after default construction; otherwise returns false. |
|
106 */ |
|
107 |
|
108 /*! |
|
109 \fn QMessageSortOrder::isSupported() const |
|
110 |
|
111 Returns true if the sort order is supported on the current platform; otherwise returns false. |
|
112 */ |
|
113 |
|
114 /*! |
|
115 \fn QMessageSortOrder::operator+(const QMessageSortOrder& other) const |
|
116 |
|
117 Returns a sort order that which is the result of concatenating the vaue of this sort order and the value |
|
118 of sort order \a other. |
|
119 |
|
120 This function determines sorting precedence. |
|
121 |
|
122 On the Windows Mobile platform bySubject() and byReceptionTimeStamp() sort orders can not |
|
123 be combined with each other. |
|
124 */ |
|
125 |
|
126 /*! |
|
127 \fn QMessageSortOrder::operator+=(const QMessageSortOrder& other) |
|
128 |
|
129 Appends the value of the sort order \a other with the value of this sort order and assigns the result |
|
130 to this sort order. |
|
131 |
|
132 This function determines sorting precedence. |
|
133 |
|
134 On the Windows Mobile platform bySubject() and byReceptionTimeStamp() sort orders can not |
|
135 be combined with each other. |
|
136 */ |
|
137 |
|
138 /*! |
|
139 \internal |
|
140 \fn QMessageSortOrder::operator==(const QMessageSortOrder& other) const |
|
141 */ |
|
142 |
|
143 /*! |
|
144 \internal |
|
145 */ |
|
146 bool QMessageSortOrder::operator!=(const QMessageSortOrder& other) const |
|
147 { |
|
148 return !operator==(other); |
|
149 } |
|
150 |
|
151 /*! |
|
152 \fn QMessageSortOrder::byType(Qt::SortOrder order) |
|
153 |
|
154 Returns a sort order that sorts messages by their message type, according to \a order. |
|
155 |
|
156 \sa QMessage::type() |
|
157 */ |
|
158 |
|
159 /*! |
|
160 \fn QMessageSortOrder::bySender(Qt::SortOrder order) |
|
161 |
|
162 Returns a sort order that sorts messages by the address from which they were sent, according to \a order. |
|
163 |
|
164 Not supported on the Windows mobile and desktop platforms. |
|
165 |
|
166 \sa QMessage::from() |
|
167 */ |
|
168 |
|
169 /*! |
|
170 \fn QMessageSortOrder::byRecipients(Qt::SortOrder order) |
|
171 |
|
172 Returns a sort order that sorts messages by the addresses to which they were sent, according to \a order. |
|
173 |
|
174 Not supported on the Windows mobile and desktop platforms. |
|
175 |
|
176 \sa QMessage::to() |
|
177 */ |
|
178 |
|
179 /*! |
|
180 \fn QMessageSortOrder::bySubject(Qt::SortOrder order) |
|
181 |
|
182 Returns a sort order that sorts messages by their subject, according to \a order. |
|
183 |
|
184 \sa QMessage::subject() |
|
185 */ |
|
186 |
|
187 /*! |
|
188 \fn QMessageSortOrder::byTimeStamp(Qt::SortOrder order) |
|
189 |
|
190 Returns a sort order that sorts messages by their origination timestamp, according to \a order. |
|
191 |
|
192 Not supported on the Windows mobile platform. |
|
193 |
|
194 \sa QMessage::date(), byReceptionTimeStamp() |
|
195 */ |
|
196 |
|
197 /*! |
|
198 \fn QMessageSortOrder::byReceptionTimeStamp(Qt::SortOrder order) |
|
199 |
|
200 Returns a sort order that sorts messages by their reception timestamp, according to \a order. |
|
201 |
|
202 \sa QMessage::receivedDate() |
|
203 */ |
|
204 |
|
205 /*! |
|
206 \fn QMessageSortOrder::byStatus(QMessage::Status flag, Qt::SortOrder order) |
|
207 |
|
208 Returns a sort order that sorts messages by their status value \a flag, according to \a order. |
|
209 |
|
210 \sa QMessage::status() |
|
211 */ |
|
212 |
|
213 /*! |
|
214 \fn QMessageSortOrder::byPriority(Qt::SortOrder order) |
|
215 |
|
216 Returns a sort order that sorts messages by their priority, according to \a order. |
|
217 |
|
218 \sa QMessage::priority() |
|
219 */ |
|
220 |
|
221 /*! |
|
222 \fn QMessageSortOrder::bySize(Qt::SortOrder order) |
|
223 |
|
224 Returns a sort order that sorts messages by their size, according to \a order. |
|
225 |
|
226 Not supported on the Windows mobile platform. |
|
227 |
|
228 \sa QMessage::size() |
|
229 */ |
|
230 |
|
231 QTM_END_NAMESPACE |