diff --git a/mock/ohos.common_event_data.cj b/mock/ohos.common_event_data.cj new file mode 100644 index 0000000..159394f --- /dev/null +++ b/mock/ohos.common_event_data.cj @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2026 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.common_event_data + +import ohos.labels.APILevel +import ohos.value_type.CommonEventValueType +import std.collection.HashMap + +@!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] +public class CommonEventData { + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public var event: String + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public var bundleName: String + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public var code: Int32 + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public var data: String + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public var parameters: HashMap + + public init() { + super() + this.event = String() + this.bundleName = String() + this.code = 0 + this.data = String() + this.parameters = HashMap() + } +} \ No newline at end of file diff --git a/mock/ohos.common_event_manager.cj b/mock/ohos.common_event_manager.cj new file mode 100644 index 0000000..108ed63 --- /dev/null +++ b/mock/ohos.common_event_manager.cj @@ -0,0 +1,553 @@ +/* + * Copyright (c) 2026 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.common_event_manager + +import ohos.business_exception.AsyncCallback +public import ohos.common_event_data.CommonEventData +public import ohos.common_event_publish_data.CommonEventPublishData +public import ohos.common_event_subscribe_info.CommonEventSubscribeInfo +public import ohos.common_event_subscriber.CommonEventSubscriber +import ohos.labels.APILevel +public import ohos.value_type.CommonEventValueType + +@!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] +public class CommonEventManager { + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent", throwexception: true, workerthread: true] + public static func publish(event: String, options!: CommonEventPublishData = CommonEventPublishData()): Unit { + return () + } + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent", throwexception: true, workerthread: true] + public static func createSubscriber(subscribeInfo: CommonEventSubscribeInfo): CommonEventSubscriber { + return CommonEventSubscriber() + } + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent", throwexception: true] + public static func subscribe(subscriber: CommonEventSubscriber, callback: AsyncCallback): Unit { + return () + } + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent", throwexception: true, workerthread: true] + public static func unsubscribe(subscriber: CommonEventSubscriber): Unit { + return () + } + + public init() { + super() + } +} + +@!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] +public class Support { + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_BOOT_COMPLETED: String = "usual.event.BOOT_COMPLETED" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_LOCKED_BOOT_COMPLETED: String = "usual.event.LOCKED_BOOT_COMPLETED" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_SHUTDOWN: String = "usual.event.SHUTDOWN" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_BATTERY_CHANGED: String = "usual.event.BATTERY_CHANGED" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_BATTERY_LOW: String = "usual.event.BATTERY_LOW" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_BATTERY_OKAY: String = "usual.event.BATTERY_OKAY" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_POWER_CONNECTED: String = "usual.event.POWER_CONNECTED" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_POWER_DISCONNECTED: String = "usual.event.POWER_DISCONNECTED" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_SCREEN_OFF: String = "usual.event.SCREEN_OFF" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_SCREEN_ON: String = "usual.event.SCREEN_ON" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_THERMAL_LEVEL_CHANGED: String = "usual.event.THERMAL_LEVEL_CHANGED" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_TIME_TICK: String = "usual.event.TIME_TICK" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_TIME_CHANGED: String = "usual.event.TIME_CHANGED" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_DATE_CHANGED: String = "usual.event.DATE_CHANGED" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_TIMEZONE_CHANGED: String = "usual.event.TIMEZONE_CHANGED" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_CLOSE_SYSTEM_DIALOGS: String = "usual.event.CLOSE_SYSTEM_DIALOGS" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_PACKAGE_ADDED: String = "usual.event.PACKAGE_ADDED" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_PACKAGE_REPLACED: String = "usual.event.PACKAGE_REPLACED" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_MY_PACKAGE_REPLACED: String = "usual.event.MY_PACKAGE_REPLACED" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_PACKAGE_REMOVED: String = "usual.event.PACKAGE_REMOVED" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_BUNDLE_REMOVED: String = "usual.event.BUNDLE_REMOVED" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_PACKAGE_FULLY_REMOVED: String = "usual.event.PACKAGE_FULLY_REMOVED" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_PACKAGE_CHANGED: String = "usual.event.PACKAGE_CHANGED" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_PACKAGE_RESTARTED: String = "usual.event.PACKAGE_RESTARTED" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_PACKAGE_DATA_CLEARED: String = "usual.event.PACKAGE_DATA_CLEARED" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_PACKAGE_CACHE_CLEARED: String = "usual.event.PACKAGE_CACHE_CLEARED" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_PACKAGES_SUSPENDED: String = "usual.event.PACKAGES_SUSPENDED" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_PACKAGES_UNSUSPENDED: String = "usual.event.PACKAGES_UNSUSPENDED" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_MY_PACKAGE_SUSPENDED: String = "usual.event.MY_PACKAGE_SUSPENDED" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_MY_PACKAGE_UNSUSPENDED: String = "usual.event.MY_PACKAGE_UNSUSPENDED" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_UID_REMOVED: String = "usual.event.UID_REMOVED" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_PACKAGE_FIRST_LAUNCH: String = "usual.event.PACKAGE_FIRST_LAUNCH" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_PACKAGE_NEEDS_VERIFICATION: String = "usual.event.PACKAGE_NEEDS_VERIFICATION" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_PACKAGE_VERIFIED: String = "usual.event.PACKAGE_VERIFIED" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_EXTERNAL_APPLICATIONS_AVAILABLE: String = "usual.event.EXTERNAL_APPLICATIONS_AVAILABLE" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_EXTERNAL_APPLICATIONS_UNAVAILABLE: String = "usual.event.EXTERNAL_APPLICATIONS_UNAVAILABLE" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_CONFIGURATION_CHANGED: String = "usual.event.CONFIGURATION_CHANGED" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_LOCALE_CHANGED: String = "usual.event.LOCALE_CHANGED" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_MANAGE_PACKAGE_STORAGE: String = "usual.event.MANAGE_PACKAGE_STORAGE" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_DRIVE_MODE: String = "common.event.DRIVE_MODE" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_HOME_MODE: String = "common.event.HOME_MODE" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_OFFICE_MODE: String = "common.event.OFFICE_MODE" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_USER_STARTED: String = "usual.event.USER_STARTED" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_USER_BACKGROUND: String = "usual.event.USER_BACKGROUND" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_USER_FOREGROUND: String = "usual.event.USER_FOREGROUND" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_USER_SWITCHED: String = "usual.event.USER_SWITCHED" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_USER_STARTING: String = "usual.event.USER_STARTING" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_USER_UNLOCKED: String = "usual.event.USER_UNLOCKED" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_USER_STOPPING: String = "usual.event.USER_STOPPING" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_USER_STOPPED: String = "usual.event.USER_STOPPED" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_DISTRIBUTED_ACCOUNT_LOGIN: String = "common.event.DISTRIBUTED_ACCOUNT_LOGIN" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_DISTRIBUTED_ACCOUNT_LOGOUT: String = "common.event.DISTRIBUTED_ACCOUNT_LOGOUT" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_DISTRIBUTED_ACCOUNT_TOKEN_INVALID: String = "common.event.DISTRIBUTED_ACCOUNT_TOKEN_INVALID" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_DISTRIBUTED_ACCOUNT_LOGOFF: String = "common.event.DISTRIBUTED_ACCOUNT_LOGOFF" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_WIFI_POWER_STATE: String = "usual.event.wifi.POWER_STATE" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_WIFI_SCAN_FINISHED: String = "usual.event.wifi.SCAN_FINISHED" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_WIFI_RSSI_VALUE: String = "usual.event.wifi.RSSI_VALUE" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_WIFI_CONN_STATE: String = "usual.event.wifi.CONN_STATE" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_WIFI_HOTSPOT_STATE: String = "usual.event.wifi.HOTSPOT_STATE" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_WIFI_AP_STA_JOIN: String = "usual.event.wifi.WIFI_HS_STA_JOIN" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_WIFI_AP_STA_LEAVE: String = "usual.event.wifi.WIFI_HS_STA_LEAVE" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_WIFI_MPLINK_STATE_CHANGE: String = "usual.event.wifi.mplink.STATE_CHANGE" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_WIFI_P2P_CONN_STATE: String = "usual.event.wifi.p2p.CONN_STATE_CHANGE" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_WIFI_P2P_STATE_CHANGED: String = "usual.event.wifi.p2p.STATE_CHANGE" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_WIFI_P2P_PEERS_STATE_CHANGED: String = "usual.event.wifi.p2p.DEVICES_CHANGE" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_WIFI_P2P_PEERS_DISCOVERY_STATE_CHANGED: String = "usual.event.wifi.p2p.PEER_DISCOVERY_STATE_CHANGE" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_WIFI_P2P_CURRENT_DEVICE_STATE_CHANGED: String = "usual.event.wifi.p2p.CURRENT_DEVICE_CHANGE" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_WIFI_P2P_GROUP_STATE_CHANGED: String = "usual.event.wifi.p2p.GROUP_STATE_CHANGED" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_BLUETOOTH_HANDSFREE_AG_CONNECT_STATE_UPDATE: String = "usual.event.bluetooth.handsfree.ag.CONNECT_STATE_UPDATE" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_BLUETOOTH_HANDSFREE_AG_CURRENT_DEVICE_UPDATE: String = "usual.event.bluetooth.handsfree.ag.CURRENT_DEVICE_UPDATE" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_BLUETOOTH_HANDSFREE_AG_AUDIO_STATE_UPDATE: String = "usual.event.bluetooth.handsfree.ag.AUDIO_STATE_UPDATE" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_BLUETOOTH_A2DPSOURCE_CONNECT_STATE_UPDATE: String = "usual.event.bluetooth.a2dpsource.CONNECT_STATE_UPDATE" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_BLUETOOTH_A2DPSOURCE_CURRENT_DEVICE_UPDATE: String = "usual.event.bluetooth.a2dpsource.CURRENT_DEVICE_UPDATE" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_BLUETOOTH_A2DPSOURCE_PLAYING_STATE_UPDATE: String = "usual.event.bluetooth.a2dpsource.PLAYING_STATE_UPDATE" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_BLUETOOTH_A2DPSOURCE_AVRCP_CONNECT_STATE_UPDATE: String = "usual.event.bluetooth.a2dpsource.AVRCP_CONNECT_STATE_UPDATE" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_BLUETOOTH_A2DPSOURCE_CODEC_VALUE_UPDATE: String = "usual.event.bluetooth.a2dpsource.CODEC_VALUE_UPDATE" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_DISCOVERED: String = "usual.event.bluetooth.remotedevice.DISCOVERED" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_CLASS_VALUE_UPDATE: String = "usual.event.bluetooth.remotedevice.CLASS_VALUE_UPDATE" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_ACL_CONNECTED: String = "usual.event.bluetooth.remotedevice.ACL_CONNECTED" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_ACL_DISCONNECTED: String = "usual.event.bluetooth.remotedevice.ACL_DISCONNECTED" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_NAME_UPDATE: String = "usual.event.bluetooth.remotedevice.NAME_UPDATE" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_PAIR_STATE: String = "usual.event.bluetooth.remotedevice.PAIR_STATE" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_BATTERY_VALUE_UPDATE: String = "usual.event.bluetooth.remotedevice.BATTERY_VALUE_UPDATE" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_SDP_RESULT: String = "usual.event.bluetooth.remotedevice.SDP_RESULT" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_UUID_VALUE: String = "usual.event.bluetooth.remotedevice.UUID_VALUE" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_PAIRING_REQ: String = "usual.event.bluetooth.remotedevice.PAIRING_REQ" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_PAIRING_CANCEL: String = "usual.event.bluetooth.remotedevice.PAIRING_CANCEL" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_CONNECT_REQ: String = "usual.event.bluetooth.remotedevice.CONNECT_REQ" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_CONNECT_REPLY: String = "usual.event.bluetooth.remotedevice.CONNECT_REPLY" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_CONNECT_CANCEL: String = "usual.event.bluetooth.remotedevice.CONNECT_CANCEL" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_BLUETOOTH_HANDSFREEUNIT_CONNECT_STATE_UPDATE: String = "usual.event.bluetooth.handsfreeunit.CONNECT_STATE_UPDATE" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_BLUETOOTH_HANDSFREEUNIT_AUDIO_STATE_UPDATE: String = "usual.event.bluetooth.handsfreeunit.AUDIO_STATE_UPDATE" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_BLUETOOTH_HANDSFREEUNIT_AG_COMMON_EVENT: String = "usual.event.bluetooth.handsfreeunit.AG_COMMON_EVENT" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_BLUETOOTH_HANDSFREEUNIT_AG_CALL_STATE_UPDATE: String = "usual.event.bluetooth.handsfreeunit.AG_CALL_STATE_UPDATE" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_BLUETOOTH_HOST_STATE_UPDATE: String = "usual.event.bluetooth.host.STATE_UPDATE" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_BLUETOOTH_HOST_REQ_DISCOVERABLE: String = "usual.event.bluetooth.host.REQ_DISCOVERABLE" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_BLUETOOTH_HOST_REQ_ENABLE: String = "usual.event.bluetooth.host.REQ_ENABLE" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_BLUETOOTH_HOST_REQ_DISABLE: String = "usual.event.bluetooth.host.REQ_DISABLE" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_BLUETOOTH_HOST_SCAN_MODE_UPDATE: String = "usual.event.bluetooth.host.SCAN_MODE_UPDATE" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_BLUETOOTH_HOST_DISCOVERY_STARTED: String = "usual.event.bluetooth.host.DISCOVERY_STARTED" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_BLUETOOTH_HOST_DISCOVERY_FINISHED: String = "usual.event.bluetooth.host.DISCOVERY_FINISHED" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_BLUETOOTH_HOST_NAME_UPDATE: String = "usual.event.bluetooth.host.NAME_UPDATE" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_BLUETOOTH_A2DPSINK_CONNECT_STATE_UPDATE: String = "usual.event.bluetooth.a2dpsink.CONNECT_STATE_UPDATE" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_BLUETOOTH_A2DPSINK_PLAYING_STATE_UPDATE: String = "usual.event.bluetooth.a2dpsink.PLAYING_STATE_UPDATE" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_BLUETOOTH_A2DPSINK_AUDIO_STATE_UPDATE: String = "usual.event.bluetooth.a2dpsink.AUDIO_STATE_UPDATE" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_NFC_ACTION_ADAPTER_STATE_CHANGED: String = "usual.event.nfc.action.ADAPTER_STATE_CHANGED" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_NFC_ACTION_RF_FIELD_ON_DETECTED: String = "usual.event.nfc.action.RF_FIELD_ON_DETECTED" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_NFC_ACTION_RF_FIELD_OFF_DETECTED: String = "usual.event.nfc.action.RF_FIELD_OFF_DETECTED" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_DISCHARGING: String = "usual.event.DISCHARGING" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_CHARGING: String = "usual.event.CHARGING" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_DEVICE_IDLE_MODE_CHANGED: String = "usual.event.DEVICE_IDLE_MODE_CHANGED" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_CHARGE_IDLE_MODE_CHANGED: String = "usual.event.CHARGE_IDLE_MODE_CHANGED" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_POWER_SAVE_MODE_CHANGED: String = "usual.event.POWER_SAVE_MODE_CHANGED" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_USER_ADDED: String = "usual.event.USER_ADDED" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_USER_REMOVED: String = "usual.event.USER_REMOVED" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_ABILITY_ADDED: String = "common.event.ABILITY_ADDED" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_ABILITY_REMOVED: String = "common.event.ABILITY_REMOVED" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_ABILITY_UPDATED: String = "common.event.ABILITY_UPDATED" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_LOCATION_MODE_STATE_CHANGED: String = "usual.event.location.MODE_STATE_CHANGED" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_IVI_SLEEP: String = "common.event.IVI_SLEEP" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_IVI_PAUSE: String = "common.event.IVI_PAUSE" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_IVI_STANDBY: String = "common.event.IVI_STANDBY" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_IVI_LAST_MODE_SAVE: String = "common.event.IVI_LASTMODE_SAVE" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_IVI_VOLTAGE_ABNORMAL: String = "common.event.IVI_VOLTAGE_ABNORMAL" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_IVI_HIGH_TEMPERATURE: String = "common.event.IVI_HIGH_TEMPERATURE" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_IVI_EXTREME_TEMPERATURE: String = "common.event.IVI_EXTREME_TEMPERATURE" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_IVI_TEMPERATURE_ABNORMAL: String = "common.event.IVI_TEMPERATURE_ABNORMAL" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_IVI_VOLTAGE_RECOVERY: String = "common.event.IVI_VOLTAGE_RECOVERY" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_IVI_TEMPERATURE_RECOVERY: String = "common.event.IVI_TEMPERATURE_RECOVERY" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_IVI_ACTIVE: String = "common.event.IVI_ACTIVE" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_USB_STATE: String = "usual.event.hardware.usb.action.USB_STATE" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_USB_PORT_CHANGED: String = "usual.event.hardware.usb.action.USB_PORT_CHANGED" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_USB_DEVICE_ATTACHED: String = "usual.event.hardware.usb.action.USB_DEVICE_ATTACHED" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_USB_DEVICE_DETACHED: String = "usual.event.hardware.usb.action.USB_DEVICE_DETACHED" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_USB_ACCESSORY_ATTACHED: String = "usual.event.hardware.usb.action.USB_ACCESSORY_ATTACHED" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_USB_ACCESSORY_DETACHED: String = "usual.event.hardware.usb.action.USB_ACCESSORY_DETACHED" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_DISK_REMOVED: String = "usual.event.data.DISK_REMOVED" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_DISK_UNMOUNTED: String = "usual.event.data.DISK_UNMOUNTED" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_DISK_MOUNTED: String = "usual.event.data.DISK_MOUNTED" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_DISK_BAD_REMOVAL: String = "usual.event.data.DISK_BAD_REMOVAL" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_DISK_UNMOUNTABLE: String = "usual.event.data.DISK_UNMOUNTABLE" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_DISK_EJECT: String = "usual.event.data.DISK_EJECT" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_VOLUME_REMOVED: String = "usual.event.data.VOLUME_REMOVED" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_VOLUME_UNMOUNTED: String = "usual.event.data.VOLUME_UNMOUNTED" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_VOLUME_MOUNTED: String = "usual.event.data.VOLUME_MOUNTED" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_VOLUME_BAD_REMOVAL: String = "usual.event.data.VOLUME_BAD_REMOVAL" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_VOLUME_EJECT: String = "usual.event.data.VOLUME_EJECT" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_VISIBLE_ACCOUNTS_UPDATED: String = "usual.event.data.VISIBLE_ACCOUNTS_UPDATED" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_ACCOUNT_DELETED: String = "usual.event.data.ACCOUNT_DELETED" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_FOUNDATION_READY: String = "common.event.FOUNDATION_READY" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_AIRPLANE_MODE_CHANGED: String = "usual.event.AIRPLANE_MODE" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_SPLIT_SCREEN: String = "common.event.SPLIT_SCREEN" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_SLOT_CHANGE: String = "usual.event.SLOT_CHANGE" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_SPN_INFO_CHANGED: String = "usual.event.SPN_INFO_CHANGED" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_QUICK_FIX_APPLY_RESULT: String = "usual.event.QUICK_FIX_APPLY_RESULT" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_QUICK_FIX_REVOKE_RESULT: String = "usual.event.QUICK_FIX_REVOKE_RESULT" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_USER_INFO_UPDATED: String = "usual.event.USER_INFO_UPDATED" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_HTTP_PROXY_CHANGE: String = "usual.event.HTTP_PROXY_CHANGE" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_SIM_STATE_CHANGED: String = "usual.event.SIM_STATE_CHANGED" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_CALL_STATE_CHANGED: String = "usual.event.CALL_STATE_CHANGED" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_NETWORK_STATE_CHANGED: String = "usual.event.NETWORK_STATE_CHANGED" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_SIGNAL_INFO_CHANGED: String = "usual.event.SIGNAL_INFO_CHANGED" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_SCREEN_UNLOCKED: String = "usual.event.SCREEN_UNLOCKED" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_SCREEN_LOCKED: String = "usual.event.SCREEN_LOCKED" + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public static const COMMON_EVENT_CONNECTIVITY_CHANGE: String = "usual.event.CONNECTIVITY_CHANGE" + + public init() { + super() + } +} \ No newline at end of file diff --git a/mock/ohos.common_event_publish_data.cj b/mock/ohos.common_event_publish_data.cj new file mode 100644 index 0000000..28541da --- /dev/null +++ b/mock/ohos.common_event_publish_data.cj @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2026 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.common_event_publish_data + +import ohos.labels.APILevel +import ohos.value_type.CommonEventValueType +import std.collection.HashMap + +@!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] +public class CommonEventPublishData { + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public var bundleName: String + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public var data: String + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public var code: Int32 + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public var subscriberPermissions: Array + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public var isOrdered: Bool + + @!APILevel[since: "22", permission: "ohos.permission.COMMONEVENT_STICKY", syscap: "SystemCapability.Notification.CommonEvent"] + public var isSticky: Bool + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public var parameters: HashMap + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public init( + bundleName!: String = "", + data!: String = "", + code!: Int32 = 0, + subscriberPermissions!: Array = Array(), + isOrdered!: Bool = false, + isSticky!: Bool = false, + parameters!: HashMap = HashMap() + ) { + super() + this.bundleName = String() + this.data = String() + this.code = 0 + this.subscriberPermissions = Array() + this.isOrdered = true + this.isSticky = true + this.parameters = HashMap() + } +} \ No newline at end of file diff --git a/mock/ohos.common_event_subscribe_info.cj b/mock/ohos.common_event_subscribe_info.cj new file mode 100644 index 0000000..6b49d15 --- /dev/null +++ b/mock/ohos.common_event_subscribe_info.cj @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2026 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.common_event_subscribe_info + +import ohos.labels.APILevel + +@!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] +public class CommonEventSubscribeInfo { + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public var events: Array + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public var priority: Int32 + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public var userId: Int32 + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public var publisherPermission: String + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public var publisherDeviceId: String + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public var publisherBundleName: String + + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] + public init( + events: Array, + publisherPermission!: String = "", + publisherDeviceId!: String = "", + userId!: Int32 = -3, + priority!: Int32 = 0, + publisherBundleName!: String = "" + ) { + super() + this.events = Array() + this.priority = 0 + this.userId = 0 + this.publisherPermission = String() + this.publisherDeviceId = String() + this.publisherBundleName = String() + } +} \ No newline at end of file diff --git a/mock/ohos.common_event_subscriber.cj b/mock/ohos.common_event_subscriber.cj new file mode 100644 index 0000000..5e885df --- /dev/null +++ b/mock/ohos.common_event_subscriber.cj @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2026 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.common_event_subscriber + +import ohos.labels.APILevel + +@!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] +public class CommonEventSubscriber { + + public init() { + super() + } +} \ No newline at end of file diff --git a/mock/ohos.value_type.cj b/mock/ohos.value_type.cj new file mode 100644 index 0000000..349b4a3 --- /dev/null +++ b/mock/ohos.value_type.cj @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2026 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ohos.value_type + +import ohos.labels.APILevel + +@!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] +public enum CommonEventValueType { + @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] Int32Value(Int32) + | @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] Float64Value(Float64) + | @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] StringValue(String) + | @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] BoolValue(Bool) + | @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] FD(Int32) + | @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] ArrayString(Array) + | @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] ArrayInt32(Array) + | @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] ArrayInt64(Array) + | @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] ArrayBool(Array) + | @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] ArrayFloat64(Array) + | @!APILevel[since: "22", syscap: "SystemCapability.Notification.CommonEvent"] ArrayFD(Array) + | ... +} \ No newline at end of file diff --git a/ohos/common_event_data/BUILD.gn b/ohos/common_event_data/BUILD.gn index 6fab505..3b71eb4 100644 --- a/ohos/common_event_data/BUILD.gn +++ b/ohos/common_event_data/BUILD.gn @@ -17,9 +17,12 @@ import("//build/ohos.gni") import("//build/templates/cangjie/cjc.gni") ohos_cangjie_shared_library("ohos.common_event_data") { - sources = [ - "common_event_data.cj", - ] + + if (is_mingw || is_mac){ + sources = [ "../../mock/ohos.common_event_data.cj" ] + } else { + sources = [ "common_event_data.cj" ] + } cj_external_deps = [ "cangjie_ark_interop:ohos.labels", diff --git a/ohos/common_event_manager/BUILD.gn b/ohos/common_event_manager/BUILD.gn index 3d9f7b3..7889aff 100644 --- a/ohos/common_event_manager/BUILD.gn +++ b/ohos/common_event_manager/BUILD.gn @@ -17,13 +17,18 @@ import("//build/ohos.gni") import("//build/templates/cangjie/cjc.gni") ohos_cangjie_shared_library("ohos.common_event_manager") { - sources = [ - "common_event_manager_errors.cj", - "common_event_manager_ffi.cj", - "common_event_manager_utils.cj", - "common_event_manager.cj", - "support.cj", - ] + + if (is_mingw || is_mac){ + sources = [ "../../mock/ohos.common_event_manager.cj" ] + } else { + sources = [ + "common_event_manager_errors.cj", + "common_event_manager_ffi.cj", + "common_event_manager_utils.cj", + "common_event_manager.cj", + "support.cj", + ] + } external_deps = [ "common_event_service:cj_common_event_manager_ffi" ] diff --git a/ohos/common_event_publish_data/BUILD.gn b/ohos/common_event_publish_data/BUILD.gn index 890ad56..4de4c64 100644 --- a/ohos/common_event_publish_data/BUILD.gn +++ b/ohos/common_event_publish_data/BUILD.gn @@ -17,9 +17,12 @@ import("//build/ohos.gni") import("//build/templates/cangjie/cjc.gni") ohos_cangjie_shared_library("ohos.common_event_publish_data") { - sources = [ - "common_event_publish_data.cj", - ] + + if (is_mingw || is_mac){ + sources = [ "../../mock/ohos.common_event_publish_data.cj" ] + } else { + sources = [ "common_event_publish_data.cj" ] + } cj_external_deps = [ "cangjie_ark_interop:ohos.business_exception", diff --git a/ohos/common_event_subscribe_info/BUILD.gn b/ohos/common_event_subscribe_info/BUILD.gn index 0c5d1b2..37cdd04 100644 --- a/ohos/common_event_subscribe_info/BUILD.gn +++ b/ohos/common_event_subscribe_info/BUILD.gn @@ -17,9 +17,12 @@ import("//build/ohos.gni") import("//build/templates/cangjie/cjc.gni") ohos_cangjie_shared_library("ohos.common_event_subscribe_info") { - sources = [ - "common_event_subscribe_info.cj", - ] + + if (is_mingw || is_mac){ + sources = [ "../../mock/ohos.common_event_subscribe_info.cj" ] + } else { + sources = [ "common_event_subscribe_info.cj" ] + } cj_external_deps = [ "cangjie_ark_interop:ohos.business_exception", diff --git a/ohos/common_event_subscriber/BUILD.gn b/ohos/common_event_subscriber/BUILD.gn index 84fb560..07d0d75 100644 --- a/ohos/common_event_subscriber/BUILD.gn +++ b/ohos/common_event_subscriber/BUILD.gn @@ -17,10 +17,15 @@ import("//build/ohos.gni") import("//build/templates/cangjie/cjc.gni") ohos_cangjie_shared_library("ohos.common_event_subscriber") { - sources = [ - "common_event_subscriber.cj", - "common_event_subscriber_ffi.cj", - ] + + if (is_mingw || is_mac){ + sources = [ "../../mock/ohos.common_event_subscriber.cj" ] + } else { + sources = [ + "common_event_subscriber.cj", + "common_event_subscriber_ffi.cj", + ] + } external_deps = [ "common_event_service:cj_common_event_manager_ffi" ] diff --git a/ohos/value_type/BUILD.gn b/ohos/value_type/BUILD.gn index a298f9a..742b62a 100644 --- a/ohos/value_type/BUILD.gn +++ b/ohos/value_type/BUILD.gn @@ -17,10 +17,15 @@ import("//build/ohos.gni") import("//build/templates/cangjie/cjc.gni") ohos_cangjie_shared_library("ohos.value_type") { - sources = [ - "value_type.cj", - "parameters.cj", - ] + + if (is_mingw || is_mac){ + sources = [ "../../mock/ohos.value_type.cj" ] + } else { + sources = [ + "value_type.cj", + "parameters.cj", + ] + } cj_external_deps = [ "cangjie_ark_interop:ohos.business_exception",