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
qiosnfcndefsessiondelegate_p.h
Go to the documentation of this file.
1// Copyright (C) 2022 The Qt Company Ltd.
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 QIOSNFCNDEFSESSIONDELEFATE_P_H
5#define QIOSNFCNDEFSESSIONDELEFATE_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
18#include <QtCore/qglobal.h>
19
20#include <QtCore/private/qcore_mac_p.h>
21
24
25#include <Foundation/Foundation.h>
26#include <CoreNFC/CoreNFC.h>
27
28QT_BEGIN_NAMESPACE
29
30class QNearFieldManagerPrivateImpl;
32class QNearFieldTarget;
33class QNdefMessage;
34class QString;
35
37
38QT_END_NAMESPACE
39
40QT_USE_NAMESPACE
41
42@interface QT_MANGLE_NAMESPACE(QIosNfcNdefSessionDelegate) : NSObject<NFCNDEFReaderSessionDelegate>
43
44@property (strong, nonatomic) NFCNDEFReaderSession *session;
45@property (strong, nonatomic) id<NFCNDEFTag> ndefTag;
46
47
48-(instancetype)initWithNotifier:(QNfcNdefNotifier *)aNotifier;
49-(void)dealloc;
50
51-(QNfcNdefNotifier *)ndefNotifier;
52
53-(void)setAlertMessage:(const QString &)message;
54
55// Those methods to be called on the session.sessionQueue:
56-(bool)startSession;
57-(void)stopSession:(const QString &)message;
58-(void)abort;
59
60// Delegate's methods, implementing the protocol NFCNDEFReaderSessionDelegate.
61// Those methods not to be called by the Qt.
62
63// "Gets called when a session becomes invalid. At this point the client is expected to
64// discard the returned session object."
65-(void)readerSession:(NFCNDEFReaderSession *)session
66 didInvalidateWithError:(NSError *)error;
67
68// "Gets called when the reader detects NFC tag(s) with NDEF messages in the polling sequence.
69// Polling is automatically restarted once the detected tag is removed from the reader's read
70// range. This method is only get call if the optional -readerSession:didDetectTags: method
71// is not implemented."
72-(void)readerSession:(NFCNDEFReaderSession *)session
73 didDetectNDEFs:(NSArray<NFCNDEFMessage *> *)messages;
74
75// "Gets called when the reader detects NDEF tag(s) in the RF field. Presence of this method
76// overrides -readerSession:didDetectNDEFs: and enables read-write capability for the session."
77-(void)readerSession:(NFCNDEFReaderSession *)session
78 didDetectTags:(NSArray<__kindof id<NFCNDEFTag>> *)tags;
79
80// "Gets called when the NFC reader session has become active. RF is enabled and reader is
81// scanning for tags."
82-(void)readerSessionDidBecomeActive:(NFCNDEFReaderSession *)session;
83
84@end
85
86QT_NAMESPACE_ALIAS_OBJC_CLASS(QIosNfcNdefSessionDelegate);
87
88#endif // QIOSNFCNDEFSESSIONDELEFATE_P_H
dispatch_queue_t qt_Nfc_Queue()