base-call.h Source File

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

base-call.h
1
23 #ifndef _TelepathyQt_base_call_h_HEADER_GUARD_
24 #define _TelepathyQt_base_call_h_HEADER_GUARD_
25
26 #ifndef IN_TP_QT_HEADER
27 #error IN_TP_QT_HEADER
28 #endif
29
30
31 #include <TelepathyQt/DBusService>
32 #include <TelepathyQt/Global>
33 #include <TelepathyQt/Types>
34 #include <TelepathyQt/Callbacks>
35 #include <TelepathyQt/Constants>
36 #include <TelepathyQt/BaseChannel>
37
38 #include <QDBusConnection>
39
40 class QString;
41
42 namespace Tp
43 {
44
45 class TP_QT_EXPORT AbstractCallContentInterface : public AbstractDBusServiceInterface
46 {
47 Q_OBJECT
48 Q_DISABLE_COPY(AbstractCallContentInterface)
49
50 public:
51 AbstractCallContentInterface(const QString &interfaceName);
52 virtual ~AbstractCallContentInterface();
53
54 private:
55 friend class BaseCallContent;
56
57 class Private;
58 friend class Private;
59 Private *mPriv;
60 };
61
62 class TP_QT_EXPORT BaseCallContent : public DBusService
63 {
64 Q_OBJECT
65 Q_DISABLE_COPY(BaseCallContent)
66
67 public:
68 static BaseCallContentPtr create(const QDBusConnection &dbusConnection,
69 BaseChannel* channel,
70 const QString &name,
71 const Tp::MediaStreamType &type,
72 const Tp::MediaStreamDirection &direction) {
73 return BaseCallContentPtr(new BaseCallContent(dbusConnection, channel, name, type, direction));
74 }
75
76 virtual ~BaseCallContent();
77 QVariantMap immutableProperties() const;
78 bool registerObject(DBusError *error = NULL);
79 virtual QString uniqueName() const;
80
81 QList<AbstractCallContentInterfacePtr> interfaces() const;
82 AbstractCallContentInterfacePtr interface(const QString &interfaceName) const;
83 bool plugInterface(const AbstractCallContentInterfacePtr &interface);
84
85 QString name() const;
86 Tp::MediaStreamType type() const;
87 Tp::CallContentDisposition disposition() const;
88 Tp::ObjectPathList streams() const;
89 protected:
90 BaseCallContent(const QDBusConnection &dbusConnection,
91 BaseChannel* channel,
92 const QString &name,
93 const Tp::MediaStreamType &type,
94 const Tp::MediaStreamDirection &direction);
95
96 virtual bool registerObject(const QString &busName, const QString &objectPath,
97 DBusError *error);
98 void remove();
99
100 private:
101 class Adaptee;
102 friend class Adaptee;
103 struct Private;
104 friend struct Private;
105 Private *mPriv;
106 };
107
108 class TP_QT_EXPORT BaseCallMuteInterface : public AbstractChannelInterface
109 {
110 Q_OBJECT
111 Q_DISABLE_COPY(BaseCallMuteInterface)
112
113 public:
114 static BaseCallMuteInterfacePtr create() {
115 return BaseCallMuteInterfacePtr(new BaseCallMuteInterface());
116 }
117 template<typename BaseCallMuteInterfaceSubclass>
118 static SharedPtr<BaseCallMuteInterfaceSubclass> create() {
119 return SharedPtr<BaseCallMuteInterfaceSubclass>(
120 new BaseCallMuteInterfaceSubclass());
121 }
122 virtual ~BaseCallMuteInterface();
123
124 QVariantMap immutableProperties() const;
125
126 Tp::LocalMuteState localMuteState() const;
127 void setMuteState(const Tp::LocalMuteState &state);
128
129 typedef Callback2<void, const Tp::LocalMuteState&, DBusError*> SetMuteStateCallback;
130 void setSetMuteStateCallback(const SetMuteStateCallback &cb);
131 Q_SIGNALS:
132 void muteStateChanged(const Tp::LocalMuteState &state);
133 private:
134 BaseCallMuteInterface();
135 void createAdaptor();
136
137 class Adaptee;
138 friend class Adaptee;
139 struct Private;
140 friend struct Private;
141 Private *mPriv;
142 };
143
144 class TP_QT_EXPORT BaseCallContentDTMFInterface : public AbstractCallContentInterface
145 {
146 Q_OBJECT
147 Q_DISABLE_COPY(BaseCallContentDTMFInterface)
148
149 public:
150 static BaseCallContentDTMFInterfacePtr create() {
151 return BaseCallContentDTMFInterfacePtr(new BaseCallContentDTMFInterface());
152 }
153 template<typename BaseCallContentDTMFInterfaceSubclass>
154 static SharedPtr<BaseCallContentDTMFInterfaceSubclass> create() {
155 return SharedPtr<BaseCallContentDTMFInterfaceSubclass>(
156 new BaseCallContentDTMFInterfaceSubclass());
157 }
158 virtual ~BaseCallContentDTMFInterface();
159
160 QVariantMap immutableProperties() const;
161
162 bool currentlySendingTones() const;
163 void setCurrentlySendingTones(bool sendingTones);
164
165 QString deferredTones() const;
166 void setDeferredTones(const QString &deferredTones);
167
168
169 typedef Callback2<void, uchar, DBusError*> StartToneCallback;
170 void setStartToneCallback(const StartToneCallback &cb);
171 typedef Callback1<void, DBusError*> StopToneCallback;
172 void setStopToneCallback(const StopToneCallback &cb);
173 typedef Callback2<void, const QString&, DBusError*> MultipleTonesCallback;
174 void setMultipleTonesCallback(const MultipleTonesCallback &cb);
175 Q_SIGNALS:
176
177 private:
178 BaseCallContentDTMFInterface();
179 void createAdaptor();
180
181 class Adaptee;
182 friend class Adaptee;
183 struct Private;
184 friend struct Private;
185 Private *mPriv;
186 };
187
188
189 }
190 #endif
Tp::MediaStreamType
MediaStreamType
Definition: build/TelepathyQt/_gen/constants.h:2716
Tp::AbstractDBusServiceInterface
Base class for D-Bus service interfaces.
Definition: dbus-service.h:73
Tp::BaseCallContentDTMFInterface::create
static BaseCallContentDTMFInterfacePtr create()
Definition: base-call.h:150
Tp::AbstractChannelInterface
Base class for all the Channel object interface implementations.
Definition: base-channel.h:95
Tp::BaseCallContent::create
static BaseCallContentPtr create(const QDBusConnection &dbusConnection, BaseChannel *channel, const QString &name, const Tp::MediaStreamType &type, const Tp::MediaStreamDirection &direction)
Definition: base-call.h:68
Tp::BaseCallMuteInterface
Base class for implementations of Call.Interface.Mute.
Definition: base-call.h:108
Tp::BaseCallContentDTMFInterface::MultipleTonesCallback
Callback2< void, const QString &, DBusError * > MultipleTonesCallback
Definition: base-call.h:173
Tp::LocalMuteState
LocalMuteState
Definition: build/TelepathyQt/_gen/constants.h:4626
Tp::DBusService
Base class for D-Bus services.
Definition: dbus-service.h:46
Tp::SharedPtr
The SharedPtr class is a pointer to an explicitly shared object.
Definition: shared-ptr.h:39
Tp::BaseCallMuteInterface::create
static SharedPtr< BaseCallMuteInterfaceSubclass > create()
Definition: base-call.h:118
Tp::AbstractCallContentInterface
Base class for all the CallContent object interface implementations.
Definition: base-call.h:45
Tp::BaseCallContentDTMFInterface::StopToneCallback
Callback1< void, DBusError * > StopToneCallback
Definition: base-call.h:171
Tp::BaseCallContentDTMFInterface
Base class for implementations of Call.Content.Interface.DTMF.
Definition: base-call.h:144
Tp::ObjectPathList
Definition: build/TelepathyQt/_gen/types.h:81
Tp::Callback2< void, const Tp::LocalMuteState &, DBusError * >
Tp::DBusError
Small container class, containing a D-Bus error.
Definition: dbus-error.h:35
Tp::MediaStreamDirection
MediaStreamDirection
Definition: build/TelepathyQt/_gen/constants.h:2777
Tp::Callback1< void, DBusError * >
Tp::BaseCallMuteInterface::create
static BaseCallMuteInterfacePtr create()
Definition: base-call.h:114
Tp::BaseCallMuteInterface::SetMuteStateCallback
Callback2< void, const Tp::LocalMuteState &, DBusError * > SetMuteStateCallback
Definition: base-call.h:129
Tp::BaseCallContent
Definition: base-call.h:62
Tp::CallContentDisposition
CallContentDisposition
Definition: build/TelepathyQt/_gen/constants.h:4241
Tp::BaseChannel
Base class for channel implementations.
Definition: base-channel.h:42
Tp::BaseCallContentDTMFInterface::create
static SharedPtr< BaseCallContentDTMFInterfaceSubclass > create()
Definition: base-call.h:154
Tp::BaseCallContentDTMFInterface::StartToneCallback
Callback2< void, uchar, DBusError * > StartToneCallback
Definition: base-call.h:169