summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Gehre <M.Gehre@gmx.de>2013-03-10 03:08:19 (GMT)
committerDavid Edmundson <davidedmundson@kde.org>2014-06-14 11:51:54 (GMT)
commita0fc3be57195981af30c7efeace625f3cccb6f1d (patch)
tree0ea25172e7870faa908a83d5a1ea23f31a1682b8
parent5dd4aba91e38fa3c3d4000136ce75ee3a2cfec74 (diff)
downloadtelepathy-qt4-a0fc3be57195981af30c7efeace625f3cccb6f1d.tar.gz
telepathy-qt4-a0fc3be57195981af30c7efeace625f3cccb6f1d.tar.xz
Add BaseChannelServerAuthenticationType
-rw-r--r--TelepathyQt/base-channel-internal.h12
-rw-r--r--TelepathyQt/base-channel.cpp72
-rw-r--r--TelepathyQt/base-channel.h30
-rw-r--r--TelepathyQt/service-types.h2
4 files changed, 116 insertions, 0 deletions
diff --git a/TelepathyQt/base-channel-internal.h b/TelepathyQt/base-channel-internal.h
index bd010c2..37a3ba5 100644
--- a/TelepathyQt/base-channel-internal.h
+++ b/TelepathyQt/base-channel-internal.h
@@ -156,4 +156,16 @@ public:
BaseChannelMessagesInterface *mInterface;
};
+class TP_QT_NO_EXPORT BaseChannelServerAuthenticationType::Adaptee : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(QString authenticationMethod READ authenticationMethod)
+public:
+ Adaptee(BaseChannelServerAuthenticationType *interface);
+ ~Adaptee();
+ QString authenticationMethod() const;
+public:
+ BaseChannelServerAuthenticationType *mInterface;
+};
+
}
diff --git a/TelepathyQt/base-channel.cpp b/TelepathyQt/base-channel.cpp
index 93f73aa..676fdf3 100644
--- a/TelepathyQt/base-channel.cpp
+++ b/TelepathyQt/base-channel.cpp
@@ -729,5 +729,77 @@ QString BaseChannelMessagesInterface::sendMessage(const Tp::MessagePartList &mes
}
+//Chan.T.ServerAuthentication
+BaseChannelServerAuthenticationType::Adaptee::Adaptee(BaseChannelServerAuthenticationType *interface)
+ : QObject(interface),
+ mInterface(interface)
+{
+}
+
+BaseChannelServerAuthenticationType::Adaptee::~Adaptee()
+{
+}
+
+struct TP_QT_NO_EXPORT BaseChannelServerAuthenticationType::Private {
+ Private(BaseChannelServerAuthenticationType *parent, const QString& authenticationMethod)
+ : authenticationMethod(authenticationMethod),
+ adaptee(new BaseChannelServerAuthenticationType::Adaptee(parent)) {
+ }
+ QString authenticationMethod;
+ BaseChannelServerAuthenticationType::Adaptee *adaptee;
+};
+
+QString BaseChannelServerAuthenticationType::Adaptee::authenticationMethod() const
+{
+ return mInterface->mPriv->authenticationMethod;
+}
+
+/**
+ * \class BaseChannelServerAuthenticationType
+ * \ingroup servicecm
+ * \headerfile TelepathyQt/base-channel.h <TelepathyQt/BaseChannel>
+ *
+ * \brief Base class for implementations of Channel.Type.ServerAuthentifcation
+ *
+ */
+
+/**
+ * Class constructor.
+ */
+BaseChannelServerAuthenticationType::BaseChannelServerAuthenticationType(const QString& authenticationMethod)
+ : AbstractChannelInterface(TP_QT_IFACE_CHANNEL_TYPE_SERVER_AUTHENTICATION),
+ mPriv(new Private(this, authenticationMethod))
+{
+}
+
+/**
+ * Class destructor.
+ */
+BaseChannelServerAuthenticationType::~BaseChannelServerAuthenticationType()
+{
+ delete mPriv;
+}
+
+/**
+ * Return the immutable properties of this interface.
+ *
+ * Immutable properties cannot change after the interface has been registered
+ * on a service on the bus with registerInterface().
+ *
+ * \return The immutable properties of this interface.
+ */
+QVariantMap BaseChannelServerAuthenticationType::immutableProperties() const
+{
+ QVariantMap map;
+ map.insert(TP_QT_IFACE_CHANNEL_TYPE_SERVER_AUTHENTICATION + QLatin1String(".AuthenticationMethod"),
+ QVariant::fromValue(mPriv->adaptee->authenticationMethod()));
+ return map;
+}
+
+void BaseChannelServerAuthenticationType::createAdaptor()
+{
+ (void) new Service::ChannelTypeServerAuthenticationAdaptor(dbusObject()->dbusConnection(),
+ mPriv->adaptee, dbusObject());
+}
}
diff --git a/TelepathyQt/base-channel.h b/TelepathyQt/base-channel.h
index 0f39a70..0ec421d 100644
--- a/TelepathyQt/base-channel.h
+++ b/TelepathyQt/base-channel.h
@@ -212,5 +212,35 @@ private:
Private *mPriv;
};
+class TP_QT_EXPORT BaseChannelServerAuthenticationType : public AbstractChannelInterface
+{
+ Q_OBJECT
+ Q_DISABLE_COPY(BaseChannelServerAuthenticationType)
+
+public:
+ static BaseChannelServerAuthenticationTypePtr create(const QString &authenticationMethod) {
+ return BaseChannelServerAuthenticationTypePtr(new BaseChannelServerAuthenticationType(authenticationMethod));
+ }
+ template<typename BaseChannelServerAuthenticationTypeSubclass>
+ static SharedPtr<BaseChannelServerAuthenticationTypeSubclass> create(const QString &authenticationMethod) {
+ return SharedPtr<BaseChannelServerAuthenticationTypeSubclass>(
+ new BaseChannelServerAuthenticationTypeSubclass(authenticationMethod));
+ }
+ virtual ~BaseChannelServerAuthenticationType();
+
+ QVariantMap immutableProperties() const;
+private Q_SLOTS:
+private:
+ BaseChannelServerAuthenticationType(const QString &authenticationMethod);
+ void createAdaptor();
+
+ class Adaptee;
+ friend class Adaptee;
+ struct Private;
+ friend struct Private;
+ Private *mPriv;
+};
+
+
}
#endif
diff --git a/TelepathyQt/service-types.h b/TelepathyQt/service-types.h
index 80cb170..ae77021 100644
--- a/TelepathyQt/service-types.h
+++ b/TelepathyQt/service-types.h
@@ -49,6 +49,7 @@ class BaseProtocolPresenceInterface;
class BaseChannel;
class BaseChannelTextType;
class BaseChannelMessagesInterface;
+class BaseChannelServerAuthenticationType;
class DBusService;
#ifndef DOXYGEN_SHOULD_SKIP_THIS
@@ -70,6 +71,7 @@ typedef SharedPtr<BaseProtocolPresenceInterface> BaseProtocolPresenceInterfacePt
typedef SharedPtr<BaseChannel> BaseChannelPtr;
typedef SharedPtr<BaseChannelTextType> BaseChannelTextTypePtr;
typedef SharedPtr<BaseChannelMessagesInterface> BaseChannelMessagesInterfacePtr;
+typedef SharedPtr<BaseChannelServerAuthenticationType> BaseChannelServerAuthenticationTypePtr;
typedef SharedPtr<DBusService> DBusServicePtr;
#endif /* DOXYGEN_SHOULD_SKIP_THIS */