Skip to content
This repository has been archived by the owner on Sep 4, 2021. It is now read-only.

Latest commit

 

History

History
502 lines (408 loc) · 19.2 KB

seasidecache.h

File metadata and controls

502 lines (408 loc) · 19.2 KB
 
Jul 16, 2013
Jul 16, 2013
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/*
* Copyright (C) 2013 Jolla Mobile <andrew.den.exter@jollamobile.com>
*
* You may use this file under the terms of the BSD license as follows:
*
* "Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Nemo Mobile nor the names of its contributors
* may be used to endorse or promote products derived from this
* software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
*/
#ifndef SEASIDECACHE_H
#define SEASIDECACHE_H
#include "contactcacheexport.h"
May 27, 2014
May 27, 2014
36
#include "cacheconfiguration.h"
Jul 16, 2013
Jul 16, 2013
37
38
#include <qtcontacts-extensions.h>
Jul 30, 2013
Jul 30, 2013
39
#include <QContactStatusFlags>
Jul 16, 2013
Jul 16, 2013
40
41
42
43
44
45
46
47
48
49
50
51
#include <QContact>
#include <QContactManager>
#include <QContactFetchRequest>
#include <QContactFetchByIdRequest>
#include <QContactRemoveRequest>
#include <QContactSaveRequest>
#include <QContactRelationshipFetchRequest>
#include <QContactRelationshipSaveRequest>
#include <QContactRelationshipRemoveRequest>
#include <QContactIdFilter>
#include <QContactIdFetchRequest>
Oct 30, 2015
Oct 30, 2015
52
#include <QContactName>
Jul 16, 2013
Jul 16, 2013
53
Oct 10, 2016
Oct 10, 2016
54
#include <QTranslator>
Jul 16, 2013
Jul 16, 2013
55
#include <QBasicTimer>
Feb 12, 2015
Feb 12, 2015
56
#include <QHash>
Jul 16, 2013
Jul 16, 2013
57
58
59
60
61
#include <QSet>
#include <QElapsedTimer>
#include <QAbstractListModel>
Aug 6, 2013
Aug 6, 2013
62
63
QTCONTACTS_USE_NAMESPACE
Mar 8, 2019
Mar 8, 2019
64
class CONTACTCACHE_EXPORT SeasideDisplayLabelGroupChangeListener
Jul 16, 2013
Jul 16, 2013
65
66
{
public:
Mar 8, 2019
Mar 8, 2019
67
68
SeasideDisplayLabelGroupChangeListener() {}
~SeasideDisplayLabelGroupChangeListener() {}
Jul 16, 2013
Jul 16, 2013
69
Mar 8, 2019
Mar 8, 2019
70
virtual void displayLabelGroupsUpdated(const QHash<QString, QSet<quint32> > &groups) = 0;
Jul 16, 2013
Jul 16, 2013
71
72
73
74
75
76
77
78
79
80
81
82
83
84
};
class CONTACTCACHE_EXPORT SeasideCache : public QObject
{
Q_OBJECT
public:
enum FilterType {
FilterNone,
FilterAll,
FilterFavorites,
FilterOnline,
FilterTypesCount
};
Aug 5, 2013
Aug 5, 2013
85
86
87
88
enum FetchDataType {
FetchNone = 0,
FetchAccountUri = (1 << 0),
FetchPhoneNumber = (1 << 1),
Jan 9, 2014
Jan 9, 2014
89
FetchEmailAddress = (1 << 2),
Jan 9, 2014
Jan 9, 2014
90
91
92
93
94
FetchOrganization = (1 << 3),
FetchTypesMask = (FetchAccountUri |
FetchPhoneNumber |
FetchEmailAddress |
FetchOrganization)
Aug 5, 2013
Aug 5, 2013
95
96
};
Jul 16, 2013
Jul 16, 2013
97
enum DisplayLabelOrder {
May 27, 2014
May 27, 2014
98
99
FirstNameFirst = CacheConfiguration::FirstNameFirst,
LastNameFirst = CacheConfiguration::LastNameFirst
Jul 16, 2013
Jul 16, 2013
100
101
102
103
};
enum ContactState {
ContactAbsent,
Aug 5, 2013
Aug 5, 2013
104
ContactPartial,
Jul 16, 2013
Jul 16, 2013
105
ContactRequested,
Aug 5, 2013
Aug 5, 2013
106
ContactComplete
Jul 16, 2013
Jul 16, 2013
107
108
};
Dec 6, 2013
Dec 6, 2013
109
110
111
112
113
enum {
// Must be after the highest bit used in QContactStatusFlags::Flag
HasValidOnlineAccount = (QContactStatusFlags::IsOnline << 1)
};
Jul 16, 2013
Jul 16, 2013
114
115
116
117
118
119
struct ItemData
{
virtual ~ItemData() {}
virtual void displayLabelOrderChanged(DisplayLabelOrder order) = 0;
Aug 5, 2013
Aug 5, 2013
120
virtual void updateContact(const QContact &newContact, QContact *oldContact, ContactState state) = 0;
Jul 16, 2013
Jul 16, 2013
121
122
123
124
125
126
127
128
virtual void constituentsFetched(const QList<int> &ids) = 0;
virtual void mergeCandidatesFetched(const QList<int> &ids) = 0;
virtual void aggregationOperationCompleted() = 0;
virtual QList<int> constituents() const = 0;
};
Aug 9, 2013
Aug 9, 2013
129
130
struct CacheItem;
struct ItemListener
Jul 16, 2013
Jul 16, 2013
131
{
Aug 9, 2013
Aug 9, 2013
132
133
ItemListener() : next(0), key(0) {}
virtual ~ItemListener() {}
Jul 16, 2013
Jul 16, 2013
134
Aug 9, 2013
Aug 9, 2013
135
136
137
138
139
virtual void itemUpdated(CacheItem *item) = 0;
virtual void itemAboutToBeRemoved(CacheItem *item) = 0;
ItemListener *next;
void *key;
Jul 16, 2013
Jul 16, 2013
140
141
142
143
};
struct CacheItem
{
Aug 4, 2015
Aug 4, 2015
144
CacheItem() : itemData(0), iid(0), statusFlags(0), contactState(ContactAbsent), listeners(0) {}
Jul 30, 2013
Jul 30, 2013
145
CacheItem(const QContact &contact)
Aug 9, 2013
Aug 9, 2013
146
147
: contact(contact), itemData(0), iid(internalId(contact)),
statusFlags(contact.detail<QContactStatusFlags>().flagsValue()), contactState(ContactAbsent), listeners(0) {}
Jul 16, 2013
Jul 16, 2013
148
Jan 28, 2014
Jan 28, 2014
149
QContactId apiId() const { return SeasideCache::apiId(contact); }
Jul 16, 2013
Jul 16, 2013
150
Aug 9, 2013
Aug 9, 2013
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
ItemListener *appendListener(ItemListener *listener, void *key)
{
if (listeners) {
ItemListener *existing(listeners);
while (existing->next) {
existing = existing->next;
}
existing->next = listener;
} else {
listeners = listener;
}
listener->next = 0;
listener->key = key;
return listener;
}
Aug 13, 2013
Aug 13, 2013
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
bool removeListener(ItemListener *listener)
{
if (listeners) {
ItemListener *existing(listeners);
ItemListener **previous = &listeners;
while (existing) {
if (existing == listener) {
*previous = listener->next;
return true;
}
previous = &existing->next;
existing = existing->next;
}
}
return false;
}
Aug 9, 2013
Aug 9, 2013
187
188
ItemListener *listener(void *key)
{
Aug 13, 2013
Aug 13, 2013
189
190
191
ItemListener *existing(listeners);
while (existing && (existing->key != key) && (existing->next)) {
existing = existing->next;
Aug 9, 2013
Aug 9, 2013
192
}
Aug 13, 2013
Aug 13, 2013
193
return (existing && (existing->key == key)) ? existing : 0;
Aug 9, 2013
Aug 9, 2013
194
195
}
Jul 16, 2013
Jul 16, 2013
196
197
QContact contact;
ItemData *itemData;
Jul 29, 2013
Jul 29, 2013
198
quint32 iid;
Jul 30, 2013
Jul 30, 2013
199
quint64 statusFlags;
Jul 16, 2013
Jul 16, 2013
200
ContactState contactState;
Aug 9, 2013
Aug 9, 2013
201
ItemListener *listeners;
Mar 8, 2019
Mar 8, 2019
202
QString displayLabelGroup;
Aug 19, 2013
Aug 19, 2013
203
QString displayLabel;
Jul 16, 2013
Jul 16, 2013
204
205
206
207
};
struct ContactLinkRequest
{
Jan 28, 2014
Jan 28, 2014
208
ContactLinkRequest(const QContactId &id) : contactId(id), constituentsFetched(false) {}
Jul 16, 2013
Jul 16, 2013
209
210
ContactLinkRequest(const ContactLinkRequest &req) : contactId(req.contactId), constituentsFetched(req.constituentsFetched) {}
Jan 28, 2014
Jan 28, 2014
211
QContactId contactId;
Jul 16, 2013
Jul 16, 2013
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
bool constituentsFetched;
};
class ListModel : public QAbstractListModel
{
public:
ListModel(QObject *parent = 0) : QAbstractListModel(parent) {}
virtual ~ListModel() {}
virtual void sourceAboutToRemoveItems(int begin, int end) = 0;
virtual void sourceItemsRemoved() = 0;
virtual void sourceAboutToInsertItems(int begin, int end) = 0;
virtual void sourceItemsInserted(int begin, int end) = 0;
virtual void sourceDataChanged(int begin, int end) = 0;
Aug 16, 2013
Aug 16, 2013
229
230
virtual void sourceItemsChanged() = 0;
Jul 16, 2013
Jul 16, 2013
231
232
virtual void makePopulated() = 0;
virtual void updateDisplayLabelOrder() = 0;
Aug 29, 2013
Aug 29, 2013
233
virtual void updateSortProperty() = 0;
Aug 30, 2013
Aug 30, 2013
234
virtual void updateGroupProperty() = 0;
Apr 30, 2019
Apr 30, 2019
235
236
virtual void updateSectionBucketIndexCache() = 0;
Jul 16, 2013
Jul 16, 2013
237
238
};
Aug 5, 2013
Aug 5, 2013
239
240
241
242
struct ResolveListener
{
virtual ~ResolveListener() {}
Aug 6, 2013
Aug 6, 2013
243
244
245
246
247
248
249
250
251
virtual void addressResolved(const QString &first, const QString &second, CacheItem *item) = 0;
};
struct ChangeListener
{
virtual ~ChangeListener() {}
virtual void itemUpdated(CacheItem *item) = 0;
virtual void itemAboutToBeRemoved(CacheItem *item) = 0;
Aug 5, 2013
Aug 5, 2013
252
253
};
Jul 16, 2013
Jul 16, 2013
254
static SeasideCache *instance();
Oct 21, 2013
Oct 21, 2013
255
static QContactManager *manager();
Jul 16, 2013
Jul 16, 2013
256
Jan 28, 2014
Jan 28, 2014
257
258
static QContactId apiId(const QContact &contact);
static QContactId apiId(quint32 iid);
Jul 16, 2013
Jul 16, 2013
259
Jan 28, 2014
Jan 28, 2014
260
static bool validId(const QContactId &id);
Jul 16, 2013
Jul 16, 2013
261
262
263
264
static quint32 internalId(const QContact &contact);
static quint32 internalId(const QContactId &id);
Jan 9, 2014
Jan 9, 2014
265
static void registerModel(ListModel *model, FilterType type, FetchDataType requiredTypes = FetchNone, FetchDataType extraTypes = FetchNone);
Jul 16, 2013
Jul 16, 2013
266
267
268
269
270
static void unregisterModel(ListModel *model);
static void registerUser(QObject *user);
static void unregisterUser(QObject *user);
Mar 8, 2019
Mar 8, 2019
271
272
static void registerDisplayLabelGroupChangeListener(SeasideDisplayLabelGroupChangeListener *listener);
static void unregisterDisplayLabelGroupChangeListener(SeasideDisplayLabelGroupChangeListener *listener);
Jul 16, 2013
Jul 16, 2013
273
Aug 6, 2013
Aug 6, 2013
274
275
276
277
278
static void registerChangeListener(ChangeListener *listener);
static void unregisterChangeListener(ChangeListener *listener);
static void unregisterResolveListener(ResolveListener *listener);
Jul 16, 2013
Jul 16, 2013
279
static DisplayLabelOrder displayLabelOrder();
Aug 29, 2013
Aug 29, 2013
280
static QString sortProperty();
Aug 30, 2013
Aug 30, 2013
281
static QString groupProperty();
Jul 16, 2013
Jul 16, 2013
282
283
284
static int contactId(const QContact &contact);
Jan 28, 2014
Jan 28, 2014
285
static CacheItem *existingItem(const QContactId &id);
Jul 29, 2013
Jul 29, 2013
286
static CacheItem *existingItem(quint32 iid);
Jan 28, 2014
Jan 28, 2014
287
static CacheItem *itemById(const QContactId &id, bool requireComplete = true);
Aug 5, 2013
Aug 5, 2013
288
static CacheItem *itemById(int id, bool requireComplete = true);
Jan 28, 2014
Jan 28, 2014
289
290
static QContactId selfContactId();
static QContact contactById(const QContactId &id);
Aug 5, 2013
Aug 5, 2013
291
292
static void ensureCompletion(CacheItem *cacheItem);
Aug 19, 2013
Aug 19, 2013
293
static void refreshContact(CacheItem *cacheItem);
Aug 5, 2013
Aug 5, 2013
294
Mar 8, 2019
Mar 8, 2019
295
296
297
static QString displayLabelGroup(const CacheItem *cacheItem);
static QStringList allDisplayLabelGroups();
static QHash<QString, QSet<quint32> > displayLabelGroupMembers();
Jul 16, 2013
Jul 16, 2013
298
Aug 5, 2013
Aug 5, 2013
299
300
301
302
303
304
305
306
static CacheItem *itemByPhoneNumber(const QString &number, bool requireComplete = true);
static CacheItem *itemByEmailAddress(const QString &address, bool requireComplete = true);
static CacheItem *itemByOnlineAccount(const QString &localUid, const QString &remoteUid, bool requireComplete = true);
static CacheItem *resolvePhoneNumber(ResolveListener *listener, const QString &number, bool requireComplete = true);
static CacheItem *resolveEmailAddress(ResolveListener *listener, const QString &address, bool requireComplete = true);
static CacheItem *resolveOnlineAccount(ResolveListener *listener, const QString &localUid, const QString &remoteUid, bool requireComplete = true);
Jul 16, 2013
Jul 16, 2013
307
static bool saveContact(const QContact &contact);
Jul 19, 2013
Jul 19, 2013
308
static bool removeContact(const QContact &contact);
Jul 16, 2013
Jul 16, 2013
309
310
311
312
static void aggregateContacts(const QContact &contact1, const QContact &contact2);
static void disaggregateContacts(const QContact &contact1, const QContact &contact2);
Jul 19, 2013
Jul 19, 2013
313
314
static bool fetchConstituents(const QContact &contact);
static bool fetchMergeCandidates(const QContact &contact);
Jul 16, 2013
Jul 16, 2013
315
316
317
318
static int importContacts(const QString &path);
static QString exportContacts();
Sep 20, 2013
Sep 20, 2013
319
static const QList<quint32> *contacts(FilterType filterType);
Jul 16, 2013
Jul 16, 2013
320
321
static bool isPopulated(FilterType filterType);
Mar 5, 2015
Mar 5, 2015
322
323
324
static QString primaryName(const QString &firstName, const QString &lastName);
static QString secondaryName(const QString &firstName, const QString &lastName);
Oct 30, 2015
Oct 30, 2015
325
static void decomposeDisplayLabel(const QString &formattedDisplayLabel, QContactName *nameDetail);
Jul 16, 2013
Jul 16, 2013
326
327
static QString generateDisplayLabel(const QContact &contact, DisplayLabelOrder order = FirstNameFirst);
static QString generateDisplayLabelFromNonNameDetails(const QContact &contact);
Sep 19, 2013
Sep 19, 2013
328
static QUrl filteredAvatarUrl(const QContact &contact, const QStringList &metadataFragments = QStringList());
Jul 16, 2013
Jul 16, 2013
329
Feb 10, 2014
Feb 10, 2014
330
331
static QString normalizePhoneNumber(const QString &input, bool validate = false);
static QString minimizePhoneNumber(const QString &input, bool validate = false);
Aug 20, 2013
Aug 20, 2013
332
Jul 16, 2013
Jul 16, 2013
333
334
335
bool event(QEvent *event);
// For synchronizeLists()
Sep 20, 2013
Sep 20, 2013
336
int insertRange(int index, int count, const QList<quint32> &source, int sourceIndex) { return insertRange(m_syncFilter, index, count, source, sourceIndex); }
Aug 5, 2013
Aug 5, 2013
337
int removeRange(int index, int count) { removeRange(m_syncFilter, index, count); return 0; }
Jul 16, 2013
Jul 16, 2013
338
339
340
protected:
void timerEvent(QTimerEvent *event);
Aug 29, 2013
Aug 29, 2013
341
void setSortOrder(const QString &property);
Jan 9, 2014
Jan 9, 2014
342
void startRequest(bool *idleProcessing);
Jul 16, 2013
Jul 16, 2013
343
344
345
346
347
348
private slots:
void contactsAvailable();
void contactIdsAvailable();
void relationshipsAvailable();
void requestStateChanged(QContactAbstractRequest::State state);
Oct 17, 2014
Oct 17, 2014
349
void addressRequestStateChanged(QContactAbstractRequest::State state);
Apr 17, 2019
Apr 17, 2019
350
void dataChanged();
Jul 16, 2013
Jul 16, 2013
351
352
void contactsAdded(const QList<QContactId> &contactIds);
void contactsChanged(const QList<QContactId> &contactIds);
Dec 10, 2013
Dec 10, 2013
353
void contactsPresenceChanged(const QList<QContactId> &contactIds);
Jul 16, 2013
Jul 16, 2013
354
void contactsRemoved(const QList<QContactId> &contactIds);
Mar 8, 2019
Mar 8, 2019
355
void displayLabelGroupsChanged(const QStringList &groups);
May 27, 2014
May 27, 2014
356
357
void displayLabelOrderChanged(CacheConfiguration::DisplayLabelOrder order);
void sortPropertyChanged(const QString &sortProperty);
Dec 10, 2013
Dec 10, 2013
358
void displayStatusChanged(const QString &);
Jul 16, 2013
Jul 16, 2013
359
360
private:
Aug 5, 2013
Aug 5, 2013
361
362
363
364
365
enum PopulateProgress {
Unpopulated,
FetchFavorites,
FetchMetadata,
FetchOnline,
Jan 9, 2014
Jan 9, 2014
366
Populated
Aug 5, 2013
Aug 5, 2013
367
368
};
Jul 16, 2013
Jul 16, 2013
369
370
371
372
373
SeasideCache();
~SeasideCache();
static void checkForExpiry();
Jan 9, 2014
Jan 9, 2014
374
void keepPopulated(quint32 requiredTypes, quint32 extraTypes);
Jul 16, 2013
Jul 16, 2013
375
376
void requestUpdate();
Jan 28, 2014
Jan 28, 2014
377
void appendContacts(const QList<QContact> &contacts, FilterType filterType, bool partialFetch, const QSet<QContactDetail::DetailType> &queryDetailTypes);
Jul 16, 2013
Jul 16, 2013
378
void fetchContacts();
Jan 28, 2014
Jan 28, 2014
379
void updateContacts(const QList<QContactId> &contactIds, QList<QContactId> *updateList);
Dec 9, 2013
Dec 9, 2013
380
void applyPendingContactUpdates();
Oct 17, 2014
Oct 17, 2014
381
void applyContactUpdates(const QList<QContact> &contacts, const QSet<QContactDetail::DetailType> &queryDetailTypes);
Apr 30, 2019
Apr 30, 2019
382
void updateSectionBucketIndexCaches();
Jul 16, 2013
Jul 16, 2013
383
Aug 30, 2013
Aug 30, 2013
384
void resolveUnknownAddresses(const QString &first, const QString &second, CacheItem *item);
Jan 28, 2014
Jan 28, 2014
385
bool updateContactIndexing(const QContact &oldContact, const QContact &contact, quint32 iid, const QSet<QContactDetail::DetailType> &queryDetailTypes, CacheItem *item);
Dec 9, 2013
Dec 9, 2013
386
void updateCache(CacheItem *item, const QContact &contact, bool partialFetch, bool initialInsert);
Aug 29, 2013
Aug 29, 2013
387
void reportItemUpdated(CacheItem *item);
Aug 5, 2013
Aug 5, 2013
388
Jul 16, 2013
Jul 16, 2013
389
void removeRange(FilterType filter, int index, int count);
Sep 20, 2013
Sep 20, 2013
390
int insertRange(FilterType filter, int index, int count, const QList<quint32> &queryIds, int queryIndex);
Jul 16, 2013
Jul 16, 2013
391
Sep 20, 2013
Sep 20, 2013
392
393
394
void contactDataChanged(quint32 iid);
void contactDataChanged(quint32 iid, FilterType filter);
void removeContactData(quint32 iid, FilterType filter);
Jul 16, 2013
Jul 16, 2013
395
396
void makePopulated(FilterType filter);
Mar 8, 2019
Mar 8, 2019
397
398
399
void addToContactDisplayLabelGroup(quint32 iid, const QString &group, QSet<QString> *modifiedGroups = 0);
void removeFromContactDisplayLabelGroup(quint32 iid, const QString &group, QSet<QString> *modifiedGroups = 0);
void notifyDisplayLabelGroupsChanged(const QSet<QString> &groups);
Jul 16, 2013
Jul 16, 2013
400
Jan 28, 2014
Jan 28, 2014
401
402
void updateConstituentAggregations(const QContactId &contactId);
void completeContactAggregation(const QContactId &contact1Id, const QContactId &contact2Id);
Jul 16, 2013
Jul 16, 2013
403
Aug 5, 2013
Aug 5, 2013
404
405
void resolveAddress(ResolveListener *listener, const QString &first, const QString &second, bool requireComplete);
Oct 24, 2013
Oct 24, 2013
406
407
CacheItem *itemMatchingPhoneNumber(const QString &number, const QString &normalized, bool requireComplete);
Sep 20, 2013
Sep 20, 2013
408
409
int contactIndex(quint32 iid, FilterType filter);
Jul 31, 2014
Jul 31, 2014
410
static QContactRelationship makeRelationship(const QString &type, const QContactId &id1, const QContactId &id2);
Jul 16, 2013
Jul 16, 2013
411
412
static QContactRelationship makeRelationship(const QString &type, const QContact &contact1, const QContact &contact2);
Sep 20, 2013
Sep 20, 2013
413
414
QList<quint32> m_contacts[FilterTypesCount];
Jul 16, 2013
Jul 16, 2013
415
416
417
QBasicTimer m_expiryTimer;
QBasicTimer m_fetchTimer;
QHash<quint32, CacheItem> m_people;
Oct 24, 2013
Oct 24, 2013
418
QMultiHash<QString, quint32> m_phoneNumberIds;
Jul 16, 2013
Jul 16, 2013
419
QHash<QString, quint32> m_emailAddressIds;
Aug 5, 2013
Aug 5, 2013
420
QHash<QPair<QString, QString>, quint32> m_onlineAccountIds;
Jan 28, 2014
Jan 28, 2014
421
QHash<QContactId, QContact> m_contactsToSave;
Mar 8, 2019
Mar 8, 2019
422
QHash<QString, QSet<quint32> > m_contactDisplayLabelGroups;
Jul 16, 2013
Jul 16, 2013
423
QList<QContact> m_contactsToCreate;
Jan 28, 2014
Jan 28, 2014
424
425
426
427
428
429
QHash<FilterType, QPair<QSet<QContactDetail::DetailType>, QList<QContact> > > m_contactsToAppend;
QList<QPair<QSet<QContactDetail::DetailType>, QList<QContact> > > m_contactsToUpdate;
QList<QContactId> m_contactsToRemove;
QList<QContactId> m_changedContacts;
QList<QContactId> m_presenceChangedContacts;
QSet<QContactId> m_aggregatedContacts;
Jul 16, 2013
Jul 16, 2013
430
431
QList<QContactId> m_contactsToFetchConstituents;
QList<QContactId> m_contactsToFetchCandidates;
Sep 9, 2013
Sep 9, 2013
432
QList<QContactId> m_contactsToLinkTo;
Jul 16, 2013
Jul 16, 2013
433
434
435
QList<QPair<ContactLinkRequest, ContactLinkRequest> > m_contactPairsToLink;
QList<QContactRelationship> m_relationshipsToSave;
QList<QContactRelationship> m_relationshipsToRemove;
Mar 8, 2019
Mar 8, 2019
436
QList<SeasideDisplayLabelGroupChangeListener*> m_displayLabelGroupChangeListeners;
Aug 6, 2013
Aug 6, 2013
437
QList<ChangeListener*> m_changeListeners;
Jul 16, 2013
Jul 16, 2013
438
439
QList<ListModel *> m_models[FilterTypesCount];
QSet<QObject *> m_users;
Jan 28, 2014
Jan 28, 2014
440
QHash<QContactId,int> m_expiredContacts;
Jul 16, 2013
Jul 16, 2013
441
442
443
444
445
446
447
448
QContactFetchRequest m_fetchRequest;
QContactFetchByIdRequest m_fetchByIdRequest;
QContactIdFetchRequest m_contactIdRequest;
QContactRelationshipFetchRequest m_relationshipsFetchRequest;
QContactRemoveRequest m_removeRequest;
QContactSaveRequest m_saveRequest;
QContactRelationshipSaveRequest m_relationshipSaveRequest;
QContactRelationshipRemoveRequest m_relationshipRemoveRequest;
Aug 22, 2013
Aug 22, 2013
449
450
QList<QContactSortOrder> m_sortOrder;
QList<QContactSortOrder> m_onlineSortOrder;
Oct 21, 2013
Oct 21, 2013
451
FilterType m_syncFilter;
Jul 16, 2013
Jul 16, 2013
452
453
454
int m_populated;
int m_cacheIndex;
int m_queryIndex;
Sep 19, 2013
Sep 19, 2013
455
456
int m_fetchProcessedCount;
int m_fetchByIdProcessedCount;
Jul 16, 2013
Jul 16, 2013
457
DisplayLabelOrder m_displayLabelOrder;
Aug 29, 2013
Aug 29, 2013
458
QString m_sortProperty;
Aug 30, 2013
Aug 30, 2013
459
QString m_groupProperty;
Jul 16, 2013
Jul 16, 2013
460
bool m_keepPopulated;
Aug 5, 2013
Aug 5, 2013
461
PopulateProgress m_populateProgress;
Oct 15, 2014
Oct 15, 2014
462
bool m_populating; // true if current m_fetchRequest makes progress
Aug 5, 2013
Aug 5, 2013
463
quint32 m_fetchTypes;
Jan 9, 2014
Jan 9, 2014
464
465
quint32 m_extraFetchTypes;
quint32 m_dataTypesFetched;
Jul 16, 2013
Jul 16, 2013
466
467
468
bool m_updatesPending;
bool m_refreshRequired;
bool m_contactsUpdated;
Dec 10, 2013
Dec 10, 2013
469
bool m_displayOff;
Jan 28, 2014
Jan 28, 2014
470
471
QSet<QContactId> m_constituentIds;
QSet<QContactId> m_candidateIds;
Jul 16, 2013
Jul 16, 2013
472
Aug 5, 2013
Aug 5, 2013
473
474
475
struct ResolveData {
QString first;
QString second;
Feb 12, 2015
Feb 12, 2015
476
QString compare; // only used in m_unknownAddresses
Aug 5, 2013
Aug 5, 2013
477
478
479
bool requireComplete;
ResolveListener *listener;
};
Oct 21, 2014
Oct 21, 2014
480
QHash<QContactFetchRequest *, ResolveData> m_resolveAddresses;
Feb 12, 2015
Feb 12, 2015
481
QSet<ResolveData> m_pendingResolve; // these have active requests already
Dec 11, 2013
Dec 11, 2013
482
QList<ResolveData> m_unknownResolveAddresses;
Aug 30, 2013
Aug 30, 2013
483
QList<ResolveData> m_unknownAddresses;
Oct 24, 2013
Oct 24, 2013
484
QSet<QString> m_resolvedPhoneNumbers;
Aug 5, 2013
Aug 5, 2013
485
Jul 16, 2013
Jul 16, 2013
486
487
488
489
QElapsedTimer m_timer;
QElapsedTimer m_fetchPostponed;
static SeasideCache *instancePtr;
Mar 8, 2019
Mar 8, 2019
490
491
static int contactDisplayLabelGroupCount;
static QStringList allContactDisplayLabelGroups;
Oct 10, 2016
Oct 10, 2016
492
493
static QTranslator *engEnTranslator;
static QTranslator *translator;
Feb 12, 2015
Feb 12, 2015
494
495
496
friend bool operator==(const SeasideCache::ResolveData &lhs, const SeasideCache::ResolveData &rhs);
friend uint qHash(const SeasideCache::ResolveData &key, uint seed);
Jul 16, 2013
Jul 16, 2013
497
498
};
Feb 12, 2015
Feb 12, 2015
499
500
501
bool operator==(const SeasideCache::ResolveData &lhs, const SeasideCache::ResolveData &rhs);
uint qHash(const SeasideCache::ResolveData &key, uint seed = 0);
Jul 16, 2013
Jul 16, 2013
502
#endif