summaryrefslogtreecommitdiff
path: root/src/imports/webchannel/qmlwebchannelattached.h
diff options
context:
space:
mode:
authorMilian Wolff <milian.wolff@kdab.com>2014-01-09 17:21:39 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-01-10 13:09:03 +0100
commit625c881cc74f2552e211b9ba81ac3b0ed30e9947 (patch)
tree246cf6d749138448423bf6b4da17a0306f8c1e0a /src/imports/webchannel/qmlwebchannelattached.h
parentb23442674f1b30d936fca43aee7b7d6dece15b2c (diff)
downloadqtwebchannel-625c881cc74f2552e211b9ba81ac3b0ed30e9947.tar.gz
Add declarative object-registration API to QML WebChannel.
The new registeredObjects list property is now preferred over the old imparative registerObject/registerObjects API. Items that are added to the list need an attached WebChannel.id property which holds the identifier under which the object is published to remote clients. Change-Id: I96a8047b9a85e27f3fd48c900180c22ebd20eb35 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/imports/webchannel/qmlwebchannelattached.h')
-rw-r--r--src/imports/webchannel/qmlwebchannelattached.h67
1 files changed, 67 insertions, 0 deletions
diff --git a/src/imports/webchannel/qmlwebchannelattached.h b/src/imports/webchannel/qmlwebchannelattached.h
new file mode 100644
index 0000000..c705c25
--- /dev/null
+++ b/src/imports/webchannel/qmlwebchannelattached.h
@@ -0,0 +1,67 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
+** Copyright (C) 2014 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Milian Wolff <milian.wolff@kdab.com>
+** Contact: http://www.qt-project.org/legal
+*
+** This file is part of the QtWebChannel module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QMLWEBCHANNELATTACHED_H
+#define QMLWEBCHANNELATTACHED_H
+
+#include <QObject>
+
+class QmlWebChannelAttached : public QObject
+{
+ Q_OBJECT
+
+ Q_PROPERTY( QString id READ id WRITE setId NOTIFY idChanged FINAL )
+public:
+ explicit QmlWebChannelAttached(QObject *parent = 0);
+ virtual ~QmlWebChannelAttached();
+
+ QString id() const;
+ void setId(const QString &id);
+
+signals:
+ void idChanged(const QString &id);
+
+private:
+ QString m_id;
+};
+
+#endif // QMLWEBCHANNELATTACHED_H