|
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 "qmessagestore.h" |
|
42 #include "qmessagestore_p.h" |
|
43 |
|
44 |
|
45 QTM_BEGIN_NAMESPACE |
|
46 |
|
47 class QMessageStorePrivatePlatform |
|
48 { |
|
49 public: |
|
50 QMessageStorePrivatePlatform(QMessageStorePrivate *d, QMessageStore *q) |
|
51 :d_ptr(d), q_ptr(q) {} |
|
52 QMessageStorePrivate *d_ptr; |
|
53 QMessageStore *q_ptr; |
|
54 //... |
|
55 }; |
|
56 |
|
57 QMessageStorePrivate::QMessageStorePrivate() |
|
58 :q_ptr(0), |
|
59 p_ptr(0) |
|
60 { |
|
61 } |
|
62 |
|
63 QMessageStorePrivate::~QMessageStorePrivate() |
|
64 { |
|
65 } |
|
66 |
|
67 void QMessageStorePrivate::initialize(QMessageStore *store) |
|
68 { |
|
69 q_ptr = store; |
|
70 p_ptr = new QMessageStorePrivatePlatform(this, store); |
|
71 } |
|
72 |
|
73 Q_GLOBAL_STATIC(QMessageStorePrivate,data); |
|
74 |
|
75 QMessageStore::QMessageStore(QObject *parent) |
|
76 : QObject(parent), |
|
77 d_ptr(data()) |
|
78 { |
|
79 Q_ASSERT(d_ptr != 0); |
|
80 Q_ASSERT(d_ptr->q_ptr == 0); // QMessageStore should be singleton |
|
81 d_ptr->initialize(this); |
|
82 } |
|
83 |
|
84 QMessageStore::~QMessageStore() |
|
85 { |
|
86 d_ptr = 0; // should be cleaned up by automatically |
|
87 } |
|
88 |
|
89 QMessageStore* QMessageStore::instance() |
|
90 { |
|
91 QMessageStorePrivate *d = data(); |
|
92 Q_ASSERT(d != 0); |
|
93 if (!d->q_ptr) |
|
94 d->initialize(new QMessageStore()); |
|
95 return d->q_ptr; |
|
96 } |
|
97 |
|
98 QMessageManager::Error QMessageStore::error() const |
|
99 { |
|
100 return QMessageManager::NotYetImplemented; |
|
101 } |
|
102 |
|
103 QMessageIdList QMessageStore::queryMessages(const QMessageFilter &filter, const QMessageSortOrder &sortOrder, uint limit, uint offset) const |
|
104 { |
|
105 Q_UNUSED(filter) |
|
106 Q_UNUSED(sortOrder) |
|
107 Q_UNUSED(limit) |
|
108 Q_UNUSED(offset) |
|
109 return QMessageIdList(); // stub |
|
110 } |
|
111 |
|
112 QMessageIdList QMessageStore::queryMessages(const QMessageFilter &filter, const QString &body, QMessageDataComparator::MatchFlags matchFlags, const QMessageSortOrder &sortOrder, uint limit, uint offset) const |
|
113 { |
|
114 Q_UNUSED(filter) |
|
115 Q_UNUSED(sortOrder) |
|
116 Q_UNUSED(body) |
|
117 Q_UNUSED(matchFlags) |
|
118 Q_UNUSED(limit) |
|
119 Q_UNUSED(offset) |
|
120 return QMessageIdList(); // stub |
|
121 } |
|
122 |
|
123 QMessageFolderIdList QMessageStore::queryFolders(const QMessageFolderFilter &filter, const QMessageFolderSortOrder &sortOrder, uint limit, uint offset) const |
|
124 { |
|
125 Q_UNUSED(filter) |
|
126 Q_UNUSED(sortOrder) |
|
127 Q_UNUSED(limit) |
|
128 Q_UNUSED(offset) |
|
129 return QMessageFolderIdList(); // stub |
|
130 } |
|
131 |
|
132 QMessageAccountIdList QMessageStore::queryAccounts(const QMessageAccountFilter &filter, const QMessageAccountSortOrder &sortOrder, uint limit, uint offset) const |
|
133 { |
|
134 Q_UNUSED(filter) |
|
135 Q_UNUSED(sortOrder) |
|
136 Q_UNUSED(limit) |
|
137 Q_UNUSED(offset) |
|
138 return QMessageAccountIdList(); // stub |
|
139 } |
|
140 |
|
141 int QMessageStore::countMessages(const QMessageFilter& filter) const |
|
142 { |
|
143 Q_UNUSED(filter) |
|
144 return 0; // stub |
|
145 } |
|
146 |
|
147 int QMessageStore::countFolders(const QMessageFolderFilter& filter) const |
|
148 { |
|
149 Q_UNUSED(filter) |
|
150 return 0; // stub |
|
151 } |
|
152 |
|
153 int QMessageStore::countAccounts(const QMessageAccountFilter& filter) const |
|
154 { |
|
155 Q_UNUSED(filter) |
|
156 return 0; // stub |
|
157 } |
|
158 |
|
159 bool QMessageStore::removeMessage(const QMessageId& id, QMessageManager::RemovalOption option) |
|
160 { |
|
161 Q_UNUSED(id) |
|
162 Q_UNUSED(option) |
|
163 return false; // stub |
|
164 } |
|
165 |
|
166 bool QMessageStore::removeMessages(const QMessageFilter& filter, QMessageManager::RemovalOption option) |
|
167 { |
|
168 Q_UNUSED(filter) |
|
169 Q_UNUSED(option) |
|
170 return true; // stub |
|
171 } |
|
172 |
|
173 bool QMessageStore::addMessage(QMessage *m) |
|
174 { |
|
175 Q_UNUSED(m) |
|
176 return true; // stub |
|
177 } |
|
178 |
|
179 bool QMessageStore::updateMessage(QMessage *m) |
|
180 { |
|
181 Q_UNUSED(m) |
|
182 return true; // stub |
|
183 } |
|
184 |
|
185 QMessage QMessageStore::message(const QMessageId& id) const |
|
186 { |
|
187 Q_UNUSED(id) |
|
188 return QMessage(); // stub |
|
189 } |
|
190 |
|
191 QMessageFolder QMessageStore::folder(const QMessageFolderId& id) const |
|
192 { |
|
193 Q_UNUSED(id) |
|
194 return QMessageFolder(); // stub |
|
195 } |
|
196 |
|
197 QMessageAccount QMessageStore::account(const QMessageAccountId& id) const |
|
198 { |
|
199 Q_UNUSED(id) |
|
200 return QMessageAccount(); // stub |
|
201 } |
|
202 |
|
203 QMessageManager::NotificationFilterId QMessageStore::registerNotificationFilter(const QMessageFilter &filter) |
|
204 { |
|
205 Q_UNUSED(filter) |
|
206 return 0; // stub |
|
207 } |
|
208 |
|
209 void QMessageStore::unregisterNotificationFilter(QMessageManager::NotificationFilterId notificationFilterId) |
|
210 { |
|
211 Q_UNUSED(notificationFilterId) |
|
212 } |
|
213 |
|
214 |
|
215 QTM_END_NAMESPACE |