~ci-train-bot/history-service/history-service-ubuntu-yakkety-landing-052

« back to all changes in this revision

Viewing changes to historyprivate/contactmatcher_p.h

Request contact information for all known participants on history-daemon initialization, and use this cached information on the models.
Approved by: Tiago Salem Herrmann, PS Jenkins bot

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 * Copyright (C) 2014 Canonical, Ltd.
 
2
 * Copyright (C) 2014-2015 Canonical, Ltd.
3
3
 *
4
4
 * Authors:
5
5
 *  Gustavo Pichorim Boiko <gustavo.boiko@canonical.com>
42
42
    Q_OBJECT
43
43
public:
44
44
    static ContactMatcher *instance(QContactManager *manager = 0);
45
 
    QVariantMap contactInfo(const QString &accountId, const QString &identifier);
46
 
    QVariantList contactInfo(const QString &accountId, const QStringList &identifiers);
 
45
    QVariantMap contactInfo(const QString &accountId, const QString &identifier, bool synchronous = false);
 
46
    QVariantList contactInfo(const QString &accountId, const QStringList &identifiers, bool synchronous = false);
 
47
 
 
48
    // this will only watch for contact changes affecting the identifier, but won't fetch contact info
 
49
    void watchIdentifier(const QString &accountId, const QString &identifier, const QVariantMap &currentInfo = QVariantMap());
47
50
 
48
51
Q_SIGNALS:
49
52
    void contactInfoChanged(const QString &acountId, const QString &identifier, const QVariantMap &contactInfo);
57
60
    void onSetupReady();
58
61
 
59
62
protected:
60
 
    void requestContactInfo(const QString &accountId, const QString &identifier);
 
63
    QVariantMap requestContactInfo(const QString &accountId, const QString &identifier, bool synchronous = false);
61
64
    QVariantList toVariantList(const QList<int> &list);
62
 
    bool matchAndUpdate(const QString &accountId, const QString &identifier, const QContact &contact);
 
65
    QVariantMap matchAndUpdate(const QString &accountId, const QString &identifier, const QContact &contact);
63
66
    QStringList addressableFields(const QString &accountId);
 
67
    bool hasMatch(const QVariantMap &map) const;
64
68
 
65
69
private:
66
70
    explicit ContactMatcher(QContactManager *manager = 0, QObject *parent = 0);