Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qpcscmanager_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 QPCSCMANAGER_P_H
5#define QPCSCMANAGER_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 "qpcsc_p.h"
19#include "qnearfieldtarget.h"
20
22
23class QPcscSlot;
24class QPcscCard;
25class QTimer;
26
27class QPcscManager : public QObject
28{
30public:
31 explicit QPcscManager(QObject *parent = nullptr);
32 ~QPcscManager() override;
33
35
36private:
37 QTimer *m_stateUpdateTimer;
38 bool m_targetDetectionRunning = false;
39 bool m_hasContext = false;
40 SCARDCONTEXT m_context;
41 QMap<QPcscSlotName, QPcscSlot *> m_slots;
42 QList<SCARD_READERSTATE> m_slotStates;
43 QNearFieldTarget::AccessMethod m_requestedMethod;
44
45 [[nodiscard]] bool establishContext();
46 void processSlotUpdates();
47 void updateSlotList();
48 void removeSlots();
49 void retryCardDetection(const QPcscSlot *slot);
50
51public Q_SLOTS:
54
55private Q_SLOTS:
56 void onStateUpdate();
57
59 void cardInserted(QPcscCard *card, const QByteArray &uid,
60 QNearFieldTarget::AccessMethods accessMethods, int maxInputLength);
61};
62
64
65#endif // QPCSCMANAGER_P_H
\inmodule QtCore
Definition qbytearray.h:57
AccessMethod
This enum describes the access methods a near field target supports.
\inmodule QtCore
Definition qobject.h:103
QObject * parent() const
Returns a pointer to the parent object.
Definition qobject.h:346
void onStartTargetDetectionRequest(QNearFieldTarget::AccessMethod accessMethod)
QPcscManager(QObject *parent=nullptr)
void onStopTargetDetectionRequest()
~QPcscManager() override
void cardInserted(QPcscCard *card, const QByteArray &uid, QNearFieldTarget::AccessMethods accessMethods, int maxInputLength)
QPcscCard * connectToCard(QPcscSlot *slot)
\inmodule QtCore
Definition qtimer.h:20
Combined button and popup list for selecting options.
#define Q_OBJECT
#define Q_SLOTS
#define Q_SIGNALS