Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef ACCOUNTMANAGER_H
00025 #define ACCOUNTMANAGER_H
00026
00027 #include <QObject>
00028 #include <QSettings>
00029 #include <QString>
00030 #include <QStringList>
00031
00032 #include "Accounts/accountscommon.h"
00033 #include "Accounts/account.h"
00034 #include "Accounts/error.h"
00035 #include "Accounts/provider.h"
00036 #include "Accounts/service.h"
00037 #include "Accounts/service-type.h"
00038
00042 namespace Accounts
00043 {
00044
00053 class ACCOUNTS_EXPORT Manager : public QObject
00054 {
00055 Q_OBJECT
00056
00057 public:
00058
00064 Manager(QObject *parent = 0);
00065
00078 Manager(const QString &serviceType, QObject *parent = 0);
00079
00083 ~Manager();
00084
00092 Account *account(const AccountId &id) const;
00093
00103 AccountIdList accountList(const QString &serviceType = QString::null) const;
00104
00115 AccountIdList accountListEnabled(const QString &serviceType = QString::null) const;
00116
00123 Account *createAccount(const QString &providerName);
00124
00131 Service *service(const QString &serviceName) const;
00132
00143 ServiceList serviceList(const QString &serviceType = QString::null) const;
00144
00151 Provider *provider(const QString &providerName) const;
00152
00158 ProviderList providerList() const;
00159
00166 ServiceType *serviceType(const QString &name) const;
00167
00173 QString serviceType() const;
00174
00184 void setTimeout(quint32 timeout);
00185
00190 quint32 timeout();
00191
00196 void setAbortOnTimeout(bool abort);
00197
00202 bool abortOnTimeout() const;
00203
00213 Error lastError() const;
00214
00215 signals:
00221 void accountCreated(Accounts::AccountId id);
00222
00228 void accountRemoved(Accounts::AccountId id);
00229
00240 void accountUpdated(Accounts::AccountId id);
00241
00253 void enabledEvent(Accounts::AccountId id);
00254
00255 private:
00256
00257
00258 class Private;
00259 friend class Private;
00260 Private *d;
00261
00262 Provider *providerInstance(AgProvider *provider) const;
00263 Service *serviceInstance(AgService *service) const;
00264 friend class Account;
00265
00266 };
00267
00268 }
00269
00270 #endif // ACCOUNTMANAGER_H