Home · Modules · All Classes · All Namespaces
requestable-channel-class-spec.h
1 
23 #ifndef _TelepathyQt_requestable_channel_class_spec_h_HEADER_GUARD_
24 #define _TelepathyQt_requestable_channel_class_spec_h_HEADER_GUARD_
25 
26 #ifndef IN_TP_QT_HEADER
27 #error IN_TP_QT_HEADER
28 #endif
29 
30 #include <TelepathyQt/Constants>
31 #include <TelepathyQt/Types>
32 
33 namespace Tp
34 {
35 
36 class TP_QT_EXPORT RequestableChannelClassSpec
37 {
38 public:
43 
44  static RequestableChannelClassSpec textChat();
45  static RequestableChannelClassSpec textChatroom();
46 
47  static RequestableChannelClassSpec audioCall();
48  static RequestableChannelClassSpec audioCallWithVideoAllowed();
49  static RequestableChannelClassSpec videoCall();
50  static RequestableChannelClassSpec videoCallWithAudioAllowed();
51 
52  TP_QT_DEPRECATED static RequestableChannelClassSpec streamedMediaCall();
53  TP_QT_DEPRECATED static RequestableChannelClassSpec streamedMediaAudioCall();
54  TP_QT_DEPRECATED static RequestableChannelClassSpec streamedMediaVideoCall();
55  TP_QT_DEPRECATED static RequestableChannelClassSpec streamedMediaVideoCallWithAudio();
56 
57  static RequestableChannelClassSpec fileTransfer();
58 
59  static RequestableChannelClassSpec conferenceTextChat();
60  static RequestableChannelClassSpec conferenceTextChatWithInvitees();
61  static RequestableChannelClassSpec conferenceTextChatroom();
62  static RequestableChannelClassSpec conferenceTextChatroomWithInvitees();
63  TP_QT_DEPRECATED static RequestableChannelClassSpec conferenceStreamedMediaCall();
64  TP_QT_DEPRECATED static RequestableChannelClassSpec conferenceStreamedMediaCallWithInvitees();
65 
66  static RequestableChannelClassSpec contactSearch();
67  static RequestableChannelClassSpec contactSearchWithSpecificServer();
68  static RequestableChannelClassSpec contactSearchWithLimit();
69  static RequestableChannelClassSpec contactSearchWithSpecificServerAndLimit();
70 
71  static RequestableChannelClassSpec dbusTube(const QString &serviceName = QString());
72  static RequestableChannelClassSpec streamTube(const QString &service = QString());
73 
74  bool isValid() const { return mPriv.constData() != 0; }
75 
77  bool operator==(const RequestableChannelClassSpec &other) const;
78 
79  bool supports(const RequestableChannelClassSpec &spec) const;
80 
81  QString channelType() const;
82 
83  bool hasTargetHandleType() const;
84  HandleType targetHandleType() const;
85 
86  bool hasFixedProperty(const QString &name) const;
87  QVariant fixedProperty(const QString &name) const;
88  QVariantMap fixedProperties() const;
89 
90  bool allowsProperty(const QString &name) const;
91  QStringList allowedProperties() const;
92 
93  RequestableChannelClass bareClass() const;
94 
95 private:
96  struct Private;
97  friend struct Private;
98  QSharedDataPointer<Private> mPriv;
99 };
100 
102  public QList<RequestableChannelClassSpec>
103 {
104 public:
107  {
108  append(RequestableChannelClassSpec(rcc));
109  }
111  {
112  Q_FOREACH (const RequestableChannelClass &rcc, rccs) {
113  append(RequestableChannelClassSpec(rcc));
114  }
115  }
117  {
118  append(rccSpec);
119  }
120  RequestableChannelClassSpecList(const QList<RequestableChannelClassSpec> &other)
121  : QList<RequestableChannelClassSpec>(other)
122  {
123  }
124 
126  {
128  Q_FOREACH (const RequestableChannelClassSpec &rccSpec, *this) {
129  list.append(rccSpec.bareClass());
130  }
131  return list;
132  }
133 };
134 
135 } // Tp
136 
137 Q_DECLARE_METATYPE(Tp::RequestableChannelClassSpec)
138 Q_DECLARE_METATYPE(Tp::RequestableChannelClassSpecList)
139 
140 #endif
bool operator==(const SUSocketAddress &v1, const SUSocketAddress &v2)
Definition: types.cpp:50
RequestableChannelClassSpecList(const QList< RequestableChannelClassSpec > &other)
Definition: requestable-channel-class-spec.h:120
bool isValid() const
Definition: requestable-channel-class-spec.h:74
The RequestableChannelClassSpecList class represents a list of RequestableChannelClassSpec.
Definition: requestable-channel-class-spec.h:101
Definition: build/TelepathyQt/_gen/types.h:2588
RequestableChannelClassSpecList(const RequestableChannelClassSpec &rccSpec)
Definition: requestable-channel-class-spec.h:116
RequestableChannelClassSpecList()
Definition: requestable-channel-class-spec.h:105
HandleType
Definition: build/TelepathyQt/_gen/constants.h:1375
The RequestableChannelClassSpec class represents a Telepathy requestable channel class.
Definition: requestable-channel-class-spec.h:36
RequestableChannelClassList bareClasses() const
Definition: requestable-channel-class-spec.h:125
RequestableChannelClass bareClass() const
Definition: requestable-channel-class-spec.cpp:583
RequestableChannelClassSpecList(const RequestableChannelClass &rcc)
Definition: requestable-channel-class-spec.h:106
Definition: abstract-adaptor.cpp:31
QList< RequestableChannelClass > RequestableChannelClassList
Definition: build/TelepathyQt/_gen/types.h:2664
RequestableChannelClassSpecList(const RequestableChannelClassList &rccs)
Definition: requestable-channel-class-spec.h:110