2
* This file is part of libOnlineAccounts
4
* Copyright (C) 2015 Canonical Ltd.
6
* Contact: Alberto Mardegan <alberto.mardegan@canonical.com>
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.
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.
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/>.
21
#ifndef ONLINE_ACCOUNTS_MANAGER_H
22
#define ONLINE_ACCOUNTS_MANAGER_H
29
#include "pending_call.h"
31
namespace OnlineAccounts {
34
class AuthenticationData;
35
class RequestAccessReplyPrivate;
38
class ONLINE_ACCOUNTS_EXPORT Manager: public QObject
43
explicit Manager(const QString &applicationId, QObject *parent = 0);
49
QList<Account*> availableAccounts(const QString &service = QString());
50
Account *account(AccountId accountId);
52
PendingCall requestAccess(const QString &service,
53
const AuthenticationData &authData);
57
void accountAvailable(OnlineAccounts::Account *account);
61
friend class RequestAccessReplyPrivate;
62
Q_DECLARE_PRIVATE(Manager)
63
Q_DISABLE_COPY(Manager)
64
ManagerPrivate *d_ptr;
67
class ONLINE_ACCOUNTS_EXPORT RequestAccessReply
70
RequestAccessReply(const PendingCall &call);
71
virtual ~RequestAccessReply();
73
bool hasError() const { return error().isValid(); }
79
Q_DECLARE_PRIVATE(RequestAccessReply)
80
Q_DISABLE_COPY(RequestAccessReply)
81
RequestAccessReplyPrivate *d_ptr;
86
#endif // ONLINE_ACCOUNTS_MANAGER_H