• Skip to content
  • Skip to link menu
  • KDE API Reference
  • KDE Home
  • Contact Us
 

Nepomuk-Core

  • KTp
capabilities-hack-private.cpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2012 George Kiagiadakis <kiagiadakis.george@gmail.com>
3 
4  This library is free software; you can redistribute it and/or modify
5  it under the terms of the GNU Lesser General Public License as published
6  by the Free Software Foundation; either version 2.1 of the License, or
7  (at your option) any later version.
8 
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU General Public License for more details.
13 
14  You should have received a copy of the GNU Lesser General Public License
15  along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17 
18 #include "capabilities-hack-private.h"
19 
20 /*
21  * This is a hack to workaround a gabble bug.
22  * https://bugs.freedesktop.org/show_bug.cgi?id=51978
23  */
24 
25 namespace CapabilitiesHackPrivate {
26 
27 static Tp::RequestableChannelClassSpec gabbleAudioCallRCC()
28 {
29  static Tp::RequestableChannelClassSpec spec;
30 
31  if (!spec.isValid()) {
32  Tp::RequestableChannelClass rcc;
33  rcc.fixedProperties.insert(TP_QT_IFACE_CHANNEL + QLatin1String(".ChannelType"),
34  TP_QT_IFACE_CHANNEL_TYPE_CALL);
35  rcc.fixedProperties.insert(TP_QT_IFACE_CHANNEL + QLatin1String(".TargetHandleType"),
36  (uint) Tp::HandleTypeContact);
37  rcc.allowedProperties.append(TP_QT_IFACE_CHANNEL_TYPE_CALL + QLatin1String(".InitialAudio"));
38  rcc.allowedProperties.append(TP_QT_IFACE_CHANNEL_TYPE_CALL + QLatin1String(".InitialAudioName"));
39  spec = Tp::RequestableChannelClassSpec(rcc);
40  }
41 
42  return spec;
43 }
44 
45 static Tp::RequestableChannelClassSpec gabbleVideoCallRCC()
46 {
47  static Tp::RequestableChannelClassSpec spec;
48 
49  if (!spec.isValid()) {
50  Tp::RequestableChannelClass rcc;
51  rcc.fixedProperties.insert(TP_QT_IFACE_CHANNEL + QLatin1String(".ChannelType"),
52  TP_QT_IFACE_CHANNEL_TYPE_CALL);
53  rcc.fixedProperties.insert(TP_QT_IFACE_CHANNEL + QLatin1String(".TargetHandleType"),
54  (uint) Tp::HandleTypeContact);
55  rcc.allowedProperties.append(TP_QT_IFACE_CHANNEL_TYPE_CALL + QLatin1String(".InitialVideo"));
56  rcc.allowedProperties.append(TP_QT_IFACE_CHANNEL_TYPE_CALL + QLatin1String(".InitialVideoName"));
57  spec = Tp::RequestableChannelClassSpec(rcc);
58  }
59 
60  return spec;
61 }
62 
63 bool audioCalls(const Tp::CapabilitiesBase &caps, const QString &cmName)
64 {
65  bool gabbleResult = false;
66  if (cmName == QLatin1String("gabble")) {
67  Q_FOREACH (const Tp::RequestableChannelClassSpec &rccSpec, caps.allClassSpecs()) {
68  if (rccSpec.supports(gabbleAudioCallRCC())) {
69  gabbleResult = true;
70  break;
71  }
72  }
73  }
74 
75  return gabbleResult || caps.audioCalls();
76 }
77 
78 bool videoCalls(const Tp::CapabilitiesBase &caps, const QString &cmName)
79 {
80  bool gabbleResult = false;
81  if (cmName == QLatin1String("gabble")) {
82  Q_FOREACH (const Tp::RequestableChannelClassSpec &rccSpec, caps.allClassSpecs()) {
83  if (rccSpec.supports(gabbleVideoCallRCC())) {
84  gabbleResult = true;
85  break;
86  }
87  }
88  }
89 
90  return gabbleResult || caps.videoCalls();
91 }
92 
93 }
This file is part of the KDE documentation.
Documentation copyright © 1996-2013 The KDE developers.
Generated on Fri Mar 22 2013 10:58:52 by doxygen 1.8.1.2 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

ktp-common-internals API Reference

Skip menu "ktp-common-internals API Reference"
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal