Home · Modules · All Classes · All Namespaces
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 
46 {
47  Q_OBJECT
48  Q_DISABLE_COPY(AbstractCallContentInterface)
49 
50 public:
51  AbstractCallContentInterface(const QString &interfaceName);
53 
54 private:
55  friend class BaseCallContent;
56 
57  struct Private;
58  friend struct 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 
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>
120  new BaseCallMuteInterfaceSubclass());
121  }
122  virtual ~BaseCallMuteInterface();
123 
124  Tp::LocalMuteState localMuteState() const;
125  void setMuteState(const Tp::LocalMuteState &state);
126 
128  void setSetMuteStateCallback(const SetMuteStateCallback &cb);
129 Q_SIGNALS:
130  void muteStateChanged(const Tp::LocalMuteState &state);
131 private:
133  void createAdaptor();
134 
135  class Adaptee;
136  friend class Adaptee;
137  struct Private;
138  friend struct Private;
139  Private *mPriv;
140 };
141 
143 {
144  Q_OBJECT
145  Q_DISABLE_COPY(BaseCallContentDTMFInterface)
146 
147 public:
148  static BaseCallContentDTMFInterfacePtr create() {
149  return BaseCallContentDTMFInterfacePtr(new BaseCallContentDTMFInterface());
150  }
151  template<typename BaseCallContentDTMFInterfaceSubclass>
154  new BaseCallContentDTMFInterfaceSubclass());
155  }
156  virtual ~BaseCallContentDTMFInterface();
157 
158  bool currentlySendingTones() const;
159  void setCurrentlySendingTones(bool sendingTones);
160 
161  QString deferredTones() const;
162  void setDeferredTones(const QString &deferredTones);
163 
164 
166  void setStartToneCallback(const StartToneCallback &cb);
168  void setStopToneCallback(const StopToneCallback &cb);
170  void setMultipleTonesCallback(const MultipleTonesCallback &cb);
171 Q_SIGNALS:
172 
173 private:
175  void createAdaptor();
176 
177  class Adaptee;
178  friend class Adaptee;
179  struct Private;
180  friend struct Private;
181  Private *mPriv;
182 };
183 
184 
185 }
186 #endif
Definition: base-call.h:62
Base class for D-Bus services.
Definition: dbus-service.h:46
Base class for channel implementations.
Definition: base-channel.h:42
Callback1< void, DBusError * > StopToneCallback
Definition: base-call.h:167
LocalMuteState
Definition: build/TelepathyQt/_gen/constants.h:4626
static SharedPtr< BaseCallMuteInterfaceSubclass > create()
Definition: base-call.h:118
Callback2< void, const QString &, DBusError * > MultipleTonesCallback
Definition: base-call.h:169
static BaseCallContentPtr create(const QDBusConnection &dbusConnection, BaseChannel *channel, const QString &name, const Tp::MediaStreamType &type, const Tp::MediaStreamDirection &direction)
Definition: base-call.h:68
Callback2< void, uchar, DBusError * > StartToneCallback
Definition: base-call.h:165
Base class for implementations of Call.Interface.Mute.
Definition: base-call.h:108
Base class for D-Bus service interfaces.
Definition: dbus-service.h:73
MediaStreamType
Definition: build/TelepathyQt/_gen/constants.h:2716
Callback2< void, const Tp::LocalMuteState &, DBusError * > SetMuteStateCallback
Definition: base-call.h:127
The SharedPtr class is a pointer to an explicitly shared object.
Definition: shared-ptr.h:39
MediaStreamDirection
Definition: build/TelepathyQt/_gen/constants.h:2777
static SharedPtr< BaseCallContentDTMFInterfaceSubclass > create()
Definition: base-call.h:152
Base class for all the CallContent object interface implementations.
Definition: base-call.h:45
Base class for implementations of Call.Content.Interface.DTMF.
Definition: base-call.h:142
Definition: build/TelepathyQt/_gen/types.h:85
Small container class, containing a D-Bus error.
Definition: dbus-error.h:35
CallContentDisposition
Definition: build/TelepathyQt/_gen/constants.h:4241
static BaseCallMuteInterfacePtr create()
Definition: base-call.h:114
Definition: abstract-adaptor.cpp:31
Base class for all the Channel object interface implementations.
Definition: base-channel.h:97
static BaseCallContentDTMFInterfacePtr create()
Definition: base-call.h:148