summaryrefslogtreecommitdiffstats
path: root/src/jsonstream/qjsontokenauthority.h
diff options
context:
space:
mode:
authorChris Craig <craig@ics.com>2012-05-10 18:01:25 -0400
committerChris Craig <craig@ics.com>2013-03-01 03:33:27 +0100
commit6b8d228ab8cc2a424f80d5a76f93d598ffac454f (patch)
tree32ccec5e60ea7b7c87a22d12ffe5ef4b4cceea7a /src/jsonstream/qjsontokenauthority.h
parentf6c2f5c3a36f148cf1654c0fea576282b3c83b1c (diff)
Qt5 release fixes
Modifications to build with the final Qt 5 release. Because the Qt module build process changed a lot, there are a number of changes. Most significantly, all classes are renamed to begin with 'Q', since that's the only way to get syncqt to install them correctly. Change-Id: I987fd426702a49991e930d1670d9c76be994eab9 Reviewed-by: Chris Craig <craig@ics.com>
Diffstat (limited to 'src/jsonstream/qjsontokenauthority.h')
-rw-r--r--src/jsonstream/qjsontokenauthority.h72
1 files changed, 72 insertions, 0 deletions
diff --git a/src/jsonstream/qjsontokenauthority.h b/src/jsonstream/qjsontokenauthority.h
new file mode 100644
index 0000000..be6a576
--- /dev/null
+++ b/src/jsonstream/qjsontokenauthority.h
@@ -0,0 +1,72 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtAddOn.JsonStream module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** 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, Nokia gives you certain additional
+** rights. These rights are described in the Nokia 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.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef JSONTOKENAUTHORITYPROVIDER_H
+#define JSONTOKENAUTHORITYPROVIDER_H
+
+#include <QHash>
+#include "qjsonauthority.h"
+#include "qjsonstream-global.h"
+
+QT_BEGIN_NAMESPACE_JSONSTREAM
+
+class Q_ADDON_JSONSTREAM_EXPORT QJsonTokenAuthority : public QJsonAuthority
+{
+ Q_OBJECT
+public:
+ explicit QJsonTokenAuthority(QObject *parent = 0);
+
+ bool authorize(const QByteArray &token, const QString &applicationIdentifier);
+ bool deauthorize(const QByteArray &token);
+
+ virtual AuthorizationRecord clientConnected(QJsonStream *stream);
+ virtual AuthorizationRecord messageReceived(QJsonStream *stream,
+ const QJsonObject &message);
+
+private:
+ QHash<QByteArray, QString> m_identifierForToken;
+};
+
+QT_END_NAMESPACE_JSONSTREAM
+
+QT_JSONSTREAM_DECLARE_METATYPE_PTR(QJsonTokenAuthority)
+
+#endif // JSONTOKENAUTHORITYPROVIDER_H