00001
00002
00003
00004
00005
00006
00007
00008 #ifndef IN_TP_QT_HEADER
00009 #error IN_TP_QT_HEADER
00010 #endif
00011
00012 #include <TelepathyQt/Types>
00013
00014 #include <QtGlobal>
00015
00016 #include <QString>
00017 #include <QObject>
00018 #include <QVariant>
00019
00020 #include <QDBusPendingReply>
00021
00022 #include <TelepathyQt/AbstractInterface>
00023 #include <TelepathyQt/DBusProxy>
00024 #include <TelepathyQt/Global>
00025
00026 namespace Tp
00027 {
00028 class PendingVariant;
00029 class PendingOperation;
00030 }
00031
00032 namespace Tp
00033 {
00034 namespace Client
00035 {
00036
00044 class TP_QT_EXPORT AccountManagerInterface : public Tp::AbstractInterface
00045 {
00046 Q_OBJECT
00047
00048 public:
00055 static inline QLatin1String staticInterfaceName()
00056 {
00057 return QLatin1String("org.freedesktop.Telepathy.AccountManager");
00058 }
00059
00067 AccountManagerInterface(
00068 const QString& busName,
00069 const QString& objectPath,
00070 QObject* parent = 0
00071 );
00072
00081 AccountManagerInterface(
00082 const QDBusConnection& connection,
00083 const QString& busName,
00084 const QString& objectPath,
00085 QObject* parent = 0
00086 );
00087
00094 AccountManagerInterface(Tp::DBusProxy *proxy);
00095
00105 inline Tp::PendingVariant *requestPropertyInterfaces() const
00106 {
00107 return internalRequestProperty(QLatin1String("Interfaces"));
00108 }
00109
00123 inline Tp::PendingVariant *requestPropertyValidAccounts() const
00124 {
00125 return internalRequestProperty(QLatin1String("ValidAccounts"));
00126 }
00127
00138 inline Tp::PendingVariant *requestPropertyInvalidAccounts() const
00139 {
00140 return internalRequestProperty(QLatin1String("InvalidAccounts"));
00141 }
00142
00195 inline Tp::PendingVariant *requestPropertySupportedAccountProperties() const
00196 {
00197 return internalRequestProperty(QLatin1String("SupportedAccountProperties"));
00198 }
00199
00206 Tp::PendingVariantMap *requestAllProperties() const
00207 {
00208 return internalRequestAllProperties();
00209 }
00210
00211 public Q_SLOTS:
00273 inline QDBusPendingReply<QDBusObjectPath> CreateAccount(const QString& connectionManager, const QString& protocol, const QString& displayName, const QVariantMap& parameters, const QVariantMap& properties, int timeout = -1)
00274 {
00275 if (!invalidationReason().isEmpty()) {
00276 return QDBusPendingReply<QDBusObjectPath>(QDBusMessage::createError(
00277 invalidationReason(),
00278 invalidationMessage()
00279 ));
00280 }
00281
00282 QDBusMessage callMessage = QDBusMessage::createMethodCall(this->service(), this->path(),
00283 this->staticInterfaceName(), QLatin1String("CreateAccount"));
00284 callMessage << QVariant::fromValue(connectionManager) << QVariant::fromValue(protocol) << QVariant::fromValue(displayName) << QVariant::fromValue(parameters) << QVariant::fromValue(properties);
00285 return this->connection().asyncCall(callMessage, timeout);
00286 }
00287
00288 Q_SIGNALS:
00301 void AccountRemoved(const QDBusObjectPath& account);
00302
00319 void AccountValidityChanged(const QDBusObjectPath& account, bool valid);
00320
00321 protected:
00322 virtual void invalidate(Tp::DBusProxy *, const QString &, const QString &);
00323 };
00324 }
00325 }
00326 Q_DECLARE_METATYPE(Tp::Client::AccountManagerInterface*)