00001
00002
00003
00004
00005
00006
00007
00008 #include <TelepathyQt4/Types>
00009 #include <TelepathyQt4/Prototype/Types>
00010
00011 #include <QtGlobal>
00012
00013 #include <QString>
00014 #include <QObject>
00015 #include <QVariant>
00016
00017 #include <QDBusPendingReply>
00018
00019 #include <TelepathyQt4/Client/AbstractInterface>
00020 #include <TelepathyQt4/Client/DBusProxy>
00021
00022
00023 #ifndef TELEPATHY_GNUC_DEPRECATED
00024 # if defined(Q_CC_GNUC) && __GNUC__ >= 4
00025 # define TELEPATHY_GNUC_DEPRECATED __attribute__((__deprecated__))
00026 # else
00027 # define TELEPATHY_GNUC_DEPRECATED
00028 # endif
00029 #endif
00030 namespace TpPrototype
00031 {
00032 namespace Client
00033 {
00034
00042 class StreamEngineInterface : public Telepathy::Client::AbstractInterface
00043 {
00044 Q_OBJECT
00045
00046 public:
00053 static inline const char *staticInterfaceName()
00054 {
00055 return "org.freedesktop.Telepathy.StreamEngine";
00056 }
00057
00065 StreamEngineInterface(
00066 const QString& serviceName,
00067 const QString& objectPath,
00068 QObject* parent = 0
00069 );
00070
00079 StreamEngineInterface(
00080 const QDBusConnection& connection,
00081 const QString& serviceName,
00082 const QString& objectPath,
00083 QObject* parent = 0
00084 );
00085
00092 StreamEngineInterface(Telepathy::Client::DBusProxy *proxy);
00093
00101 explicit StreamEngineInterface(const Telepathy::Client::AbstractInterface& mainInterface);
00102
00110 StreamEngineInterface(const Telepathy::Client::AbstractInterface& mainInterface, QObject* parent);
00111
00112 public Q_SLOTS:
00116 inline QDBusPendingReply<> SetOutputVolume(const QDBusObjectPath& channelpath, uint streamid, uint volume)
00117 {
00118 if (!invalidationReason().isEmpty()) {
00119 return QDBusPendingReply<>(QDBusMessage::createError(
00120 invalidationReason(),
00121 invalidationMessage()
00122 ));
00123 }
00124
00125
00126 QList<QVariant> argumentList;
00127 argumentList << QVariant::fromValue(channelpath) << QVariant::fromValue(streamid) << QVariant::fromValue(volume);
00128 return asyncCallWithArgumentList(QLatin1String("SetOutputVolume"), argumentList);
00129 }
00130
00134 inline QDBusPendingReply<> MuteInput(const QDBusObjectPath& channelpath, uint streamid, bool mutestate)
00135 {
00136 if (!invalidationReason().isEmpty()) {
00137 return QDBusPendingReply<>(QDBusMessage::createError(
00138 invalidationReason(),
00139 invalidationMessage()
00140 ));
00141 }
00142
00143
00144 QList<QVariant> argumentList;
00145 argumentList << QVariant::fromValue(channelpath) << QVariant::fromValue(streamid) << QVariant::fromValue(mutestate);
00146 return asyncCallWithArgumentList(QLatin1String("MuteInput"), argumentList);
00147 }
00148
00152 inline QDBusPendingReply<> MuteOutput(const QDBusObjectPath& channelpath, uint streamid, bool mutestate)
00153 {
00154 if (!invalidationReason().isEmpty()) {
00155 return QDBusPendingReply<>(QDBusMessage::createError(
00156 invalidationReason(),
00157 invalidationMessage()
00158 ));
00159 }
00160
00161
00162 QList<QVariant> argumentList;
00163 argumentList << QVariant::fromValue(channelpath) << QVariant::fromValue(streamid) << QVariant::fromValue(mutestate);
00164 return asyncCallWithArgumentList(QLatin1String("MuteOutput"), argumentList);
00165 }
00166
00170 inline QDBusPendingReply<> SetOutputWindow(const QDBusObjectPath& channelpath, uint streamid, uint window)
00171 {
00172 if (!invalidationReason().isEmpty()) {
00173 return QDBusPendingReply<>(QDBusMessage::createError(
00174 invalidationReason(),
00175 invalidationMessage()
00176 ));
00177 }
00178
00179
00180 QList<QVariant> argumentList;
00181 argumentList << QVariant::fromValue(channelpath) << QVariant::fromValue(streamid) << QVariant::fromValue(window);
00182 return asyncCallWithArgumentList(QLatin1String("SetOutputWindow"), argumentList);
00183 }
00184
00188 inline QDBusPendingReply<> AddPreviewWindow(uint window)
00189 {
00190 if (!invalidationReason().isEmpty()) {
00191 return QDBusPendingReply<>(QDBusMessage::createError(
00192 invalidationReason(),
00193 invalidationMessage()
00194 ));
00195 }
00196
00197
00198 QList<QVariant> argumentList;
00199 argumentList << QVariant::fromValue(window);
00200 return asyncCallWithArgumentList(QLatin1String("AddPreviewWindow"), argumentList);
00201 }
00202
00206 inline QDBusPendingReply<> RemovePreviewWindow(uint window)
00207 {
00208 if (!invalidationReason().isEmpty()) {
00209 return QDBusPendingReply<>(QDBusMessage::createError(
00210 invalidationReason(),
00211 invalidationMessage()
00212 ));
00213 }
00214
00215
00216 QList<QVariant> argumentList;
00217 argumentList << QVariant::fromValue(window);
00218 return asyncCallWithArgumentList(QLatin1String("RemovePreviewWindow"), argumentList);
00219 }
00220
00224 inline QDBusPendingReply<> Shutdown()
00225 {
00226 if (!invalidationReason().isEmpty()) {
00227 return QDBusPendingReply<>(QDBusMessage::createError(
00228 invalidationReason(),
00229 invalidationMessage()
00230 ));
00231 }
00232
00233
00234 return asyncCall(QLatin1String("Shutdown"));
00235 }
00236
00237 Q_SIGNALS:
00241 void Receiving(const QDBusObjectPath& channelpath, uint streamid, bool state);
00242
00246 void StreamStateChanged(const QDBusObjectPath& channelpath, uint streamid, uint state, uint direction);
00247
00248 protected:
00249 virtual void invalidate(Telepathy::Client::DBusProxy *, const QString &, const QString &);
00250 };
00251 }
00252 }