1 /* 2 * Copyright (C) 2024 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef NFC_NOTIFICATION_H 17 #define NFC_NOTIFICATION_H 18 19 #include <mutex> 20 #include <string> 21 22 #include "image_source.h" 23 #include "pixel_map.h" 24 25 #ifdef __cplusplus 26 #if __cplusplus 27 extern "C" { 28 #endif /* __cplusplus */ 29 #endif /* __cplusplus */ 30 31 typedef void (*NfcNtfCallback)(int notificationId); 32 void RegNotificationCallback(NfcNtfCallback callback); 33 void PublishNfcNotification(bool isNfcNotDisturb, int notificationId, const std::string &name, int balance); 34 35 #ifdef __cplusplus 36 #if __cplusplus 37 } 38 #endif /* __cplusplus */ 39 #endif /* __cplusplus */ 40 41 namespace OHOS { 42 namespace NFC { 43 namespace TAG { 44 class NfcNotification { 45 public: 46 static NfcNotification& GetInstance(void); 47 48 void PublishNfcNotification(bool isNfcNotDisturb, int notificationId, const std::string &name, int balance); 49 void RegNotificationCallback(NfcNtfCallback callback); 50 51 private: 52 NfcNotification(); 53 ~NfcNotification(); 54 NfcNotification(const NfcNotification&) = delete; 55 NfcNotification& operator=(const NfcNotification&) = delete; 56 57 void GetPixelMap(const std::string &path); 58 59 std::mutex mutex_ {}; 60 std::shared_ptr<Media::PixelMap> nfcIconPixelMap_ {}; 61 }; 62 } // namespace TAG 63 } // namespace NFC 64 } // namespace OHOS 65 #endif // NFC_NOTIFICATION_H 66