summaryrefslogtreecommitdiffstats
path: root/src/nfc/qnearfieldmanager_neard_p.h
diff options
context:
space:
mode:
authorFabian Bumberger <fbumberger@rim.com>2014-06-25 22:56:56 +0200
committerFabian Bumberger <fbumberger@rim.com>2014-07-02 12:42:02 +0200
commit0ea4cc4d1e84b01e589e5e19f0323a2c80503219 (patch)
tree18f007937f93c1eb05495e24562cefa790ba5e15 /src/nfc/qnearfieldmanager_neard_p.h
parentde847406f71a1f5a8bf24b2b3fc99471e62c2901 (diff)
Clean up neard implementation
Besides some code cleanups this patch makes sure to only build the neard implementation if dbus is available. This patch also deals with the possibility that the neard daemon is not running on the system. Change-Id: I8546d34b808d8236e0434e00cf5950b31e20cb72 Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
Diffstat (limited to 'src/nfc/qnearfieldmanager_neard_p.h')
-rw-r--r--src/nfc/qnearfieldmanager_neard_p.h95
1 files changed, 95 insertions, 0 deletions
diff --git a/src/nfc/qnearfieldmanager_neard_p.h b/src/nfc/qnearfieldmanager_neard_p.h
new file mode 100644
index 00000000..4984a531
--- /dev/null
+++ b/src/nfc/qnearfieldmanager_neard_p.h
@@ -0,0 +1,95 @@
+/***************************************************************************
+**
+** Copyright (C) 2014 BlackBerry Limited. All rights reserved.
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the QtNfc 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 QNEARFIELDMANAGER_NEARD_H
+#define QNEARFIELDMANAGER_NEARD_H
+
+#include "qnearfieldmanager_p.h"
+#include "qnearfieldmanager.h"
+#include "qnearfieldtarget.h"
+
+#include <QDBusObjectPath>
+#include <QDBusVariant>
+
+class OrgNeardAdapterInterface;
+class OrgNeardManagerInterface;
+
+QT_BEGIN_NAMESPACE
+
+class QNearFieldManagerPrivateImpl : public QNearFieldManagerPrivate
+{
+ Q_OBJECT
+
+public:
+ QNearFieldManagerPrivateImpl();
+ ~QNearFieldManagerPrivateImpl();
+
+ bool isAvailable() const;
+
+ bool startTargetDetection();
+
+ void stopTargetDetection();
+
+ int registerNdefMessageHandler(QObject *object, const QMetaMethod &method);
+
+ int registerNdefMessageHandler(const QNdefFilter &filter, QObject *object, const QMetaMethod &method);
+
+ bool unregisterNdefMessageHandler(int handlerId);
+
+ void requestAccess(QNearFieldManager::TargetAccessModes accessModes);
+
+ void releaseAccess(QNearFieldManager::TargetAccessModes accessModes);
+
+private Q_SLOTS:
+ void tagFound(const QDBusObjectPath&);
+ void propertyChanged(QString,QDBusVariant);
+
+private:
+ QString m_adapterPath;
+ OrgNeardAdapterInterface *m_adapter;
+ OrgNeardManagerInterface *m_manager;
+
+};
+
+QT_END_NAMESPACE
+
+
+#endif // QNEARFIELDMANAGER_NEARD_H