1bc2ed2b3Sopenharmony_ci/*
2bc2ed2b3Sopenharmony_ci * Copyright (C) 2022 Huawei Device Co., Ltd.
3bc2ed2b3Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License");
4bc2ed2b3Sopenharmony_ci * you may not use this file except in compliance with the License.
5bc2ed2b3Sopenharmony_ci * You may obtain a copy of the License at
6bc2ed2b3Sopenharmony_ci *
7bc2ed2b3Sopenharmony_ci *     http://www.apache.org/licenses/LICENSE-2.0
8bc2ed2b3Sopenharmony_ci *
9bc2ed2b3Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software
10bc2ed2b3Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
11bc2ed2b3Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12bc2ed2b3Sopenharmony_ci * See the License for the specific language governing permissions and
13bc2ed2b3Sopenharmony_ci * limitations under the License.
14bc2ed2b3Sopenharmony_ci */
15bc2ed2b3Sopenharmony_ci#ifndef I_NFC_SERVICE_H
16bc2ed2b3Sopenharmony_ci#define I_NFC_SERVICE_H
17bc2ed2b3Sopenharmony_ci#include "element_name.h"
18bc2ed2b3Sopenharmony_ci#include "iforeground_callback.h"
19bc2ed2b3Sopenharmony_ci
20bc2ed2b3Sopenharmony_cinamespace OHOS {
21bc2ed2b3Sopenharmony_cinamespace NFC {
22bc2ed2b3Sopenharmony_cinamespace TAG {
23bc2ed2b3Sopenharmony_ci    class TagDispatcher;
24bc2ed2b3Sopenharmony_ci#ifdef NDEF_WIFI_ENABLED
25bc2ed2b3Sopenharmony_ci    class WifiConnectionManager;
26bc2ed2b3Sopenharmony_ci#endif
27bc2ed2b3Sopenharmony_ci#ifdef NDEF_BT_ENABLED
28bc2ed2b3Sopenharmony_ci    class BtConnectionManager;
29bc2ed2b3Sopenharmony_ci#endif
30bc2ed2b3Sopenharmony_ci}
31bc2ed2b3Sopenharmony_ciclass NfcEventHandler;
32bc2ed2b3Sopenharmony_ciclass NfcPollingManager;
33bc2ed2b3Sopenharmony_ciclass NfcRoutingManager;
34bc2ed2b3Sopenharmony_ciclass CeService;
35bc2ed2b3Sopenharmony_cienum class NfcCommonEvent {
36bc2ed2b3Sopenharmony_ci    // tags found
37bc2ed2b3Sopenharmony_ci    MSG_TAG_FOUND = 0,
38bc2ed2b3Sopenharmony_ci    MSG_TAG_DEBOUNCE,
39bc2ed2b3Sopenharmony_ci    MSG_TAG_LOST,
40bc2ed2b3Sopenharmony_ci
41bc2ed2b3Sopenharmony_ci    // screen changed
42bc2ed2b3Sopenharmony_ci    MSG_SCREEN_CHANGED,
43bc2ed2b3Sopenharmony_ci
44bc2ed2b3Sopenharmony_ci    // package updated
45bc2ed2b3Sopenharmony_ci    MSG_PACKAGE_UPDATED,
46bc2ed2b3Sopenharmony_ci
47bc2ed2b3Sopenharmony_ci    // card emulation
48bc2ed2b3Sopenharmony_ci    MSG_ROUTE_AID,
49bc2ed2b3Sopenharmony_ci    MSG_COMMIT_ROUTING,
50bc2ed2b3Sopenharmony_ci    MSG_COMPUTE_ROUTING_PARAMS,
51bc2ed2b3Sopenharmony_ci
52bc2ed2b3Sopenharmony_ci    // field activated
53bc2ed2b3Sopenharmony_ci    MSG_FIELD_ACTIVATED,
54bc2ed2b3Sopenharmony_ci
55bc2ed2b3Sopenharmony_ci    // field deactivated
56bc2ed2b3Sopenharmony_ci    MSG_FIELD_DEACTIVATED,
57bc2ed2b3Sopenharmony_ci
58bc2ed2b3Sopenharmony_ci    // notify field on
59bc2ed2b3Sopenharmony_ci    MSG_NOTIFY_FIELD_ON,
60bc2ed2b3Sopenharmony_ci
61bc2ed2b3Sopenharmony_ci    // notify field off
62bc2ed2b3Sopenharmony_ci    MSG_NOTIFY_FIELD_OFF,
63bc2ed2b3Sopenharmony_ci    MSG_NOTIFY_FIELD_OFF_TIMEOUT,
64bc2ed2b3Sopenharmony_ci
65bc2ed2b3Sopenharmony_ci    // device shutdown
66bc2ed2b3Sopenharmony_ci    MSG_SHUTDOWN,
67bc2ed2b3Sopenharmony_ci
68bc2ed2b3Sopenharmony_ci    // datashare ready
69bc2ed2b3Sopenharmony_ci    MSG_DATA_SHARE_READY,
70bc2ed2b3Sopenharmony_ci
71bc2ed2b3Sopenharmony_ci#ifdef VENDOR_APPLICATIONS_ENABLED
72bc2ed2b3Sopenharmony_ci    // vendor event
73bc2ed2b3Sopenharmony_ci    MSG_VENDOR_EVENT,
74bc2ed2b3Sopenharmony_ci#endif
75bc2ed2b3Sopenharmony_ci#ifdef NDEF_WIFI_ENABLED
76bc2ed2b3Sopenharmony_ci    // for connect wifi by ndef wifi tag
77bc2ed2b3Sopenharmony_ci    MSG_WIFI_ENABLE_TIMEOUT,
78bc2ed2b3Sopenharmony_ci    MSG_WIFI_CONNECT_TIMEOUT,
79bc2ed2b3Sopenharmony_ci    MSG_WIFI_ENABLED,
80bc2ed2b3Sopenharmony_ci    MSG_WIFI_CONNECTED,
81bc2ed2b3Sopenharmony_ci    MSG_WIFI_NTF_CLICKED,
82bc2ed2b3Sopenharmony_ci#endif
83bc2ed2b3Sopenharmony_ci#ifdef NDEF_BT_ENABLED
84bc2ed2b3Sopenharmony_ci    // for connect BT by ndef bt tag
85bc2ed2b3Sopenharmony_ci    MSG_BT_ENABLE_TIMEOUT,
86bc2ed2b3Sopenharmony_ci    MSG_BT_PAIR_TIMEOUT,
87bc2ed2b3Sopenharmony_ci    MSG_BT_CONNECT_TIMEOUT,
88bc2ed2b3Sopenharmony_ci    MSG_BT_ENABLED,
89bc2ed2b3Sopenharmony_ci    MSG_BT_PAIR_STATUS_CHANGED,
90bc2ed2b3Sopenharmony_ci    MSG_BT_CONNECT_STATUS_CHANGED,
91bc2ed2b3Sopenharmony_ci    MSG_BT_NTF_CLICKED,
92bc2ed2b3Sopenharmony_ci#endif
93bc2ed2b3Sopenharmony_ci};
94bc2ed2b3Sopenharmony_ci
95bc2ed2b3Sopenharmony_cienum class ScreenState {
96bc2ed2b3Sopenharmony_ci    SCREEN_STATE_UNKNOWN = 0x00,
97bc2ed2b3Sopenharmony_ci    SCREEN_STATE_OFF_UNLOCKED = 0x01,
98bc2ed2b3Sopenharmony_ci    SCREEN_STATE_OFF_LOCKED = 0x02,
99bc2ed2b3Sopenharmony_ci    SCREEN_STATE_ON_LOCKED = 0x04,
100bc2ed2b3Sopenharmony_ci    SCREEN_STATE_ON_UNLOCKED = 0x08,
101bc2ed2b3Sopenharmony_ci    // Polling mask
102bc2ed2b3Sopenharmony_ci    SCREEN_POLLING_TAG_MASK = 0x10,
103bc2ed2b3Sopenharmony_ci    SCREEN_POLLING_READER_MASK = 0x40
104bc2ed2b3Sopenharmony_ci};
105bc2ed2b3Sopenharmony_ci
106bc2ed2b3Sopenharmony_ciclass INfcService {
107bc2ed2b3Sopenharmony_cipublic:
108bc2ed2b3Sopenharmony_ci    virtual ~INfcService() {}
109bc2ed2b3Sopenharmony_ci
110bc2ed2b3Sopenharmony_ci    virtual bool IsNfcEnabled() = 0;
111bc2ed2b3Sopenharmony_ci    virtual int GetNfcState() = 0;
112bc2ed2b3Sopenharmony_ci    virtual int GetScreenState() = 0;
113bc2ed2b3Sopenharmony_ci    virtual int GetNciVersion() = 0;
114bc2ed2b3Sopenharmony_ci    virtual std::weak_ptr<TAG::TagDispatcher> GetTagDispatcher() = 0;
115bc2ed2b3Sopenharmony_ci    virtual std::weak_ptr<NfcPollingManager> GetNfcPollingManager() = 0;
116bc2ed2b3Sopenharmony_ci    virtual std::weak_ptr<NfcRoutingManager> GetNfcRoutingManager() = 0;
117bc2ed2b3Sopenharmony_ci    virtual OHOS::sptr<IRemoteObject> GetTagServiceIface() = 0;
118bc2ed2b3Sopenharmony_ci    virtual OHOS::sptr<IRemoteObject> GetHceServiceIface() = 0;
119bc2ed2b3Sopenharmony_ci    virtual std::weak_ptr<CeService> GetCeService() = 0 ;
120bc2ed2b3Sopenharmony_ci    virtual std::string GetSimVendorBundleName() = 0;
121bc2ed2b3Sopenharmony_ci};
122bc2ed2b3Sopenharmony_ci}  // namespace NFC
123bc2ed2b3Sopenharmony_ci}  // namespace OHOS
124bc2ed2b3Sopenharmony_ci#endif  // I_NFC_SERVICE_H
125