~renatofilho/buteo-sync-plugins-contacts/new-fw-version

« back to all changes in this revision

Viewing changes to google/GContactGroupsMap.h

  • Committer: CI Train Bot
  • Author(s): Renato Araujo Oliveira Filho
  • Date: 2015-09-24 17:50:44 UTC
  • mfrom: (1.3.53 initial-vr)
  • Revision ID: ci-train-bot@canonical.com-20150924175044-rp0akjs0h1xwxmpj
Implemented buteo contacts sync plugin for google, heavily based on:
  - https://github.com/nemomobile-graveyard/buteo-sync-plugins-google
  - https://github.com/nemomobile/buteo-sync-plugins-social
Approved by: Michael Sheldon

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/****************************************************************************
 
2
 **
 
3
 ** Copyright (C) 2015 Canonical Ltd.
 
4
 **
 
5
 ** Contact: Renato Araujo Oliveira Filho <renato.filho@canonical.com>
 
6
 **
 
7
 ** This program/library is free software; you can redistribute it and/or
 
8
 ** modify it under the terms of the GNU Lesser General Public License
 
9
 ** version 2.1 as published by the Free Software Foundation.
 
10
 **
 
11
 ** This program/library is distributed in the hope that it will be useful,
 
12
 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
 
13
 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 
14
 ** Lesser General Public License for more details.
 
15
 **
 
16
 ** You should have received a copy of the GNU Lesser General Public
 
17
 ** License along with this program/library; if not, write to the Free
 
18
 ** Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 
19
 ** 02110-1301 USA
 
20
 **
 
21
 ****************************************************************************/
 
22
 
 
23
#ifndef GOOGLECONTACTGRUOPMAP_H
 
24
#define GOOGLECONTACTGRUOPMAP_H
 
25
 
 
26
#include <QObject>
 
27
#include <QString>
 
28
#include <QUrl>
 
29
#include <QQueue>
 
30
#include <QThread>
 
31
#include <QMap>
 
32
#include <QMutex>
 
33
#include <QEventLoop>
 
34
#include <QtNetwork/QNetworkAccessManager>
 
35
 
 
36
class GTransport;
 
37
 
 
38
class GContactGroupMap: public QObject
 
39
{
 
40
    Q_OBJECT
 
41
 
 
42
public:
 
43
    explicit GContactGroupMap(const QString &authToken, QObject *parent = 0);
 
44
    ~GContactGroupMap();
 
45
 
 
46
    void reload();
 
47
 
 
48
signals:
 
49
    void updated();
 
50
 
 
51
private slots:
 
52
    void onRequestFinished(QNetworkReply *reply);
 
53
 
 
54
private:
 
55
    QScopedPointer<QNetworkAccessManager> mNetworkAccessManager;
 
56
    QString mAuthToken;
 
57
    QMap<QString, QString> mGroups;
 
58
};
 
59
 
 
60
#endif // GOOGLECONTACTGRUOPMAP_H