Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qnearfieldmanager_ios_p.h
Go to the documentation of this file.
1// Copyright (C) 2020 Governikus GmbH & Co. KG
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QNEARFIELDMANAGER_IOS_P_H
5#define QNEARFIELDMANAGER_IOS_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17#include <QtCore/private/qcore_mac_p.h>
18
20
21#include <QPointer>
22#include <QTimer>
23
24#import <os/availability.h>
25
26Q_FORWARD_DECLARE_OBJC_CLASS(QT_MANGLE_NAMESPACE(QIosTagReaderDelegate));
27
28Q_FORWARD_DECLARE_OBJC_CLASS(QT_MANGLE_NAMESPACE(QIosNfcNdefSessionDelegate));
30
31QT_BEGIN_NAMESPACE
32
33class QNearFieldTargetPrivateImpl;
34
36{
38
39public:
42
43 bool isEnabled() const override
44 {
45 return true;
46 }
47
48 bool isSupported(QNearFieldTarget::AccessMethod accessMethod) const override;
49
50 bool startTargetDetection(QNearFieldTarget::AccessMethod accessMethod) override;
51 void stopTargetDetection(const QString &errorMessage) override;
52
53 void setUserInformation(const QString &message) override;
54
56 void tagDiscovered(void *tag);
57 void didInvalidateWithError(bool doRestart);
58
59private:
60 QT_MANGLE_NAMESPACE(QIosTagReaderDelegate) *delegate API_AVAILABLE(ios(13.0)) = nullptr;
61 QIosNfcNdefSessionDelegate *ndefDelegate = nullptr;
62 bool detectionRunning = false;
63 bool isSessionScheduled = false;
64 QTimer sessionTimer;
65 QList<QPointer<QNearFieldTargetPrivateImpl>> detectedTargets;
67
68 bool scheduleSession(QNearFieldTarget::AccessMethod accessMethod);
69 void startSession();
70 bool startNdefSession();
71 void stopSession(const QString &error);
72 void stopNdefSession(const QString &error);
73 void clearTargets();
74
75private Q_SLOTS:
76 void onTagDiscovered(void *target);
77 void onTargetLost(QNearFieldTargetPrivateImpl *target);
78 void onDidInvalidateWithError(bool doRestart);
79 void onSessionTimer();
80};
81
82
83QT_END_NAMESPACE
84
85#endif // QNEARFIELDMANAGER_IOS_P_H
void didInvalidateWithError(bool doRestart)
bool isSupported(QNearFieldTarget::AccessMethod accessMethod) const override
bool startTargetDetection(QNearFieldTarget::AccessMethod accessMethod) override
void setUserInformation(const QString &message) override
void stopTargetDetection(const QString &errorMessage) override
API_AVAILABLE(ios(13.4)) Qt
Q_FORWARD_DECLARE_OBJC_CLASS(QT_MANGLE_NAMESPACE(RunLoopModeTracker))
QT_NAMESPACE_ALIAS_OBJC_CLASS(QIosNfcNdefSessionDelegate)