~ci-train-bot/online-accounts-api/online-accounts-api-ubuntu-xenial-landing-033

« back to all changes in this revision

Viewing changes to src/lib/OnlineAccounts/pending_call.h

  • Committer: Alberto Mardegan
  • Date: 2015-04-28 17:01:03 UTC
  • mfrom: (5.1.30 qt-api-impl)
  • Revision ID: alberto.mardegan@canonical.com-20150428170103-9hty50555f6e7uz6
Qt client API implementation

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * This file is part of libOnlineAccounts
 
3
 *
 
4
 * Copyright (C) 2015 Canonical Ltd.
 
5
 *
 
6
 * Contact: Alberto Mardegan <alberto.mardegan@canonical.com>
 
7
 *
 
8
 * This program is free software: you can redistribute it and/or modify it
 
9
 * under the terms of the GNU Lesser General Public License version 3, as
 
10
 * published by the Free Software Foundation.
 
11
 *
 
12
 * This program is distributed in the hope that it will be useful, but
 
13
 * WITHOUT ANY WARRANTY; without even the implied warranties of
 
14
 * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
 
15
 * PURPOSE.  See the GNU Lesser General Public License for more details.
 
16
 *
 
17
 * You should have received a copy of the GNU Lesser General Public License
 
18
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
19
 */
 
20
 
 
21
#ifndef ONLINE_ACCOUNTS_PENDING_CALL_H
 
22
#define ONLINE_ACCOUNTS_PENDING_CALL_H
 
23
 
 
24
#include <QExplicitlySharedDataPointer>
 
25
#include <QObject>
 
26
 
 
27
#include "global.h"
 
28
 
 
29
namespace OnlineAccounts {
 
30
 
 
31
class AuthenticationReplyPrivate;
 
32
class ManagerPrivate;
 
33
 
 
34
class PendingCallPrivate;
 
35
class ONLINE_ACCOUNTS_EXPORT PendingCall
 
36
{
 
37
public:
 
38
    PendingCall(const PendingCall &other);
 
39
    ~PendingCall();
 
40
    PendingCall &operator=(const PendingCall &other);
 
41
 
 
42
    bool isFinished() const;
 
43
    void waitForFinished();
 
44
 
 
45
protected:
 
46
    friend class PendingCallPrivate;
 
47
    friend class PendingCallWatcher;
 
48
    friend class AuthenticationReplyPrivate;
 
49
    friend class RequestAccessReplyPrivate;
 
50
    friend class ManagerPrivate;
 
51
    QExplicitlySharedDataPointer<PendingCallPrivate> d;
 
52
 
 
53
private:
 
54
    PendingCall(PendingCallPrivate *priv);
 
55
};
 
56
 
 
57
class PendingCallWatcherPrivate;
 
58
class ONLINE_ACCOUNTS_EXPORT PendingCallWatcher:
 
59
    public QObject, public PendingCall
 
60
{
 
61
    Q_OBJECT
 
62
 
 
63
public:
 
64
    PendingCallWatcher(const PendingCall &call, QObject *parent = 0);
 
65
    ~PendingCallWatcher();
 
66
 
 
67
Q_SIGNALS:
 
68
    void finished();
 
69
 
 
70
private:
 
71
    Q_DECLARE_PRIVATE(PendingCallWatcher)
 
72
    PendingCallWatcherPrivate *d_ptr;
 
73
};
 
74
 
 
75
} // namespace
 
76
 
 
77
#endif // ONLINE_ACCOUNTS_PENDING_CALL_H