2 * Copyright (c) CompanyNameMagicTag. 2025-2025. All rights reserved.
3 * Description: watchface JS intarface
4 * Author: Software Group
8 #ifndef WATCHFACE_MODULE_H
9 #define WATCHFACE_MODULE_H
14 #include "main/include/dial/WatchInterface.h"
20 WATCHFACE_SUCCESS = 0,
21 WATCHFACE_PARAM_ERROR = 401,
22 WATCHFACE_INSTALL_ERROR = 2400001,
23 WATCHFACE_GETINFO_ERROR = 2400002,
24 WATCHFACE_GETMSG_ERROR = 2400003,
27 typedef watch_dial_info WatchDialInfo;
29 struct DownloadStatus {
30 uint32_t receivedSize;
35 struct WatchfaceParams{
42 class WatchfaceModule final : public MemoryHeap {
44 WatchfaceModule() = default;
45 ~WatchfaceModule() = default;
46 static JSIValue SetWatchFace(const JSIValue thisVal, const JSIValue *args, uint8_t argsSize);
47 static JSIValue GetWatchFaceInfo(const JSIValue thisVal, const JSIValue *args, uint8_t argsSize);
48 static JSIValue SetDownloadListener(const JSIValue thisVal, const JSIValue *args, uint8_t argsSize);
49 static JSIValue Destroy(const JSIValue thisVal, const JSIValue *args, uint8_t argsSize);
50 static void FailCallback(void *data);
51 static void SuccessCallback(void *data);
52 static bool isTerminate_;
54 static bool GetDialInfo(uint32_t uuid, WatchDialInfo& watch, JSIValue& dialInfo);
55 static bool isListenerRunning_;
57 void InitWatchFaceModule(JSIValue exports);
59 } // namespace ACELite
62 #endif // WATCHFACE_MODULE_H