summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndre Moreira Magalhaes (andrunko) <andre.magalhaes@collabora.co.uk>2011-04-01 12:17:49 -0300
committerAndre Moreira Magalhaes (andrunko) <andre.magalhaes@collabora.co.uk>2011-04-01 12:17:52 -0300
commit62949c3ab975d7767ee0b2746ef2ac160bc8c5e1 (patch)
treec400e64b25d5b463bde97f1bd64b1168a4859723
parent8cd63c6dfdc1f47dec26705a1b93aab0e2928072 (diff)
parenta063f12ee3cff5e08895cda221d51de6c931c1ae (diff)
Merge remote-tracking branch 'mbatle/callcaps'
Reviewed-by: Andre Moreira Magalhaes (andrunko) <andre.magalhaes@collabora.co.uk>
-rw-r--r--TelepathyQt4Yell/CMakeLists.txt6
-rw-r--r--TelepathyQt4Yell/ContactCapabilities13
-rw-r--r--TelepathyQt4Yell/Models/CMakeLists.txt1
-rw-r--r--TelepathyQt4Yell/Models/accounts-model.cpp6
-rw-r--r--TelepathyQt4Yell/Models/accounts-model.h6
-rw-r--r--TelepathyQt4Yell/Models/contact-model-item.cpp31
-rw-r--r--TelepathyQt4Yell/RequestableChannelClassSpec13
-rw-r--r--TelepathyQt4Yell/contact-capabilities.cpp141
-rw-r--r--TelepathyQt4Yell/contact-capabilities.h62
-rw-r--r--TelepathyQt4Yell/requestable-channel-class-spec.cpp190
-rw-r--r--TelepathyQt4Yell/requestable-channel-class-spec.h55
11 files changed, 517 insertions, 7 deletions
diff --git a/TelepathyQt4Yell/CMakeLists.txt b/TelepathyQt4Yell/CMakeLists.txt
index bfc16b4..37b18de 100644
--- a/TelepathyQt4Yell/CMakeLists.txt
+++ b/TelepathyQt4Yell/CMakeLists.txt
@@ -14,6 +14,8 @@ set(telepathy_qt4_yell_SRCS
channel.cpp
channel-class-spec.cpp
channel-factory.cpp
+ contact-capabilities.cpp
+ requestable-channel-class-spec.cpp
types.cpp)
# Exported headers for Tp-Qt4
@@ -25,15 +27,19 @@ set(telepathy_qt4_yell_HEADERS
ChannelClassSpec
ChannelFactory
Constants
+ ContactCapabilities
Global
PendingCallContent
+ RequestableChannelClassSpec
Types
call-channel.h
channel.h
channel-class-spec.h
channel-factory.h
constants.h
+ contact-capabilities.h
global.h
+ requestable-channel-class-spec.h
types.h)
# Headers file moc will be run on
diff --git a/TelepathyQt4Yell/ContactCapabilities b/TelepathyQt4Yell/ContactCapabilities
new file mode 100644
index 0000000..c3b54d1
--- /dev/null
+++ b/TelepathyQt4Yell/ContactCapabilities
@@ -0,0 +1,13 @@
+#ifndef _TelepathyQt4Yell_ContactCapabilities_HEADER_GUARD_
+#define _TelepathyQt4Yell_ContactCapabilities_HEADER_GUARD_
+
+#ifndef IN_TELEPATHY_QT4_YELL_HEADER
+#define IN_TELEPATHY_QT4_YELL_HEADER
+#endif
+
+#include <TelepathyQt4Yell/contact-capabilities.h>
+
+#undef IN_TELEPATHY_QT4_YELL_HEADER
+
+#endif
+// vim:set ft=cpp:
diff --git a/TelepathyQt4Yell/Models/CMakeLists.txt b/TelepathyQt4Yell/Models/CMakeLists.txt
index ba5dd4b..f8cd446 100644
--- a/TelepathyQt4Yell/Models/CMakeLists.txt
+++ b/TelepathyQt4Yell/Models/CMakeLists.txt
@@ -51,6 +51,7 @@ tpqt4_generate_mocs(${telepathy_qt4_yell_models_MOC_SRCS})
# Create the library
add_library(telepathy-qt4-yell-models STATIC ${telepathy_qt4_yell_models_SRCS} ${telepathy_qt4_yell_models_MOC_SRCS})
+add_dependencies(telepathy-qt4-yell-models telepathy-qt4-yell)
# Link
target_link_libraries(telepathy-qt4-yell-models
diff --git a/TelepathyQt4Yell/Models/accounts-model.cpp b/TelepathyQt4Yell/Models/accounts-model.cpp
index 8a1a395..fb7efff 100644
--- a/TelepathyQt4Yell/Models/accounts-model.cpp
+++ b/TelepathyQt4Yell/Models/accounts-model.cpp
@@ -109,9 +109,15 @@ AccountsModel::AccountsModel(const Tp::AccountManagerPtr &am, QObject *parent)
roles[BlockedRole] = "blocked";
roles[GroupsRole] = "groups";
roles[TextChatCapabilityRole] = "textChat";
+ roles[StreamedMediaCallCapabilityRole] = "streamedMediaCall";
+ roles[StreamedMediaAudioCallCapabilityRole] = "streamedMediaAudioCall";
+ roles[StreamedMediaVideoCallCapabilityRole] = "streamedMediaVideoCall";
+ roles[StreamedMediaVideoCallWithAudioCapabilityRole] = "streamedMediaVideoCallWithAudio";
+ roles[StreamedMediaUpgradeCallCapabilityRole] = "streamedMediaUpgradeCall";
roles[MediaCallCapabilityRole] = "mediaCall";
roles[AudioCallCapabilityRole] = "audioCall";
roles[VideoCallCapabilityRole] = "videoCall";
+ roles[VideoCallWithAudioCapabilityRole] = "videoCallWithAudio";
roles[UpgradeCallCapabilityRole] = "upgradeCall";
roles[FileTransferCapabilityRole] = "fileTransfer";
setRoleNames(roles);
diff --git a/TelepathyQt4Yell/Models/accounts-model.h b/TelepathyQt4Yell/Models/accounts-model.h
index 5da1d98..096d4d0 100644
--- a/TelepathyQt4Yell/Models/accounts-model.h
+++ b/TelepathyQt4Yell/Models/accounts-model.h
@@ -83,9 +83,15 @@ public:
BlockedRole,
GroupsRole,
TextChatCapabilityRole,
+ StreamedMediaCallCapabilityRole,
+ StreamedMediaAudioCallCapabilityRole,
+ StreamedMediaVideoCallCapabilityRole,
+ StreamedMediaVideoCallWithAudioCapabilityRole,
+ StreamedMediaUpgradeCallCapabilityRole,
MediaCallCapabilityRole,
AudioCallCapabilityRole,
VideoCallCapabilityRole,
+ VideoCallWithAudioCapabilityRole,
UpgradeCallCapabilityRole,
FileTransferCapabilityRole,
diff --git a/TelepathyQt4Yell/Models/contact-model-item.cpp b/TelepathyQt4Yell/Models/contact-model-item.cpp
index a06b45f..30c535e 100644
--- a/TelepathyQt4Yell/Models/contact-model-item.cpp
+++ b/TelepathyQt4Yell/Models/contact-model-item.cpp
@@ -23,11 +23,13 @@
#include "TelepathyQt4Yell/Models/_gen/contact-model-item.moc.hpp"
#include <TelepathyQt4Yell/Models/AccountsModel>
+#include <TelepathyQt4Yell/CallChannel>
+#include <TelepathyQt4Yell/ContactCapabilities>
+#include <TelepathyQt4Yell/RequestableChannelClassSpec>
#include <TelepathyQt4/AvatarData>
-#include <TelepathyQt4/ContactCapabilities>
#include <TelepathyQt4/ContactManager>
-#include <TelepathyQt4/RequestableChannelClassSpec>
+#include <TelepathyQt4/ContactCapabilities>
#include <QImage>
@@ -37,11 +39,14 @@ namespace Tpy
struct TELEPATHY_QT4_YELL_MODELS_NO_EXPORT ContactModelItem::Private
{
Private(const Tp::ContactPtr &contact)
- : mContact(contact)
+ : mContact(contact),
+ mCallContactCaps(contact->capabilities().allClassSpecs(),
+ contact->capabilities().isSpecificToContact())
{
}
Tp::ContactPtr mContact;
+ Tpy::ContactCapabilities mCallContactCaps;
};
ContactModelItem::ContactModelItem(const Tp::ContactPtr &contact)
@@ -118,14 +123,26 @@ QVariant ContactModelItem::data(int role) const
return QImage(mPriv->mContact->avatarData().fileName);
case AccountsModel::TextChatCapabilityRole:
return mPriv->mContact->capabilities().textChats();
- case AccountsModel::MediaCallCapabilityRole:
+ case AccountsModel::StreamedMediaCallCapabilityRole:
return mPriv->mContact->capabilities().streamedMediaCalls();
- case AccountsModel::AudioCallCapabilityRole:
+ case AccountsModel::StreamedMediaAudioCallCapabilityRole:
return mPriv->mContact->capabilities().streamedMediaAudioCalls();
- case AccountsModel::VideoCallCapabilityRole:
+ case AccountsModel::StreamedMediaVideoCallCapabilityRole:
return mPriv->mContact->capabilities().streamedMediaVideoCalls();
- case AccountsModel::UpgradeCallCapabilityRole:
+ case AccountsModel::StreamedMediaVideoCallWithAudioCapabilityRole:
+ return mPriv->mContact->capabilities().streamedMediaVideoCallsWithAudio();
+ case AccountsModel::StreamedMediaUpgradeCallCapabilityRole:
return mPriv->mContact->capabilities().upgradingStreamedMediaCalls();
+ case AccountsModel::MediaCallCapabilityRole:
+ return mPriv->mCallContactCaps.mediaCalls();
+ case AccountsModel::AudioCallCapabilityRole:
+ return mPriv->mCallContactCaps.audioCalls();
+ case AccountsModel::VideoCallCapabilityRole:
+ return mPriv->mCallContactCaps.videoCalls();
+ case AccountsModel::VideoCallWithAudioCapabilityRole:
+ return mPriv->mCallContactCaps.videoCallsWithAudio();
+ case AccountsModel::UpgradeCallCapabilityRole:
+ return mPriv->mCallContactCaps.upgradingCalls();
case AccountsModel::FileTransferCapabilityRole: {
foreach (const Tp::RequestableChannelClassSpec &rccSpec, mPriv->mContact->capabilities().allClassSpecs()) {
if (rccSpec.supports(Tp::RequestableChannelClassSpec::fileTransfer())) {
diff --git a/TelepathyQt4Yell/RequestableChannelClassSpec b/TelepathyQt4Yell/RequestableChannelClassSpec
new file mode 100644
index 0000000..efee1dc
--- /dev/null
+++ b/TelepathyQt4Yell/RequestableChannelClassSpec
@@ -0,0 +1,13 @@
+#ifndef _TelepathyQt4Yell_RequestableChannelClassSpec_HEADER_GUARD_
+#define _TelepathyQt4Yell_RequestableChannelClassSpec_HEADER_GUARD_
+
+#ifndef IN_TELEPATHY_QT4_YELL_HEADER
+#define IN_TELEPATHY_QT4_YELL_HEADER
+#endif
+
+#include <TelepathyQt4Yell/requestable-channel-class-spec.h>
+
+#undef IN_TELEPATHY_QT4_YELL_HEADER
+
+#endif
+// vim:set ft=cpp:
diff --git a/TelepathyQt4Yell/contact-capabilities.cpp b/TelepathyQt4Yell/contact-capabilities.cpp
new file mode 100644
index 0000000..528c554
--- /dev/null
+++ b/TelepathyQt4Yell/contact-capabilities.cpp
@@ -0,0 +1,141 @@
+/**
+ * This file is part of TelepathyQt4
+ *
+ * @copyright Copyright (C) 2011 Collabora Ltd. <http://www.collabora.co.uk/>
+ * @license LGPL 2.1
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <TelepathyQt4Yell/Constants>
+#include <TelepathyQt4Yell/ContactCapabilities>
+#include <TelepathyQt4Yell/RequestableChannelClassSpec>
+
+namespace Tpy
+{
+
+/**
+ * \class ContactCapabilities
+ * \ingroup clientconn
+ * \headerfile TelepathyQt4Yell/contact-capabilities.h <TelepathyQt4Yell/ContactCapabilities>
+ *
+ * \brief The ContactCapabilities class provides an object representing the
+ * capabilities of a Contact.
+ */
+
+/**
+ * Construct a new ContactCapabilities object.
+ */
+ContactCapabilities::ContactCapabilities()
+ : Tp::ContactCapabilities()
+{
+}
+
+/**
+ * Construct a new ContactCapabilities object.
+ */
+ContactCapabilities::ContactCapabilities(bool specificToContact)
+ : Tp::ContactCapabilities(specificToContact)
+{
+}
+
+/**
+ * Construct a new ContactCapabilities object using the give \a rccs.
+ *
+ * \param rccs RequestableChannelClassList representing the capabilities of a
+ * contact.
+ */
+ContactCapabilities::ContactCapabilities(const Tp::RequestableChannelClassList &rccs,
+ bool specificToContact)
+ : Tp::ContactCapabilities(rccs, specificToContact)
+{
+}
+
+/**
+ * Construct a new ContactCapabilities object using the give \a rccSpecs.
+ *
+ * \param rccSpecs RequestableChannelClassList representing the capabilities of a
+ * contact.
+ */
+ContactCapabilities::ContactCapabilities(const Tp::RequestableChannelClassSpecList &rccSpecs,
+ bool specificToContact)
+ : Tp::ContactCapabilities(rccSpecs, specificToContact)
+{
+}
+
+/**
+ * Class destructor.
+ */
+ContactCapabilities::~ContactCapabilities()
+{
+}
+
+bool ContactCapabilities::mediaCalls() const
+{
+ foreach (const Tp::RequestableChannelClassSpec &rccSpec, allClassSpecs()) {
+ if (rccSpec.supports(Tpy::RequestableChannelClassSpec::mediaCall())) {
+ return true;
+ }
+ }
+ return false;
+}
+
+bool ContactCapabilities::audioCalls() const
+{
+ foreach (const Tp::RequestableChannelClassSpec &rccSpec, allClassSpecs()) {
+ if (rccSpec.supports(Tpy::RequestableChannelClassSpec::audioCallAllowed()) ||
+ rccSpec.supports(Tpy::RequestableChannelClassSpec::audioCallFixed()) ) {
+ return true;
+ }
+ }
+ return false;
+}
+
+bool ContactCapabilities::videoCalls() const
+{
+ foreach (const Tp::RequestableChannelClassSpec &rccSpec, allClassSpecs()) {
+ if (rccSpec.supports(Tpy::RequestableChannelClassSpec::videoCallAllowed()) ||
+ rccSpec.supports(Tpy::RequestableChannelClassSpec::videoCallFixed())) {
+ return true;
+ }
+ }
+ return false;
+}
+
+bool ContactCapabilities::videoCallsWithAudio() const
+{
+ foreach (const Tp::RequestableChannelClassSpec &rccSpec, allClassSpecs()) {
+ if (rccSpec.supports(Tpy::RequestableChannelClassSpec::videoCallAllowedWithAudioAllowed()) ||
+ rccSpec.supports(Tpy::RequestableChannelClassSpec::videoCallAllowedWithAudioFixed()) ||
+ rccSpec.supports(Tpy::RequestableChannelClassSpec::videoCallFixedWithAudioAllowed()) ||
+ rccSpec.supports(Tpy::RequestableChannelClassSpec::videoCallFixedWithAudioFixed())) {
+ return true;
+ }
+ }
+ return false;
+}
+
+bool ContactCapabilities::upgradingCalls() const
+{
+ foreach (const Tp::RequestableChannelClassSpec &rccSpec, allClassSpecs()) {
+ if (rccSpec.channelType() == TP_QT4_YELL_IFACE_CHANNEL_TYPE_CALL &&
+ rccSpec.allowsProperty(TP_QT4_YELL_IFACE_CHANNEL_TYPE_CALL + QLatin1String(".MutableContents"))) {
+ return true;
+ }
+ }
+ return false;
+}
+
+} // Tpy
diff --git a/TelepathyQt4Yell/contact-capabilities.h b/TelepathyQt4Yell/contact-capabilities.h
new file mode 100644
index 0000000..9ecd058
--- /dev/null
+++ b/TelepathyQt4Yell/contact-capabilities.h
@@ -0,0 +1,62 @@
+/**
+ * This file is part of TelepathyQt4Yell
+ *
+ * @copyright Copyright (C) 2011 Collabora Ltd. <http://www.collabora.co.uk/>
+ * @license LGPL 2.1
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef _TelepathyQt4Yell_contact_capabilities_h_HEADER_GUARD_
+#define _TelepathyQt4Yell_contact_capabilities_h_HEADER_GUARD_
+
+#ifndef IN_TELEPATHY_QT4_YELL_HEADER
+#error IN_TELEPATHY_QT4_YELL_HEADER
+#endif
+
+#include <TelepathyQt4/ContactCapabilities>
+#include <TelepathyQt4/Types>
+#include <TelepathyQt4Yell/Types>
+
+namespace Tpy
+{
+
+class TELEPATHY_QT4_YELL_EXPORT ContactCapabilities : public Tp::ContactCapabilities
+{
+public:
+ ContactCapabilities();
+ virtual ~ContactCapabilities();
+
+ bool mediaCalls() const;
+ bool audioCalls() const;
+ bool videoCalls() const;
+ bool videoCallsWithAudio() const;
+ bool upgradingCalls() const;
+
+protected:
+ friend class ContactModelItem;
+
+ ContactCapabilities(bool specificToContact);
+ ContactCapabilities(const Tp::RequestableChannelClassList &rccs,
+ bool specificToContact);
+ ContactCapabilities(const Tp::RequestableChannelClassSpecList &rccSpecs,
+ bool specificToContact);
+};
+
+} // Tpy
+
+Q_DECLARE_METATYPE(Tpy::ContactCapabilities);
+
+#endif
diff --git a/TelepathyQt4Yell/requestable-channel-class-spec.cpp b/TelepathyQt4Yell/requestable-channel-class-spec.cpp
new file mode 100644
index 0000000..89044b5
--- /dev/null
+++ b/TelepathyQt4Yell/requestable-channel-class-spec.cpp
@@ -0,0 +1,190 @@
+/**
+ * This file is part of TelepathyQt4Yell
+ *
+ * @copyright Copyright (C) 2011 Collabora Ltd. <http://www.collabora.co.uk/>
+ * @license LGPL 2.1
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <TelepathyQt4Yell/Constants>
+#include <TelepathyQt4Yell/RequestableChannelClassSpec>
+
+namespace Tpy
+{
+
+Tp::RequestableChannelClassSpec RequestableChannelClassSpec::mediaCall()
+{
+ static Tp::RequestableChannelClassSpec spec;
+
+ if (!spec.isValid()) {
+ Tp::RequestableChannelClass rcc;
+ rcc.fixedProperties.insert(TP_QT4_IFACE_CHANNEL + QLatin1String(".ChannelType"),
+ TP_QT4_YELL_IFACE_CHANNEL_TYPE_CALL);
+ rcc.fixedProperties.insert(TP_QT4_IFACE_CHANNEL + QLatin1String(".TargetHandleType"),
+ (uint) Tp::HandleTypeContact);
+ spec = Tp::RequestableChannelClassSpec(rcc);
+ }
+
+ return spec;
+}
+
+Tp::RequestableChannelClassSpec RequestableChannelClassSpec::audioCallAllowed()
+{
+ static Tp::RequestableChannelClassSpec spec;
+
+ if (!spec.isValid()) {
+ Tp::RequestableChannelClass rcc;
+ rcc.fixedProperties.insert(TP_QT4_IFACE_CHANNEL + QLatin1String(".ChannelType"),
+ TP_QT4_YELL_IFACE_CHANNEL_TYPE_CALL);
+ rcc.fixedProperties.insert(TP_QT4_IFACE_CHANNEL + QLatin1String(".TargetHandleType"),
+ (uint) Tp::HandleTypeContact);
+ rcc.allowedProperties.append(TP_QT4_YELL_IFACE_CHANNEL_TYPE_CALL + QLatin1String(".InitialAudio"));
+ spec = Tp::RequestableChannelClassSpec(rcc);
+ }
+
+ return spec;
+}
+
+Tp::RequestableChannelClassSpec RequestableChannelClassSpec::audioCallFixed()
+{
+ static Tp::RequestableChannelClassSpec spec;
+
+ if (!spec.isValid()) {
+ Tp::RequestableChannelClass rcc;
+ rcc.fixedProperties.insert(TP_QT4_IFACE_CHANNEL + QLatin1String(".ChannelType"),
+ TP_QT4_YELL_IFACE_CHANNEL_TYPE_CALL);
+ rcc.fixedProperties.insert(TP_QT4_IFACE_CHANNEL + QLatin1String(".TargetHandleType"),
+ (uint) Tp::HandleTypeContact);
+ rcc.fixedProperties.insert(TP_QT4_YELL_IFACE_CHANNEL_TYPE_CALL + QLatin1String(".InitialAudio"),
+ true);
+ spec = Tp::RequestableChannelClassSpec(rcc);
+ }
+
+ return spec;
+}
+
+Tp::RequestableChannelClassSpec RequestableChannelClassSpec::videoCallFixed()
+{
+ static Tp::RequestableChannelClassSpec spec;
+
+ if (!spec.isValid()) {
+ Tp::RequestableChannelClass rcc;
+ rcc.fixedProperties.insert(TP_QT4_IFACE_CHANNEL + QLatin1String(".ChannelType"),
+ TP_QT4_YELL_IFACE_CHANNEL_TYPE_CALL);
+ rcc.fixedProperties.insert(TP_QT4_IFACE_CHANNEL + QLatin1String(".TargetHandleType"),
+ (uint) Tp::HandleTypeContact);
+ rcc.fixedProperties.insert(TP_QT4_YELL_IFACE_CHANNEL_TYPE_CALL + QLatin1String(".InitialVideo"),
+ true);
+ spec = Tp::RequestableChannelClassSpec(rcc);
+ }
+
+ return spec;
+}
+
+Tp::RequestableChannelClassSpec RequestableChannelClassSpec::videoCallAllowed()
+{
+ static Tp::RequestableChannelClassSpec spec;
+
+ if (!spec.isValid()) {
+ Tp::RequestableChannelClass rcc;
+ rcc.fixedProperties.insert(TP_QT4_IFACE_CHANNEL + QLatin1String(".ChannelType"),
+ TP_QT4_YELL_IFACE_CHANNEL_TYPE_CALL);
+ rcc.fixedProperties.insert(TP_QT4_IFACE_CHANNEL + QLatin1String(".TargetHandleType"),
+ (uint) Tp::HandleTypeContact);
+ rcc.allowedProperties.append(TP_QT4_YELL_IFACE_CHANNEL_TYPE_CALL + QLatin1String(".InitialVideo"));
+ spec = Tp::RequestableChannelClassSpec(rcc);
+ }
+
+ return spec;
+}
+
+Tp::RequestableChannelClassSpec RequestableChannelClassSpec::videoCallAllowedWithAudioAllowed()
+{
+ static Tp::RequestableChannelClassSpec spec;
+
+ if (!spec.isValid()) {
+ Tp::RequestableChannelClass rcc;
+ rcc.fixedProperties.insert(TP_QT4_IFACE_CHANNEL + QLatin1String(".ChannelType"),
+ TP_QT4_YELL_IFACE_CHANNEL_TYPE_CALL);
+ rcc.fixedProperties.insert(TP_QT4_IFACE_CHANNEL + QLatin1String(".TargetHandleType"),
+ (uint) Tp::HandleTypeContact);
+ rcc.allowedProperties.append(TP_QT4_YELL_IFACE_CHANNEL_TYPE_CALL + QLatin1String(".InitialAudio"));
+ rcc.allowedProperties.append(TP_QT4_YELL_IFACE_CHANNEL_TYPE_CALL + QLatin1String(".InitialVideo"));
+ spec = Tp::RequestableChannelClassSpec(rcc);
+ }
+
+ return spec;
+}
+
+Tp::RequestableChannelClassSpec RequestableChannelClassSpec::videoCallAllowedWithAudioFixed()
+{
+ static Tp::RequestableChannelClassSpec spec;
+
+ if (!spec.isValid()) {
+ Tp::RequestableChannelClass rcc;
+ rcc.fixedProperties.insert(TP_QT4_IFACE_CHANNEL + QLatin1String(".ChannelType"),
+ TP_QT4_YELL_IFACE_CHANNEL_TYPE_CALL);
+ rcc.fixedProperties.insert(TP_QT4_IFACE_CHANNEL + QLatin1String(".TargetHandleType"),
+ (uint) Tp::HandleTypeContact);
+ rcc.fixedProperties.insert(TP_QT4_YELL_IFACE_CHANNEL_TYPE_CALL + QLatin1String(".InitialAudio"),
+ true);
+ rcc.allowedProperties.append(TP_QT4_YELL_IFACE_CHANNEL_TYPE_CALL + QLatin1String(".InitialVideo"));
+ spec = Tp::RequestableChannelClassSpec(rcc);
+ }
+
+ return spec;
+}
+
+Tp::RequestableChannelClassSpec RequestableChannelClassSpec::videoCallFixedWithAudioAllowed()
+{
+ static Tp::RequestableChannelClassSpec spec;
+
+ if (!spec.isValid()) {
+ Tp::RequestableChannelClass rcc;
+ rcc.fixedProperties.insert(TP_QT4_IFACE_CHANNEL + QLatin1String(".ChannelType"),
+ TP_QT4_YELL_IFACE_CHANNEL_TYPE_CALL);
+ rcc.fixedProperties.insert(TP_QT4_IFACE_CHANNEL + QLatin1String(".TargetHandleType"),
+ (uint) Tp::HandleTypeContact);
+ rcc.fixedProperties.insert(TP_QT4_YELL_IFACE_CHANNEL_TYPE_CALL + QLatin1String(".InitialVideo"),
+ true);
+ rcc.allowedProperties.append(TP_QT4_YELL_IFACE_CHANNEL_TYPE_CALL + QLatin1String(".InitialAudio"));
+ spec = Tp::RequestableChannelClassSpec(rcc);
+ }
+
+ return spec;
+}
+
+Tp::RequestableChannelClassSpec RequestableChannelClassSpec::videoCallFixedWithAudioFixed()
+{
+ static Tp::RequestableChannelClassSpec spec;
+
+ if (!spec.isValid()) {
+ Tp::RequestableChannelClass rcc;
+ rcc.fixedProperties.insert(TP_QT4_IFACE_CHANNEL + QLatin1String(".ChannelType"),
+ TP_QT4_YELL_IFACE_CHANNEL_TYPE_CALL);
+ rcc.fixedProperties.insert(TP_QT4_IFACE_CHANNEL + QLatin1String(".TargetHandleType"),
+ (uint) Tp::HandleTypeContact);
+ rcc.fixedProperties.insert(TP_QT4_YELL_IFACE_CHANNEL_TYPE_CALL + QLatin1String(".InitialVideo"),
+ true);
+ rcc.fixedProperties.insert(TP_QT4_YELL_IFACE_CHANNEL_TYPE_CALL + QLatin1String(".InitialAudio"),
+ true);
+ spec = Tp::RequestableChannelClassSpec(rcc);
+ }
+
+ return spec;
+}
+
+} // Tpy
diff --git a/TelepathyQt4Yell/requestable-channel-class-spec.h b/TelepathyQt4Yell/requestable-channel-class-spec.h
new file mode 100644
index 0000000..5f3380a
--- /dev/null
+++ b/TelepathyQt4Yell/requestable-channel-class-spec.h
@@ -0,0 +1,55 @@
+/**
+ * This file is part of TelepathyQt4Yell
+ *
+ * @copyright Copyright (C) 2011 Collabora Ltd. <http://www.collabora.co.uk/>
+ * @license LGPL 2.1
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef _TelepathyQt4Yell_requestable_channel_class_spec_h_HEADER_GUARD_
+#define _TelepathyQt4Yell_requestable_channel_class_spec_h_HEADER_GUARD_
+
+#ifndef IN_TELEPATHY_QT4_YELL_HEADER
+#error IN_TELEPATHY_QT4_YELL_HEADER
+#endif
+
+#include <TelepathyQt4/Constants>
+#include <TelepathyQt4/Types>
+#include <TelepathyQt4/RequestableChannelClassSpec>
+#include <TelepathyQt4Yell/Types>
+
+namespace Tpy
+{
+
+class TELEPATHY_QT4_YELL_EXPORT RequestableChannelClassSpec : public Tp::RequestableChannelClassSpec
+{
+public:
+ static Tp::RequestableChannelClassSpec mediaCall();
+ static Tp::RequestableChannelClassSpec audioCallAllowed();
+ static Tp::RequestableChannelClassSpec audioCallFixed();
+ static Tp::RequestableChannelClassSpec videoCallAllowed();
+ static Tp::RequestableChannelClassSpec videoCallFixed();
+ static Tp::RequestableChannelClassSpec videoCallAllowedWithAudioAllowed();
+ static Tp::RequestableChannelClassSpec videoCallAllowedWithAudioFixed();
+ static Tp::RequestableChannelClassSpec videoCallFixedWithAudioAllowed();
+ static Tp::RequestableChannelClassSpec videoCallFixedWithAudioFixed();
+};
+
+} // Tpy
+
+Q_DECLARE_METATYPE(Tpy::RequestableChannelClassSpec);
+
+#endif