00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef _TelepathyQt4_cli_account_manager_h_HEADER_GUARD_
00023 #define _TelepathyQt4_cli_account_manager_h_HEADER_GUARD_
00024
00025 #ifndef IN_TELEPATHY_QT4_HEADER
00026 #error IN_TELEPATHY_QT4_HEADER
00027 #endif
00028
00029 #include <TelepathyQt4/_gen/cli-account-manager.h>
00030
00031 #include <TelepathyQt4/Client/Account>
00032 #include <TelepathyQt4/Client/DBus>
00033 #include <TelepathyQt4/Client/DBusProxy>
00034 #include <TelepathyQt4/Client/OptionalInterfaceFactory>
00035 #include <TelepathyQt4/Client/ReadinessHelper>
00036 #include <TelepathyQt4/Client/ReadyObject>
00037
00038 #include <QDBusObjectPath>
00039 #include <QExplicitlySharedDataPointer>
00040 #include <QSet>
00041 #include <QSharedData>
00042 #include <QString>
00043 #include <QVariantMap>
00044
00045 namespace Telepathy
00046 {
00047 namespace Client
00048 {
00049
00050 class AccountManager;
00051 class PendingAccount;
00052 class PendingReady;
00053
00054 class AccountManager : public StatelessDBusProxy,
00055 private OptionalInterfaceFactory<AccountManager>,
00056 public ReadyObject,
00057 public QSharedData
00058 {
00059 Q_OBJECT
00060 Q_DISABLE_COPY(AccountManager)
00061
00062 public:
00063 static const Feature FeatureCore;
00064
00065 AccountManager(QObject *parent = 0);
00066 AccountManager(const QDBusConnection &bus, QObject *parent = 0);
00067
00068 virtual ~AccountManager();
00069
00070 QStringList interfaces() const;
00071
00072 inline DBus::PropertiesInterface *propertiesInterface() const
00073 {
00074 return OptionalInterfaceFactory<AccountManager>::interface<DBus::PropertiesInterface>();
00075 }
00076
00077 QStringList validAccountPaths() const;
00078 QStringList invalidAccountPaths() const;
00079 QStringList allAccountPaths() const;
00080
00081 QList<AccountPtr> validAccounts();
00082 QList<AccountPtr> invalidAccounts();
00083 QList<AccountPtr> allAccounts();
00084
00085 AccountPtr accountForPath(const QString &path);
00086 QList<AccountPtr> accountsForPaths(const QStringList &paths);
00087
00088 PendingAccount *createAccount(const QString &connectionManager,
00089 const QString &protocol, const QString &displayName,
00090 const QVariantMap ¶meters);
00091
00092
00093
00094 Q_SIGNALS:
00095 void accountCreated(const QString &path);
00096 void accountRemoved(const QString &path);
00097 void accountValidityChanged(const QString &path, bool valid);
00098
00099 protected:
00100 AccountManagerInterface *baseInterface() const;
00101
00102 private Q_SLOTS:
00103 void gotMainProperties(QDBusPendingCallWatcher *);
00104 void onAccountValidityChanged(const QDBusObjectPath &, bool);
00105 void onAccountRemoved(const QDBusObjectPath &);
00106
00107 private:
00108 struct Private;
00109 friend struct Private;
00110 friend class PendingAccount;
00111 Private *mPriv;
00112 };
00113
00114 typedef QExplicitlySharedDataPointer<AccountManager> AccountManagerPtr;
00115
00116 }
00117 }
00118
00119 #endif