call-channel.h Source File

| Home · All Classes · All Namespaces · Modules · Functions · Files

call-channel.h
1
22 #ifndef _TelepathyQt_call_channel_h_HEADER_GUARD_
23 #define _TelepathyQt_call_channel_h_HEADER_GUARD_
24
25 #ifndef IN_TP_QT_HEADER
26 #error IN_TP_QT_HEADER
27 #endif
28
29 #include <TelepathyQt/Channel>
30 #include <TelepathyQt/CallContent>
31
32 namespace Tp
33 {
34
35 class TP_QT_EXPORT CallChannel : public Channel
36 {
37 Q_OBJECT
38 Q_DISABLE_COPY(CallChannel)
39
40 public:
41 static const Feature FeatureCore;
42 static const Feature FeatureCallState;
43 static const Feature FeatureCallMembers;
44 static const Feature FeatureContents;
45 static const Feature FeatureLocalHoldState;
46
47 static CallChannelPtr create(const ConnectionPtr &connection,
48 const QString &objectPath, const QVariantMap &immutableProperties);
49
50 virtual ~CallChannel();
51
52 bool handlerStreamingRequired() const;
53 StreamTransportType initialTransportType() const;
54 bool hasInitialAudio() const;
55 bool hasInitialVideo() const;
56 QString initialAudioName() const;
57 QString initialVideoName() const;
58 bool hasMutableContents() const;
59
60 PendingOperation *setRinging();
61 PendingOperation *setQueued();
62 PendingOperation *accept();
63 PendingOperation *hangup(CallStateChangeReason reason = CallStateChangeReasonUserRequested,
64 const QString &detailedReason = QString(), const QString &message = QString());
65
66 // FeatureCallState
67 CallState callState() const;
68 CallFlags callFlags() const;
69 CallStateReason callStateReason() const;
70 QVariantMap callStateDetails() const;
71
72 // FeatureCallMembers
73 Contacts remoteMembers() const;
74 CallMemberFlags remoteMemberFlags(const ContactPtr &member) const;
75
76 // FeatureContents
77 CallContents contents() const;
78 CallContents contentsForType(MediaStreamType type) const;
79 CallContentPtr contentByName(const QString &contentName) const;
80 PendingCallContent *requestContent(const QString &name,
81 MediaStreamType type, MediaStreamDirection direction);
82
83 // FeatureLocalHoldState
84 LocalHoldState localHoldState() const;
85 LocalHoldStateReason localHoldStateReason() const;
86 PendingOperation *requestHold(bool hold);
87
88 Q_SIGNALS:
89 // FeatureCallState
90 void callStateChanged(Tp::CallState state);
91 void callFlagsChanged(Tp::CallFlags flags);
92
93 // FeatureCallMembers
94 void remoteMemberFlagsChanged(
95 const QHash<Tp::ContactPtr, Tp::CallMemberFlags> &remoteMemberFlags,
96 const Tp::CallStateReason &reason);
97 void remoteMembersRemoved(const Tp::Contacts &remoteMembers,
98 const Tp::CallStateReason &reason);
99
100 // FeatureContents
101 void contentAdded(const Tp::CallContentPtr &content);
102 void contentRemoved(const Tp::CallContentPtr &content, const Tp::CallStateReason &reason);
103
104 // FeatureLocalHoldState
105 void localHoldStateChanged(Tp::LocalHoldState state, Tp::LocalHoldStateReason reason);
106
107 protected:
108 CallChannel(const ConnectionPtr &connection,
109 const QString &objectPath, const QVariantMap &immutableProperties,
110 const Feature &coreFeature = CallChannel::FeatureCore);
111
112 private Q_SLOTS:
113 TP_QT_NO_EXPORT void gotMainProperties(Tp::PendingOperation *op);
114
115 TP_QT_NO_EXPORT void gotCallState(Tp::PendingOperation *op);
116 TP_QT_NO_EXPORT void onCallStateChanged(uint state, uint flags,
117 const Tp::CallStateReason &stateReason, const QVariantMap &stateDetails);
118
119 TP_QT_NO_EXPORT void gotCallMembers(Tp::PendingOperation *op);
120 TP_QT_NO_EXPORT void gotCallMembersContacts(Tp::PendingOperation *op);
121 TP_QT_NO_EXPORT void onCallMembersChanged(const Tp::CallMemberMap &updates,
122 const Tp::HandleIdentifierMap &identifiers,
123 const Tp::UIntList &removed,
124 const Tp::CallStateReason &reason);
125
126 TP_QT_NO_EXPORT void gotContents(Tp::PendingOperation *op);
127 TP_QT_NO_EXPORT void onContentAdded(const QDBusObjectPath &contentPath);
128 TP_QT_NO_EXPORT void onContentRemoved(const QDBusObjectPath &contentPath,
129 const Tp::CallStateReason &reason);
130 TP_QT_NO_EXPORT void onContentReady(Tp::PendingOperation *op);
131
132 TP_QT_NO_EXPORT void gotLocalHoldState(QDBusPendingCallWatcher *);
133 TP_QT_NO_EXPORT void onLocalHoldStateChanged(uint, uint);
134
135 private:
136 friend class PendingCallContent;
137
138 TP_QT_NO_EXPORT CallContentPtr addContent(const QDBusObjectPath &contentPath);
139 TP_QT_NO_EXPORT CallContentPtr lookupContent(const QDBusObjectPath &contentPath) const;
140
141 struct Private;
142 friend struct Private;
143 Private *mPriv;
144 };
145
146 } // Tp
147
148 #endif
Tp::CallChannel::FeatureCallMembers
static const Feature FeatureCallMembers
Definition: call-channel.h:43
Tp::MediaStreamType
MediaStreamType
Definition: build/TelepathyQt/_gen/constants.h:2716
Tp::CallContents
QList< CallContentPtr > CallContents
Definition: call-content.h:37
Tp::CallChannel::FeatureLocalHoldState
static const Feature FeatureLocalHoldState
Definition: call-channel.h:45
Tp::StreamTransportType
StreamTransportType
Definition: build/TelepathyQt/_gen/constants.h:4463
Tp::Feature
The Feature class represents a feature that can be enabled on demand.
Definition: feature.h:41
Tp::CallStateReason
Definition: build/TelepathyQt/_gen/types.h:320
Tp::PendingOperation
The PendingOperation class is a base class for pending asynchronous operations.
Definition: pending-operation.h:45
Tp::UIntList
Definition: build/TelepathyQt/_gen/types.h:101
Tp::CallChannel::FeatureCallState
static const Feature FeatureCallState
Definition: call-channel.h:42
Tp::PendingCallContent
Definition: call-content.h:86
Tp::CallChannel::FeatureCore
static const Feature FeatureCore
Definition: call-channel.h:41
Tp::CallFlags
QFlags< CallFlag > CallFlags
Definition: build/TelepathyQt/_gen/constants.h:574
Tp::MediaStreamDirection
MediaStreamDirection
Definition: build/TelepathyQt/_gen/constants.h:2777
Tp::CallMemberMap
Definition: build/TelepathyQt/_gen/types.h:287
Tp::CallStateChangeReason
CallStateChangeReason
Definition: build/TelepathyQt/_gen/constants.h:2365
Tp::CallChannel
The CallChannel class provides an object representing a Telepathy channel of type Call...
Definition: call-channel.h:35
Tp::HandleIdentifierMap
Definition: build/TelepathyQt/_gen/types.h:1646
Tp::LocalHoldState
LocalHoldState
Definition: build/TelepathyQt/_gen/constants.h:3466
Tp::CallMemberFlags
QFlags< CallMemberFlag > CallMemberFlags
Definition: build/TelepathyQt/_gen/constants.h:650
Tp::CallState
CallState
Definition: build/TelepathyQt/_gen/constants.h:2286
Tp::CallStateChangeReasonUserRequested
Definition: build/TelepathyQt/_gen/constants.h:2394
Tp::CallChannel::FeatureContents
static const Feature FeatureContents
Definition: call-channel.h:44
Tp::LocalHoldStateReason
LocalHoldStateReason
Definition: build/TelepathyQt/_gen/constants.h:3516
Tp::Channel
The Channel class represents a Telepathy channel.
Definition: channel.h:51