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 ConnectionManagerInterface : public Tp::AbstractInterface
00045 {
00046 Q_OBJECT
00047
00048 public:
00055 static inline QLatin1String staticInterfaceName()
00056 {
00057 return QLatin1String("org.freedesktop.Telepathy.ConnectionManager");
00058 }
00059
00067 ConnectionManagerInterface(
00068 const QString& busName,
00069 const QString& objectPath,
00070 QObject* parent = 0
00071 );
00072
00081 ConnectionManagerInterface(
00082 const QDBusConnection& connection,
00083 const QString& busName,
00084 const QString& objectPath,
00085 QObject* parent = 0
00086 );
00087
00094 ConnectionManagerInterface(Tp::DBusProxy *proxy);
00095
00120 inline Tp::PendingVariant *requestPropertyProtocols() const
00121 {
00122 return internalRequestProperty(QLatin1String("Protocols"));
00123 }
00124
00152 inline Tp::PendingVariant *requestPropertyInterfaces() const
00153 {
00154 return internalRequestProperty(QLatin1String("Interfaces"));
00155 }
00156
00163 Tp::PendingVariantMap *requestAllProperties() const
00164 {
00165 return internalRequestAllProperties();
00166 }
00167
00168 public Q_SLOTS:
00194 inline QDBusPendingReply<Tp::ParamSpecList> GetParameters(const QString& protocol, int timeout = -1)
00195 {
00196 if (!invalidationReason().isEmpty()) {
00197 return QDBusPendingReply<Tp::ParamSpecList>(QDBusMessage::createError(
00198 invalidationReason(),
00199 invalidationMessage()
00200 ));
00201 }
00202
00203 QDBusMessage callMessage = QDBusMessage::createMethodCall(this->service(), this->path(),
00204 this->staticInterfaceName(), QLatin1String("GetParameters"));
00205 callMessage << QVariant::fromValue(protocol);
00206 return this->connection().asyncCall(callMessage, timeout);
00207 }
00208
00224 inline QDBusPendingReply<QStringList> ListProtocols(int timeout = -1)
00225 {
00226 if (!invalidationReason().isEmpty()) {
00227 return QDBusPendingReply<QStringList>(QDBusMessage::createError(
00228 invalidationReason(),
00229 invalidationMessage()
00230 ));
00231 }
00232
00233 QDBusMessage callMessage = QDBusMessage::createMethodCall(this->service(), this->path(),
00234 this->staticInterfaceName(), QLatin1String("ListProtocols"));
00235 return this->connection().asyncCall(callMessage, timeout);
00236 }
00237
00315 inline QDBusPendingReply<QString, QDBusObjectPath> RequestConnection(const QString& protocol, const QVariantMap& parameters, int timeout = -1)
00316 {
00317 if (!invalidationReason().isEmpty()) {
00318 return QDBusPendingReply<QString, QDBusObjectPath>(QDBusMessage::createError(
00319 invalidationReason(),
00320 invalidationMessage()
00321 ));
00322 }
00323
00324 QDBusMessage callMessage = QDBusMessage::createMethodCall(this->service(), this->path(),
00325 this->staticInterfaceName(), QLatin1String("RequestConnection"));
00326 callMessage << QVariant::fromValue(protocol) << QVariant::fromValue(parameters);
00327 return this->connection().asyncCall(callMessage, timeout);
00328 }
00329
00330 Q_SIGNALS:
00348 void NewConnection(const QString& busName, const QDBusObjectPath& objectPath, const QString& protocol);
00349
00350 protected:
00351 virtual void invalidate(Tp::DBusProxy *, const QString &, const QString &);
00352 };
00353
00361 class TP_QT_EXPORT ProtocolInterface : public Tp::AbstractInterface
00362 {
00363 Q_OBJECT
00364
00365 public:
00372 static inline QLatin1String staticInterfaceName()
00373 {
00374 return QLatin1String("org.freedesktop.Telepathy.Protocol");
00375 }
00376
00384 ProtocolInterface(
00385 const QString& busName,
00386 const QString& objectPath,
00387 QObject* parent = 0
00388 );
00389
00398 ProtocolInterface(
00399 const QDBusConnection& connection,
00400 const QString& busName,
00401 const QString& objectPath,
00402 QObject* parent = 0
00403 );
00404
00411 ProtocolInterface(Tp::DBusProxy *proxy);
00412
00420 explicit ProtocolInterface(const Tp::Client::ConnectionManagerInterface& mainInterface);
00421
00429 ProtocolInterface(const Tp::Client::ConnectionManagerInterface& mainInterface, QObject* parent);
00430
00454 inline Tp::PendingVariant *requestPropertyInterfaces() const
00455 {
00456 return internalRequestProperty(QLatin1String("Interfaces"));
00457 }
00458
00485 inline Tp::PendingVariant *requestPropertyParameters() const
00486 {
00487 return internalRequestProperty(QLatin1String("Parameters"));
00488 }
00489
00514 inline Tp::PendingVariant *requestPropertyConnectionInterfaces() const
00515 {
00516 return internalRequestProperty(QLatin1String("ConnectionInterfaces"));
00517 }
00518
00584 inline Tp::PendingVariant *requestPropertyRequestableChannelClasses() const
00585 {
00586 return internalRequestProperty(QLatin1String("RequestableChannelClasses"));
00587 }
00588
00638 inline Tp::PendingVariant *requestPropertyVCardField() const
00639 {
00640 return internalRequestProperty(QLatin1String("VCardField"));
00641 }
00642
00681 inline Tp::PendingVariant *requestPropertyEnglishName() const
00682 {
00683 return internalRequestProperty(QLatin1String("EnglishName"));
00684 }
00685
00715 inline Tp::PendingVariant *requestPropertyIcon() const
00716 {
00717 return internalRequestProperty(QLatin1String("Icon"));
00718 }
00719
00765 inline Tp::PendingVariant *requestPropertyAuthenticationTypes() const
00766 {
00767 return internalRequestProperty(QLatin1String("AuthenticationTypes"));
00768 }
00769
00776 Tp::PendingVariantMap *requestAllProperties() const
00777 {
00778 return internalRequestAllProperties();
00779 }
00780
00781 public Q_SLOTS:
00819 inline QDBusPendingReply<QString> IdentifyAccount(const QVariantMap& parameters, int timeout = -1)
00820 {
00821 if (!invalidationReason().isEmpty()) {
00822 return QDBusPendingReply<QString>(QDBusMessage::createError(
00823 invalidationReason(),
00824 invalidationMessage()
00825 ));
00826 }
00827
00828 QDBusMessage callMessage = QDBusMessage::createMethodCall(this->service(), this->path(),
00829 this->staticInterfaceName(), QLatin1String("IdentifyAccount"));
00830 callMessage << QVariant::fromValue(parameters);
00831 return this->connection().asyncCall(callMessage, timeout);
00832 }
00833
00888 inline QDBusPendingReply<QString> NormalizeContact(const QString& contactID, int timeout = -1)
00889 {
00890 if (!invalidationReason().isEmpty()) {
00891 return QDBusPendingReply<QString>(QDBusMessage::createError(
00892 invalidationReason(),
00893 invalidationMessage()
00894 ));
00895 }
00896
00897 QDBusMessage callMessage = QDBusMessage::createMethodCall(this->service(), this->path(),
00898 this->staticInterfaceName(), QLatin1String("NormalizeContact"));
00899 callMessage << QVariant::fromValue(contactID);
00900 return this->connection().asyncCall(callMessage, timeout);
00901 }
00902
00903 protected:
00904 virtual void invalidate(Tp::DBusProxy *, const QString &, const QString &);
00905 };
00906
00914 class TP_QT_EXPORT ProtocolInterfaceAddressingInterface : public Tp::AbstractInterface
00915 {
00916 Q_OBJECT
00917
00918 public:
00925 static inline QLatin1String staticInterfaceName()
00926 {
00927 return QLatin1String("org.freedesktop.Telepathy.Protocol.Interface.Addressing");
00928 }
00929
00937 ProtocolInterfaceAddressingInterface(
00938 const QString& busName,
00939 const QString& objectPath,
00940 QObject* parent = 0
00941 );
00942
00951 ProtocolInterfaceAddressingInterface(
00952 const QDBusConnection& connection,
00953 const QString& busName,
00954 const QString& objectPath,
00955 QObject* parent = 0
00956 );
00957
00964 ProtocolInterfaceAddressingInterface(Tp::DBusProxy *proxy);
00965
00973 explicit ProtocolInterfaceAddressingInterface(const Tp::Client::ConnectionManagerInterface& mainInterface);
00974
00982 ProtocolInterfaceAddressingInterface(const Tp::Client::ConnectionManagerInterface& mainInterface, QObject* parent);
00983
01046 inline Tp::PendingVariant *requestPropertyAddressableVCardFields() const
01047 {
01048 return internalRequestProperty(QLatin1String("AddressableVCardFields"));
01049 }
01050
01130 inline Tp::PendingVariant *requestPropertyAddressableURISchemes() const
01131 {
01132 return internalRequestProperty(QLatin1String("AddressableURISchemes"));
01133 }
01134
01141 Tp::PendingVariantMap *requestAllProperties() const
01142 {
01143 return internalRequestAllProperties();
01144 }
01145
01146 public Q_SLOTS:
01189 inline QDBusPendingReply<QString> NormalizeVCardAddress(const QString& VCardField, const QString& VCardAddress, int timeout = -1)
01190 {
01191 if (!invalidationReason().isEmpty()) {
01192 return QDBusPendingReply<QString>(QDBusMessage::createError(
01193 invalidationReason(),
01194 invalidationMessage()
01195 ));
01196 }
01197
01198 QDBusMessage callMessage = QDBusMessage::createMethodCall(this->service(), this->path(),
01199 this->staticInterfaceName(), QLatin1String("NormalizeVCardAddress"));
01200 callMessage << QVariant::fromValue(VCardField) << QVariant::fromValue(VCardAddress);
01201 return this->connection().asyncCall(callMessage, timeout);
01202 }
01203
01264 inline QDBusPendingReply<QString> NormalizeContactURI(const QString& URI, int timeout = -1)
01265 {
01266 if (!invalidationReason().isEmpty()) {
01267 return QDBusPendingReply<QString>(QDBusMessage::createError(
01268 invalidationReason(),
01269 invalidationMessage()
01270 ));
01271 }
01272
01273 QDBusMessage callMessage = QDBusMessage::createMethodCall(this->service(), this->path(),
01274 this->staticInterfaceName(), QLatin1String("NormalizeContactURI"));
01275 callMessage << QVariant::fromValue(URI);
01276 return this->connection().asyncCall(callMessage, timeout);
01277 }
01278
01279 protected:
01280 virtual void invalidate(Tp::DBusProxy *, const QString &, const QString &);
01281 };
01282
01290 class TP_QT_EXPORT ProtocolInterfaceAvatarsInterface : public Tp::AbstractInterface
01291 {
01292 Q_OBJECT
01293
01294 public:
01301 static inline QLatin1String staticInterfaceName()
01302 {
01303 return QLatin1String("org.freedesktop.Telepathy.Protocol.Interface.Avatars");
01304 }
01305
01313 ProtocolInterfaceAvatarsInterface(
01314 const QString& busName,
01315 const QString& objectPath,
01316 QObject* parent = 0
01317 );
01318
01327 ProtocolInterfaceAvatarsInterface(
01328 const QDBusConnection& connection,
01329 const QString& busName,
01330 const QString& objectPath,
01331 QObject* parent = 0
01332 );
01333
01340 ProtocolInterfaceAvatarsInterface(Tp::DBusProxy *proxy);
01341
01349 explicit ProtocolInterfaceAvatarsInterface(const Tp::Client::ConnectionManagerInterface& mainInterface);
01350
01358 ProtocolInterfaceAvatarsInterface(const Tp::Client::ConnectionManagerInterface& mainInterface, QObject* parent);
01359
01371 inline Tp::PendingVariant *requestPropertySupportedAvatarMIMETypes() const
01372 {
01373 return internalRequestProperty(QLatin1String("SupportedAvatarMIMETypes"));
01374 }
01375
01387 inline Tp::PendingVariant *requestPropertyMinimumAvatarHeight() const
01388 {
01389 return internalRequestProperty(QLatin1String("MinimumAvatarHeight"));
01390 }
01391
01403 inline Tp::PendingVariant *requestPropertyMinimumAvatarWidth() const
01404 {
01405 return internalRequestProperty(QLatin1String("MinimumAvatarWidth"));
01406 }
01407
01419 inline Tp::PendingVariant *requestPropertyRecommendedAvatarHeight() const
01420 {
01421 return internalRequestProperty(QLatin1String("RecommendedAvatarHeight"));
01422 }
01423
01435 inline Tp::PendingVariant *requestPropertyRecommendedAvatarWidth() const
01436 {
01437 return internalRequestProperty(QLatin1String("RecommendedAvatarWidth"));
01438 }
01439
01451 inline Tp::PendingVariant *requestPropertyMaximumAvatarHeight() const
01452 {
01453 return internalRequestProperty(QLatin1String("MaximumAvatarHeight"));
01454 }
01455
01467 inline Tp::PendingVariant *requestPropertyMaximumAvatarWidth() const
01468 {
01469 return internalRequestProperty(QLatin1String("MaximumAvatarWidth"));
01470 }
01471
01483 inline Tp::PendingVariant *requestPropertyMaximumAvatarBytes() const
01484 {
01485 return internalRequestProperty(QLatin1String("MaximumAvatarBytes"));
01486 }
01487
01494 Tp::PendingVariantMap *requestAllProperties() const
01495 {
01496 return internalRequestAllProperties();
01497 }
01498
01499 protected:
01500 virtual void invalidate(Tp::DBusProxy *, const QString &, const QString &);
01501 };
01502
01510 class TP_QT_EXPORT ProtocolInterfacePresenceInterface : public Tp::AbstractInterface
01511 {
01512 Q_OBJECT
01513
01514 public:
01521 static inline QLatin1String staticInterfaceName()
01522 {
01523 return QLatin1String("org.freedesktop.Telepathy.Protocol.Interface.Presence");
01524 }
01525
01533 ProtocolInterfacePresenceInterface(
01534 const QString& busName,
01535 const QString& objectPath,
01536 QObject* parent = 0
01537 );
01538
01547 ProtocolInterfacePresenceInterface(
01548 const QDBusConnection& connection,
01549 const QString& busName,
01550 const QString& objectPath,
01551 QObject* parent = 0
01552 );
01553
01560 ProtocolInterfacePresenceInterface(Tp::DBusProxy *proxy);
01561
01569 explicit ProtocolInterfacePresenceInterface(const Tp::Client::ConnectionManagerInterface& mainInterface);
01570
01578 ProtocolInterfacePresenceInterface(const Tp::Client::ConnectionManagerInterface& mainInterface, QObject* parent);
01579
01593 inline Tp::PendingVariant *requestPropertyStatuses() const
01594 {
01595 return internalRequestProperty(QLatin1String("Statuses"));
01596 }
01597
01604 Tp::PendingVariantMap *requestAllProperties() const
01605 {
01606 return internalRequestAllProperties();
01607 }
01608
01609 protected:
01610 virtual void invalidate(Tp::DBusProxy *, const QString &, const QString &);
01611 };
01612 }
01613 }
01614 Q_DECLARE_METATYPE(Tp::Client::ConnectionManagerInterface*)
01615 Q_DECLARE_METATYPE(Tp::Client::ProtocolInterface*)
01616 Q_DECLARE_METATYPE(Tp::Client::ProtocolInterfaceAddressingInterface*)
01617 Q_DECLARE_METATYPE(Tp::Client::ProtocolInterfaceAvatarsInterface*)
01618 Q_DECLARE_METATYPE(Tp::Client::ProtocolInterfacePresenceInterface*)