00001
00002
00003
00004
00005
00006
00007
00008 #ifndef IN_TELEPATHY_QT4_HEADER
00009 #error IN_TELEPATHY_QT4_HEADER
00010 #endif
00011
00012 #include <TelepathyQt4/Types>
00013
00014 #include <QtGlobal>
00015
00016 #include <QString>
00017 #include <QObject>
00018 #include <QVariant>
00019
00020 #include <QDBusPendingReply>
00021
00022 #include <TelepathyQt4/AbstractInterface>
00023 #include <TelepathyQt4/DBusProxy>
00024 #include <TelepathyQt4/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 TELEPATHY_QT4_EXPORT MediaStreamHandlerInterface : public Tp::AbstractInterface
00045 {
00046 Q_OBJECT
00047
00048 public:
00055 static inline QLatin1String staticInterfaceName()
00056 {
00057 return QLatin1String("org.freedesktop.Telepathy.Media.StreamHandler");
00058 }
00059
00067 MediaStreamHandlerInterface(
00068 const QString& busName,
00069 const QString& objectPath,
00070 QObject* parent = 0
00071 );
00072
00081 MediaStreamHandlerInterface(
00082 const QDBusConnection& connection,
00083 const QString& busName,
00084 const QString& objectPath,
00085 QObject* parent = 0
00086 );
00087
00094 MediaStreamHandlerInterface(Tp::DBusProxy *proxy);
00095
00111 inline Tp::PendingVariant *requestPropertySTUNServers() const
00112 {
00113 return internalRequestProperty(QLatin1String("STUNServers"));
00114 }
00115
00127 inline Tp::PendingVariant *requestPropertyCreatedLocally() const
00128 {
00129 return internalRequestProperty(QLatin1String("CreatedLocally"));
00130 }
00131
00173 inline Tp::PendingVariant *requestPropertyNATTraversal() const
00174 {
00175 return internalRequestProperty(QLatin1String("NATTraversal"));
00176 }
00177
00258 inline Tp::PendingVariant *requestPropertyRelayInfo() const
00259 {
00260 return internalRequestProperty(QLatin1String("RelayInfo"));
00261 }
00262
00269 Tp::PendingVariantMap *requestAllProperties() const
00270 {
00271 return internalRequestAllProperties();
00272 }
00273
00274 public Q_SLOTS:
00285 inline QDBusPendingReply<> CodecChoice(uint codecID, int timeout = -1)
00286 {
00287 if (!invalidationReason().isEmpty()) {
00288 return QDBusPendingReply<>(QDBusMessage::createError(
00289 invalidationReason(),
00290 invalidationMessage()
00291 ));
00292 }
00293
00294 QDBusMessage callMessage = QDBusMessage::createMethodCall(this->service(), this->path(),
00295 this->staticInterfaceName(), QLatin1String("CodecChoice"));
00296 callMessage << QVariant::fromValue(codecID);
00297 return this->connection().asyncCall(callMessage, timeout);
00298 }
00299
00320 inline QDBusPendingReply<> Error(uint errorCode, const QString& message, int timeout = -1)
00321 {
00322 if (!invalidationReason().isEmpty()) {
00323 return QDBusPendingReply<>(QDBusMessage::createError(
00324 invalidationReason(),
00325 invalidationMessage()
00326 ));
00327 }
00328
00329 QDBusMessage callMessage = QDBusMessage::createMethodCall(this->service(), this->path(),
00330 this->staticInterfaceName(), QLatin1String("Error"));
00331 callMessage << QVariant::fromValue(errorCode) << QVariant::fromValue(message);
00332 return this->connection().asyncCall(callMessage, timeout);
00333 }
00334
00346 inline QDBusPendingReply<> NativeCandidatesPrepared(int timeout = -1)
00347 {
00348 if (!invalidationReason().isEmpty()) {
00349 return QDBusPendingReply<>(QDBusMessage::createError(
00350 invalidationReason(),
00351 invalidationMessage()
00352 ));
00353 }
00354
00355 QDBusMessage callMessage = QDBusMessage::createMethodCall(this->service(), this->path(),
00356 this->staticInterfaceName(), QLatin1String("NativeCandidatesPrepared"));
00357 return this->connection().asyncCall(callMessage, timeout);
00358 }
00359
00371 inline QDBusPendingReply<> NewActiveCandidatePair(const QString& nativeCandidateID, const QString& remoteCandidateID, int timeout = -1)
00372 {
00373 if (!invalidationReason().isEmpty()) {
00374 return QDBusPendingReply<>(QDBusMessage::createError(
00375 invalidationReason(),
00376 invalidationMessage()
00377 ));
00378 }
00379
00380 QDBusMessage callMessage = QDBusMessage::createMethodCall(this->service(), this->path(),
00381 this->staticInterfaceName(), QLatin1String("NewActiveCandidatePair"));
00382 callMessage << QVariant::fromValue(nativeCandidateID) << QVariant::fromValue(remoteCandidateID);
00383 return this->connection().asyncCall(callMessage, timeout);
00384 }
00385
00413 inline QDBusPendingReply<> NewActiveTransportPair(const QString& nativeCandidateID, const Tp::MediaStreamHandlerTransport& nativeTransport, const QString& remoteCandidateID, const Tp::MediaStreamHandlerTransport& remoteTransport, int timeout = -1)
00414 {
00415 if (!invalidationReason().isEmpty()) {
00416 return QDBusPendingReply<>(QDBusMessage::createError(
00417 invalidationReason(),
00418 invalidationMessage()
00419 ));
00420 }
00421
00422 QDBusMessage callMessage = QDBusMessage::createMethodCall(this->service(), this->path(),
00423 this->staticInterfaceName(), QLatin1String("NewActiveTransportPair"));
00424 callMessage << QVariant::fromValue(nativeCandidateID) << QVariant::fromValue(nativeTransport) << QVariant::fromValue(remoteCandidateID) << QVariant::fromValue(remoteTransport);
00425 return this->connection().asyncCall(callMessage, timeout);
00426 }
00427
00462 inline QDBusPendingReply<> NewNativeCandidate(const QString& candidateID, const Tp::MediaStreamHandlerTransportList& transports, int timeout = -1)
00463 {
00464 if (!invalidationReason().isEmpty()) {
00465 return QDBusPendingReply<>(QDBusMessage::createError(
00466 invalidationReason(),
00467 invalidationMessage()
00468 ));
00469 }
00470
00471 QDBusMessage callMessage = QDBusMessage::createMethodCall(this->service(), this->path(),
00472 this->staticInterfaceName(), QLatin1String("NewNativeCandidate"));
00473 callMessage << QVariant::fromValue(candidateID) << QVariant::fromValue(transports);
00474 return this->connection().asyncCall(callMessage, timeout);
00475 }
00476
00492 inline QDBusPendingReply<> Ready(const Tp::MediaStreamHandlerCodecList& codecs, int timeout = -1)
00493 {
00494 if (!invalidationReason().isEmpty()) {
00495 return QDBusPendingReply<>(QDBusMessage::createError(
00496 invalidationReason(),
00497 invalidationMessage()
00498 ));
00499 }
00500
00501 QDBusMessage callMessage = QDBusMessage::createMethodCall(this->service(), this->path(),
00502 this->staticInterfaceName(), QLatin1String("Ready"));
00503 callMessage << QVariant::fromValue(codecs);
00504 return this->connection().asyncCall(callMessage, timeout);
00505 }
00506
00536 inline QDBusPendingReply<> SetLocalCodecs(const Tp::MediaStreamHandlerCodecList& codecs, int timeout = -1)
00537 {
00538 if (!invalidationReason().isEmpty()) {
00539 return QDBusPendingReply<>(QDBusMessage::createError(
00540 invalidationReason(),
00541 invalidationMessage()
00542 ));
00543 }
00544
00545 QDBusMessage callMessage = QDBusMessage::createMethodCall(this->service(), this->path(),
00546 this->staticInterfaceName(), QLatin1String("SetLocalCodecs"));
00547 callMessage << QVariant::fromValue(codecs);
00548 return this->connection().asyncCall(callMessage, timeout);
00549 }
00550
00562 inline QDBusPendingReply<> StreamState(uint state, int timeout = -1)
00563 {
00564 if (!invalidationReason().isEmpty()) {
00565 return QDBusPendingReply<>(QDBusMessage::createError(
00566 invalidationReason(),
00567 invalidationMessage()
00568 ));
00569 }
00570
00571 QDBusMessage callMessage = QDBusMessage::createMethodCall(this->service(), this->path(),
00572 this->staticInterfaceName(), QLatin1String("StreamState"));
00573 callMessage << QVariant::fromValue(state);
00574 return this->connection().asyncCall(callMessage, timeout);
00575 }
00576
00595 inline QDBusPendingReply<> SupportedCodecs(const Tp::MediaStreamHandlerCodecList& codecs, int timeout = -1)
00596 {
00597 if (!invalidationReason().isEmpty()) {
00598 return QDBusPendingReply<>(QDBusMessage::createError(
00599 invalidationReason(),
00600 invalidationMessage()
00601 ));
00602 }
00603
00604 QDBusMessage callMessage = QDBusMessage::createMethodCall(this->service(), this->path(),
00605 this->staticInterfaceName(), QLatin1String("SupportedCodecs"));
00606 callMessage << QVariant::fromValue(codecs);
00607 return this->connection().asyncCall(callMessage, timeout);
00608 }
00609
00628 inline QDBusPendingReply<> CodecsUpdated(const Tp::MediaStreamHandlerCodecList& codecs, int timeout = -1)
00629 {
00630 if (!invalidationReason().isEmpty()) {
00631 return QDBusPendingReply<>(QDBusMessage::createError(
00632 invalidationReason(),
00633 invalidationMessage()
00634 ));
00635 }
00636
00637 QDBusMessage callMessage = QDBusMessage::createMethodCall(this->service(), this->path(),
00638 this->staticInterfaceName(), QLatin1String("CodecsUpdated"));
00639 callMessage << QVariant::fromValue(codecs);
00640 return this->connection().asyncCall(callMessage, timeout);
00641 }
00642
00658 inline QDBusPendingReply<> HoldState(bool held, int timeout = -1)
00659 {
00660 if (!invalidationReason().isEmpty()) {
00661 return QDBusPendingReply<>(QDBusMessage::createError(
00662 invalidationReason(),
00663 invalidationMessage()
00664 ));
00665 }
00666
00667 QDBusMessage callMessage = QDBusMessage::createMethodCall(this->service(), this->path(),
00668 this->staticInterfaceName(), QLatin1String("HoldState"));
00669 callMessage << QVariant::fromValue(held);
00670 return this->connection().asyncCall(callMessage, timeout);
00671 }
00672
00685 inline QDBusPendingReply<> UnholdFailure(int timeout = -1)
00686 {
00687 if (!invalidationReason().isEmpty()) {
00688 return QDBusPendingReply<>(QDBusMessage::createError(
00689 invalidationReason(),
00690 invalidationMessage()
00691 ));
00692 }
00693
00694 QDBusMessage callMessage = QDBusMessage::createMethodCall(this->service(), this->path(),
00695 this->staticInterfaceName(), QLatin1String("UnholdFailure"));
00696 return this->connection().asyncCall(callMessage, timeout);
00697 }
00698
00699 Q_SIGNALS:
00715 void AddRemoteCandidate(const QString& candidateID, const Tp::MediaStreamHandlerTransportList& transports);
00716
00723 void Close();
00724
00736 void RemoveRemoteCandidate(const QString& candidateID);
00737
00745 void SetActiveCandidatePair(const QString& nativeCandidateID, const QString& remoteCandidateID);
00746
00758 void SetRemoteCandidateList(const Tp::MediaStreamHandlerCandidateList& remoteCandidates);
00759
00772 void SetRemoteCodecs(const Tp::MediaStreamHandlerCodecList& codecs);
00773
00783 void SetStreamPlaying(bool playing);
00784
00791 void SetStreamSending(bool sending);
00792
00803 void StartTelephonyEvent(uchar event);
00804
00824 void StartNamedTelephonyEvent(uchar event, uint codecID);
00825
00838 void StartSoundTelephonyEvent(uchar event);
00839
00846 void StopTelephonyEvent();
00847
00881 void SetStreamHeld(bool held);
00882
00883 protected:
00884 virtual void invalidate(Tp::DBusProxy *, const QString &, const QString &);
00885 };
00886 }
00887 }
00888 Q_DECLARE_METATYPE(Tp::Client::MediaStreamHandlerInterface*)