Home · All Classes · All Namespaces · Modules · Functions · Files
call-channel.h
00001 
00022 #ifndef _TelepathyQt_call_channel_h_HEADER_GUARD_
00023 #define _TelepathyQt_call_channel_h_HEADER_GUARD_
00024 
00025 #ifndef IN_TP_QT_HEADER
00026 #error IN_TP_QT_HEADER
00027 #endif
00028 
00029 #include <TelepathyQt/Channel>
00030 #include <TelepathyQt/CallContent>
00031 
00032 namespace Tp
00033 {
00034 
00035 class TP_QT_EXPORT CallChannel : public Channel
00036 {
00037     Q_OBJECT
00038     Q_DISABLE_COPY(CallChannel)
00039 
00040 public:
00041     static const Feature FeatureCore;
00042     static const Feature FeatureCallState;
00043     static const Feature FeatureCallMembers;
00044     static const Feature FeatureContents;
00045     static const Feature FeatureLocalHoldState;
00046 
00047     static CallChannelPtr create(const ConnectionPtr &connection,
00048             const QString &objectPath, const QVariantMap &immutableProperties);
00049 
00050     virtual ~CallChannel();
00051 
00052     bool handlerStreamingRequired() const;
00053     StreamTransportType initialTransportType() const;
00054     bool hasInitialAudio() const;
00055     bool hasInitialVideo() const;
00056     QString initialAudioName() const;
00057     QString initialVideoName() const;
00058     bool hasMutableContents() const;
00059 
00060     PendingOperation *setRinging();
00061     PendingOperation *setQueued();
00062     PendingOperation *accept();
00063     PendingOperation *hangup(CallStateChangeReason reason = CallStateChangeReasonUserRequested,
00064             const QString &detailedReason = QString(), const QString &message = QString());
00065 
00066     // FeatureCallState
00067     CallState callState() const;
00068     CallFlags callFlags() const;
00069     CallStateReason callStateReason() const;
00070     QVariantMap callStateDetails() const;
00071 
00072     // FeatureCallMembers
00073     Contacts remoteMembers() const;
00074     CallMemberFlags remoteMemberFlags(const ContactPtr &member) const;
00075 
00076     // FeatureContents
00077     CallContents contents() const;
00078     CallContents contentsForType(MediaStreamType type) const;
00079     CallContentPtr contentByName(const QString &contentName) const;
00080     PendingCallContent *requestContent(const QString &name,
00081             MediaStreamType type, MediaStreamDirection direction);
00082 
00083     // FeatureLocalHoldState
00084     LocalHoldState localHoldState() const;
00085     LocalHoldStateReason localHoldStateReason() const;
00086     PendingOperation *requestHold(bool hold);
00087 
00088 Q_SIGNALS:
00089     // FeatureCallState
00090     void callStateChanged(Tp::CallState state);
00091     void callFlagsChanged(Tp::CallFlags flags);
00092 
00093     // FeatureCallMembers
00094     void remoteMemberFlagsChanged(
00095             const QHash<Tp::ContactPtr, Tp::CallMemberFlags> &remoteMemberFlags,
00096             const Tp::CallStateReason &reason);
00097     void remoteMembersRemoved(const Tp::Contacts &remoteMembers,
00098             const Tp::CallStateReason &reason);
00099 
00100     // FeatureContents
00101     void contentAdded(const Tp::CallContentPtr &content);
00102     void contentRemoved(const Tp::CallContentPtr &content, const Tp::CallStateReason &reason);
00103 
00104     // FeatureLocalHoldState
00105     void localHoldStateChanged(Tp::LocalHoldState state, Tp::LocalHoldStateReason reason);
00106 
00107 protected:
00108     CallChannel(const ConnectionPtr &connection,
00109             const QString &objectPath, const QVariantMap &immutableProperties,
00110             const Feature &coreFeature = CallChannel::FeatureCore);
00111 
00112 private Q_SLOTS:
00113     TP_QT_NO_EXPORT void gotMainProperties(Tp::PendingOperation *op);
00114 
00115     TP_QT_NO_EXPORT void gotCallState(Tp::PendingOperation *op);
00116     TP_QT_NO_EXPORT void onCallStateChanged(uint state, uint flags,
00117             const Tp::CallStateReason &stateReason, const QVariantMap &stateDetails);
00118 
00119     TP_QT_NO_EXPORT void gotCallMembers(Tp::PendingOperation *op);
00120     TP_QT_NO_EXPORT void gotCallMembersContacts(Tp::PendingOperation *op);
00121     TP_QT_NO_EXPORT void onCallMembersChanged(const Tp::CallMemberMap &updates,
00122             const Tp::HandleIdentifierMap &identifiers,
00123             const Tp::UIntList &removed,
00124             const Tp::CallStateReason &reason);
00125 
00126     TP_QT_NO_EXPORT void gotContents(Tp::PendingOperation *op);
00127     TP_QT_NO_EXPORT void onContentAdded(const QDBusObjectPath &contentPath);
00128     TP_QT_NO_EXPORT void onContentRemoved(const QDBusObjectPath &contentPath,
00129             const Tp::CallStateReason &reason);
00130     TP_QT_NO_EXPORT void onContentReady(Tp::PendingOperation *op);
00131 
00132     TP_QT_NO_EXPORT void gotLocalHoldState(QDBusPendingCallWatcher *);
00133     TP_QT_NO_EXPORT void onLocalHoldStateChanged(uint, uint);
00134 
00135 private:
00136     friend class PendingCallContent;
00137 
00138     TP_QT_NO_EXPORT CallContentPtr addContent(const QDBusObjectPath &contentPath);
00139     TP_QT_NO_EXPORT CallContentPtr lookupContent(const QDBusObjectPath &contentPath) const;
00140 
00141     struct Private;
00142     friend struct Private;
00143     Private *mPriv;
00144 };
00145 
00146 } // Tp
00147 
00148 #endif


Copyright © 2008-2011 Collabora Ltd. and Nokia Corporation
Telepathy-Qt 0.9.3