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/provider.h"
00035 #include "Accounts/service.h"
00036 #include "Accounts/service-type.h"
00037
00041 namespace Accounts
00042 {
00043
00052 class ACCOUNTS_EXPORT Manager : public QObject
00053 {
00054 Q_OBJECT
00055
00056 public:
00057
00061 Manager(QObject *parent = 0);
00062
00073 Manager(const QString &serviceType, QObject *parent = 0);
00074
00075 ~Manager();
00076
00083 Account *account(const AccountId &id) const;
00084
00094 AccountIdList accountList(const QString &serviceType = QString::null) const;
00095
00106 AccountIdList accountListEnabled(const QString &serviceType = QString::null) const;
00107
00114 Account *createAccount(const QString &providerName);
00115
00122 Service *service(const QString &serviceName) const;
00123
00134 ServiceList serviceList(const QString &serviceType = QString::null) const;
00135
00142 Provider *provider(const QString &providerName) const;
00143
00149 ProviderList providerList() const;
00150
00157 ServiceType *serviceType(const QString &name) const;
00158
00164 QString serviceType() const;
00165
00175 void setTimeout(quint32 timeout);
00176
00181 quint32 timeout();
00182
00183 signals:
00189 void accountCreated(Accounts::AccountId id);
00190
00196 void accountRemoved(Accounts::AccountId id);
00197
00208 void accountUpdated(Accounts::AccountId id);
00209
00221 void enabledEvent(Accounts::AccountId id);
00222
00223 private:
00224
00225
00226 class Private;
00227 friend class Private;
00228 Private *d;
00229
00230 Provider *providerInstance(AgProvider *provider) const;
00231 Service *serviceInstance(AgService *service) const;
00232 friend class Account;
00233
00234 };
00235
00236 }
00237
00238 #endif // ACCOUNTMANAGER_H