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 CallStreamEndpointInterface : public Tp::AbstractInterface
00045 {
00046 Q_OBJECT
00047
00048 public:
00055 static inline QLatin1String staticInterfaceName()
00056 {
00057 return QLatin1String("org.freedesktop.Telepathy.Call1.Stream.Endpoint");
00058 }
00059
00067 CallStreamEndpointInterface(
00068 const QString& busName,
00069 const QString& objectPath,
00070 QObject* parent = 0
00071 );
00072
00081 CallStreamEndpointInterface(
00082 const QDBusConnection& connection,
00083 const QString& busName,
00084 const QString& objectPath,
00085 QObject* parent = 0
00086 );
00087
00094 CallStreamEndpointInterface(Tp::DBusProxy *proxy);
00095
00108 inline Tp::PendingVariant *requestPropertyRemoteCredentials() const
00109 {
00110 return internalRequestProperty(QLatin1String("RemoteCredentials"));
00111 }
00112
00122 inline Tp::PendingVariant *requestPropertyRemoteCandidates() const
00123 {
00124 return internalRequestProperty(QLatin1String("RemoteCandidates"));
00125 }
00126
00157 inline Tp::PendingVariant *requestPropertySelectedCandidatePairs() const
00158 {
00159 return internalRequestProperty(QLatin1String("SelectedCandidatePairs"));
00160 }
00161
00172 inline Tp::PendingVariant *requestPropertyEndpointState() const
00173 {
00174 return internalRequestProperty(QLatin1String("EndpointState"));
00175 }
00176
00188 inline Tp::PendingVariant *requestPropertyTransport() const
00189 {
00190 return internalRequestProperty(QLatin1String("Transport"));
00191 }
00192
00213 inline Tp::PendingVariant *requestPropertyControlling() const
00214 {
00215 return internalRequestProperty(QLatin1String("Controlling"));
00216 }
00217
00228 inline Tp::PendingVariant *requestPropertyIsICELite() const
00229 {
00230 return internalRequestProperty(QLatin1String("IsICELite"));
00231 }
00232
00239 Tp::PendingVariantMap *requestAllProperties() const
00240 {
00241 return internalRequestAllProperties();
00242 }
00243
00244 public Q_SLOTS:
00278 inline QDBusPendingReply<> SetSelectedCandidatePair(const Tp::Candidate& localCandidate, const Tp::Candidate& remoteCandidate, int timeout = -1)
00279 {
00280 if (!invalidationReason().isEmpty()) {
00281 return QDBusPendingReply<>(QDBusMessage::createError(
00282 invalidationReason(),
00283 invalidationMessage()
00284 ));
00285 }
00286
00287 QDBusMessage callMessage = QDBusMessage::createMethodCall(this->service(), this->path(),
00288 this->staticInterfaceName(), QLatin1String("SetSelectedCandidatePair"));
00289 callMessage << QVariant::fromValue(localCandidate) << QVariant::fromValue(remoteCandidate);
00290 return this->connection().asyncCall(callMessage, timeout);
00291 }
00292
00311 inline QDBusPendingReply<> SetEndpointState(uint component, uint state, int timeout = -1)
00312 {
00313 if (!invalidationReason().isEmpty()) {
00314 return QDBusPendingReply<>(QDBusMessage::createError(
00315 invalidationReason(),
00316 invalidationMessage()
00317 ));
00318 }
00319
00320 QDBusMessage callMessage = QDBusMessage::createMethodCall(this->service(), this->path(),
00321 this->staticInterfaceName(), QLatin1String("SetEndpointState"));
00322 callMessage << QVariant::fromValue(component) << QVariant::fromValue(state);
00323 return this->connection().asyncCall(callMessage, timeout);
00324 }
00325
00345 inline QDBusPendingReply<> AcceptSelectedCandidatePair(const Tp::Candidate& localCandidate, const Tp::Candidate& remoteCandidate, int timeout = -1)
00346 {
00347 if (!invalidationReason().isEmpty()) {
00348 return QDBusPendingReply<>(QDBusMessage::createError(
00349 invalidationReason(),
00350 invalidationMessage()
00351 ));
00352 }
00353
00354 QDBusMessage callMessage = QDBusMessage::createMethodCall(this->service(), this->path(),
00355 this->staticInterfaceName(), QLatin1String("AcceptSelectedCandidatePair"));
00356 callMessage << QVariant::fromValue(localCandidate) << QVariant::fromValue(remoteCandidate);
00357 return this->connection().asyncCall(callMessage, timeout);
00358 }
00359
00379 inline QDBusPendingReply<> RejectSelectedCandidatePair(const Tp::Candidate& localCandidate, const Tp::Candidate& remoteCandidate, int timeout = -1)
00380 {
00381 if (!invalidationReason().isEmpty()) {
00382 return QDBusPendingReply<>(QDBusMessage::createError(
00383 invalidationReason(),
00384 invalidationMessage()
00385 ));
00386 }
00387
00388 QDBusMessage callMessage = QDBusMessage::createMethodCall(this->service(), this->path(),
00389 this->staticInterfaceName(), QLatin1String("RejectSelectedCandidatePair"));
00390 callMessage << QVariant::fromValue(localCandidate) << QVariant::fromValue(remoteCandidate);
00391 return this->connection().asyncCall(callMessage, timeout);
00392 }
00393
00411 inline QDBusPendingReply<> SetControlling(bool controlling, int timeout = -1)
00412 {
00413 if (!invalidationReason().isEmpty()) {
00414 return QDBusPendingReply<>(QDBusMessage::createError(
00415 invalidationReason(),
00416 invalidationMessage()
00417 ));
00418 }
00419
00420 QDBusMessage callMessage = QDBusMessage::createMethodCall(this->service(), this->path(),
00421 this->staticInterfaceName(), QLatin1String("SetControlling"));
00422 callMessage << QVariant::fromValue(controlling);
00423 return this->connection().asyncCall(callMessage, timeout);
00424 }
00425
00426 Q_SIGNALS:
00442 void RemoteCredentialsSet(const QString& username, const QString& password);
00443
00454 void RemoteCandidatesAdded(const Tp::CandidateList& candidates);
00455
00473 void CandidatePairSelected(const Tp::Candidate& localCandidate, const Tp::Candidate& remoteCandidate);
00474
00488 void EndpointStateChanged(uint component, uint state);
00489
00499 void ControllingChanged(bool controlling);
00500
00501 protected:
00502 virtual void invalidate(Tp::DBusProxy *, const QString &, const QString &);
00503 };
00504 }
00505 }
00506 Q_DECLARE_METATYPE(Tp::Client::CallStreamEndpointInterface*)