├── .clang-format ├── .github ├── ISSUE_TEMPLATE │ └── default.md └── pull_request_template.md ├── .gitignore ├── LICENSE ├── OAT.xml ├── README.md ├── build ├── BUILD.gn ├── config.gni ├── libarkui_ios.txt └── platform.gni ├── capability ├── BUILD.gn ├── bridge │ ├── BUILD.gn │ ├── BridgeManagerHolder.h │ ├── BridgeManagerHolder.mm │ ├── BridgePlugin+jsMessage.h │ ├── BridgePlugin+jsMessage.mm │ ├── BridgePlugin.h │ ├── BridgePlugin.mm │ ├── BridgePluginManager+internal.h │ ├── BridgePluginManager+internal.mm │ ├── BridgePluginManager.h │ ├── BridgePluginManager.mm │ ├── BridgeTaskInfo.h │ ├── BridgeTaskInfo.mm │ ├── BridgeTaskQueue.h │ ├── BridgeTaskQueue.mm │ ├── BridgeTaskQueueHandler.h │ ├── BridgeTaskQueueHandler.mm │ ├── MethodData.h │ ├── MethodData.mm │ ├── ParameterHelper.h │ ├── ParameterHelper.mm │ ├── ResultValue.h │ ├── ResultValue.mm │ ├── TaskOption.h │ ├── TaskOption.mm │ ├── bridge_manager.h │ ├── bridge_manager.mm │ ├── bridge_receiver.h │ ├── buffer_mapping.h │ └── codec │ │ ├── BUILD.gn │ │ ├── BridgeArray.h │ │ ├── BridgeArray.m │ │ ├── BridgeBinaryCodec.h │ │ ├── BridgeBinaryCodec.mm │ │ ├── BridgeCodecUtil.h │ │ ├── BridgeCodecUtil.mm │ │ ├── BridgeCodesDelegate.h │ │ ├── BridgeJsonCodec.h │ │ ├── BridgeJsonCodec.mm │ │ ├── BridgeSerializer.h │ │ └── BridgeSerializer.mm ├── clipboard │ ├── clipboard_impl.h │ ├── clipboard_impl.mm │ ├── clipboard_proxy_impl.cpp │ ├── clipboard_proxy_impl.h │ ├── multiType_record_impl.cpp │ └── multiType_record_impl.h ├── editing │ ├── KeyboardTypeMapper.h │ ├── KeyboardTypeMapper.m │ ├── LICENSE │ ├── iOSTextInputDelegate.h │ ├── iOSTxtInputManager.h │ ├── iOSTxtInputManager.mm │ ├── text_input_client_handler.cpp │ ├── text_input_client_handler.h │ ├── text_input_connection_impl.h │ ├── text_input_connection_impl.mm │ ├── text_input_plugin.cpp │ └── text_input_plugin.h ├── environment │ ├── environment_impl.h │ ├── environment_impl.mm │ ├── environment_proxy_impl.cpp │ └── environment_proxy_impl.h ├── font │ ├── font_platform_impl.cpp │ ├── font_platform_impl.h │ ├── font_platform_proxy_impl.cpp │ ├── font_platform_proxy_impl.h │ ├── system_font_manager.h │ └── system_font_manager.mm ├── platformview │ ├── AcePlatformView.h │ ├── AcePlatformView.mm │ ├── AcePlatformViewDelegate.h │ ├── AcePlatformViewPlugin.h │ ├── AcePlatformViewPlugin.mm │ ├── IPlatformView.h │ ├── PlatformViewFactory.h │ └── render │ │ ├── RenderProgram.h │ │ ├── RenderProgram.mm │ │ ├── RenderView.h │ │ └── RenderView.mm ├── storage │ ├── storage_impl.h │ ├── storage_impl.mm │ ├── storage_proxy_impl.cpp │ └── storage_proxy_impl.h ├── surface │ ├── AceSurfacePlugin.h │ ├── AceSurfacePlugin.mm │ ├── AceSurfaceView.h │ ├── AceSurfaceView.mm │ └── IAceSurface.h ├── texture │ ├── AceTexture.h │ ├── AceTexture.mm │ ├── AceTextureDelegate.h │ ├── AceTextureResourcePlugin.h │ └── AceTextureResourcePlugin.mm ├── vibrator │ ├── iOSVibratorManager.h │ ├── iOSVibratorManager.m │ ├── iOSVibratorManager.mm │ ├── vibrator_impl.h │ ├── vibrator_impl.mm │ ├── vibrator_proxy_impl.cpp │ └── vibrator_proxy_impl.h ├── video │ ├── AceVideo.h │ ├── AceVideo.mm │ ├── AceVideoResourcePlugin.h │ └── AceVideoResourcePlugin.mm └── web │ ├── AceWeb.h │ ├── AceWeb.mm │ ├── AceWebCallbackObjectWrapper.cpp │ ├── AceWebCallbackObjectWrapper.h │ ├── AceWebControllerBridge.h │ ├── AceWebControllerBridge.mm │ ├── AceWebDownloadImpl.cpp │ ├── AceWebDownloadImpl.h │ ├── AceWebErrorReceiveInfoObject.cpp │ ├── AceWebErrorReceiveInfoObject.h │ ├── AceWebMessageExtImpl.cpp │ ├── AceWebMessageExtImpl.h │ ├── AceWebObject.cpp │ ├── AceWebObject.h │ ├── AceWebPatternBridge.cpp │ ├── AceWebPatternBridge.h │ ├── AceWebResourcePlugin.h │ ├── AceWebResourcePlugin.mm │ ├── WebMessageChannel.h │ └── WebMessageChannel.mm ├── entrance ├── AcePlatformPlugin.h ├── AcePlatformPlugin.mm ├── AceSurfaceHolder.h ├── AceSurfaceHolder.mm ├── AceTextureHolder.h ├── AceTextureHolder.mm ├── BUILD.gn ├── DownloadManager.h ├── DownloadManager.mm ├── UINavigationController+StatusBar.h ├── UINavigationController+StatusBar.mm ├── WantParams.h ├── WantParams.mm ├── WindowView.h ├── WindowView.mm ├── accessibility │ ├── AccessibilityElement.h │ ├── AccessibilityElement.mm │ ├── AccessibilityNodeInfo.h │ ├── AccessibilityNodeInfo.mm │ ├── AccessibilityWindowView.h │ ├── AccessibilityWindowView.mm │ ├── AceAccessibilityBridge.h │ ├── AceAccessibilityBridge.mm │ └── BUILD.gn ├── ace_application_info_impl.cpp ├── ace_application_info_impl.h ├── ace_bridge.h ├── ace_bridge.mm ├── ace_download_bridge.h ├── ace_download_bridge.mm ├── ace_platform_plugin.cpp ├── ace_platform_plugin.h ├── ace_pointer_data.cc ├── ace_pointer_data.h ├── ace_pointer_data_packet.cc ├── ace_pointer_data_packet.h ├── ace_resource_register.cpp ├── ace_resource_register.h ├── ace_translate_manager.cpp ├── capability_registry.cpp ├── capability_registry.h ├── display_info.h ├── display_info.mm ├── display_manager_agent.cpp ├── display_manager_agent.h ├── download_manager.cpp ├── foldable_window_ios.cpp ├── html │ ├── html_to_span.cpp │ └── span_to_html.cpp ├── interaction │ ├── interaction_impl.cpp │ └── interaction_impl.h ├── logIntercept │ ├── BUILD.gn │ ├── ILogger.h │ ├── LogInterfaceBridge.h │ ├── LogInterfaceBridge.mm │ ├── Logger.h │ └── Logger.mm ├── mmi_event_convertor.h ├── mmi_event_convertor.mm ├── picker │ └── picker_haptic_factory.cpp ├── plugin_lifecycle │ ├── ArkUIXPluginRegistry.h │ ├── ArkUIXPluginRegistry.mm │ ├── BUILD.gn │ ├── IArkUIXPlugin.h │ ├── IPluginRegistry.h │ ├── PluginContext.h │ └── PluginContext.mm ├── resource │ ├── AceResourcePlugin.h │ ├── AceResourcePlugin.m │ ├── AceResourceRegisterDelegate.h │ ├── AceResourceRegisterOC.h │ ├── AceResourceRegisterOC.mm │ ├── BUILD.gn │ ├── IAceOnCallResourceMethod.h │ └── IAceOnResourceEvent.h ├── touch_event.cpp ├── touch_event_convertor.cpp ├── udmf │ ├── udmf_impl.cpp │ └── udmf_impl.h ├── ui_session │ ├── ui_session_manager_ios.cpp │ └── ui_session_manager_ios.h ├── utils.cpp ├── utils.h ├── vibrator │ └── vibrator_utils.cpp ├── virtual_rs_window.h ├── virtual_rs_window.mm └── xcollie │ ├── xcollieInterface_impl.cpp │ └── xcollieInterface_impl.h ├── osal ├── BUILD.gn ├── accessibility_manager_impl.cpp ├── accessibility_manager_impl.h ├── ace_checker.cpp ├── ace_engine_ext.cpp ├── ace_forward_compatibility.cpp ├── advance │ ├── ai_write_adapter.cpp │ ├── data_detector_adapter.cpp │ ├── data_detector_mgr.cpp │ ├── image_analyzer_adapter_impl.cpp │ ├── image_analyzer_manager.cpp │ ├── image_analyzer_mgr.cpp │ ├── text_share_adapter.cpp │ └── text_translation_adapter.cpp ├── app_bar_helper_impl.cpp ├── display_info_utils.cpp ├── display_manager_ios.cpp ├── display_manager_ios.h ├── drag_window.cpp ├── drawable_descriptor_ios.cpp ├── drawable_descriptor_ios.h ├── drawing_color_filter_ios.cpp ├── drawing_color_filter_ios.h ├── drawing_lattice_ios.cpp ├── drawing_lattice_ios.h ├── event_report.cpp ├── exception_handler.cpp ├── fetch_manager.cpp ├── fetch_manager.h ├── file_asset_provider.cpp ├── file_asset_provider.h ├── file_uri_helper_ios.cpp ├── frame_report.cpp ├── frame_trace_adapter_impl.cpp ├── frame_trace_adapter_impl.h ├── hitrace_meter.cpp ├── http_constant.h ├── image_packer_ios.cpp ├── image_packer_ios.h ├── image_source_ios.cpp ├── image_source_ios.h ├── input_manager.cpp ├── input_method_manager_ios.cpp ├── ios_trace.cpp ├── layout_inspector.cpp ├── log_wrapper.cpp ├── mock │ ├── accessibility_constants.cpp │ ├── accessibility_constants.h │ ├── accessibility_def.h │ ├── accessibility_element_info.cpp │ └── accessibility_element_info.h ├── modal_ui_extension_impl.cpp ├── mouse_style_ios.cpp ├── mouse_style_ios.h ├── navigation_route_ios.cpp ├── navigation_route_ios.h ├── package_event_proxy_ios.cpp ├── page_url_checker_ios.cpp ├── page_url_checker_ios.h ├── perf_interfaces.cpp ├── pixel_map_ios.cpp ├── pixel_map_ios.h ├── request_data.h ├── resource_adapter_impl.cpp ├── resource_adapter_impl.h ├── resource_convertor.cpp ├── resource_convertor.h ├── resource_path_util.h ├── resource_path_util.mm ├── resource_theme_style.cpp ├── resource_theme_style.h ├── response_data.cpp ├── response_data.h ├── ressched_report.cpp ├── socperf_client_impl.cpp ├── socperf_client_impl.h ├── statusbar_event_proxy_ios.cpp ├── stylus_detector_default.cpp ├── stylus_detector_mgr.cpp ├── subwindow_ios.cpp ├── subwindow_ios.h ├── system_bar_style_ohos.cpp ├── system_bar_style_ohos.h ├── system_properties.cpp ├── thread_priority.cpp ├── time_event_proxy_ios.cpp ├── view_data_wrap_impl.cpp ├── want_wrap_ios.cpp └── websocket_manager.cpp └── stage ├── ability ├── BUILD.gn ├── InstanceIdGenerator.h ├── InstanceIdGenerator.mm ├── Stage.h ├── StageApplication.h ├── StageApplication.mm ├── StageAssetManager.h ├── StageAssetManager.mm ├── StageConfigurationManager.h ├── StageConfigurationManager.mm ├── StageContainerView.h ├── StageContainerView.mm ├── StageSecureContainerView.h ├── StageSecureContainerView.mm ├── StageViewController.h ├── StageViewController.mm ├── ability_context_adapter.h ├── ability_context_adapter.mm ├── application_context_adapter.h ├── application_context_adapter.mm ├── stage_application_info_adapter.cpp ├── stage_application_info_adapter.h ├── stage_asset_provider.h ├── stage_asset_provider.mm ├── window_view_adapter.h └── window_view_adapter.mm └── uicontent ├── BUILD.gn ├── ace_container_sg.cpp ├── ace_container_sg.h ├── ace_view_sg.cpp ├── ace_view_sg.h ├── platform_event_callback.h ├── ui_content_impl.cpp ├── ui_content_impl.h └── uicontent.gni /.github/ISSUE_TEMPLATE/default.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: This repository is a read-only mirror 3 | about: This repository is a read-only mirror 4 | title: This repository is a read-only mirror 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | ## Thanks for your contribution to ArkUI-X! 11 | 12 | This repository is a read-only mirror that isn't used for accepting issues or pull requests. 13 | To join and contribute to ArkUI-X, please visit our official open source website at https://gitee.com/ArkUI-X. 14 | 15 | [Learn how to contribute >>](https://gitee.com/arkui-x/docs/blob/master/en/contribute/how-to-contribute.md) -------------------------------------------------------------------------------- /.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | Thanks for your contribution to ArkUI-X! 2 | 3 | This repository is a read-only mirror that isn't used for accepting issues or pull requests. 4 | To join and contribute to ArkUI-X, please visit our official open source website at https://gitee.com/ArkUI-X. 5 | 6 | [Learn how to contribute >>](https://gitee.com/arkui-x/docs/blob/master/en/contribute/how-to-contribute.md) -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .vs/ 2 | .vscode/ 3 | *.iml 4 | .idea/ 5 | CMakeLists.txt 6 | cmake-build-debug/ 7 | -------------------------------------------------------------------------------- /build/platform.gni: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022 Huawei Device Co., Ltd. 2 | # Licensed under the Apache License, Version 2.0 (the "License"); 3 | # you may not use this file except in compliance with the License. 4 | # You may obtain a copy of the License at 5 | # 6 | # http://www.apache.org/licenses/LICENSE-2.0 7 | # 8 | # Unless required by applicable law or agreed to in writing, software 9 | # distributed under the License is distributed on an "AS IS" BASIS, 10 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | # See the License for the specific language governing permissions and 12 | # limitations under the License. 13 | 14 | import("//build/ohos.gni") 15 | 16 | platforms = [] 17 | 18 | if (target_os == "ios") { 19 | ios_platform = { 20 | name = "ios" 21 | cross_platform_support = true 22 | config = { 23 | import("config.gni") 24 | } 25 | } 26 | 27 | platforms += [ ios_platform ] 28 | } 29 | -------------------------------------------------------------------------------- /capability/bridge/BridgeManagerHolder.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 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 FOUNDATION_ADAPTER_CAPABILITY_BRIDGE_BRIDGEMANAGERHOLDER_H 17 | #define FOUNDATION_ADAPTER_CAPABILITY_BRIDGE_BRIDGEMANAGERHOLDER_H 18 | 19 | #import "BridgePluginManager.h" 20 | 21 | #import 22 | 23 | NS_ASSUME_NONNULL_BEGIN 24 | 25 | @interface BridgeManagerHolder : NSObject 26 | + (BridgePluginManager*)getBridgeManagerWithInceId:(int32_t)instanceId; 27 | + (void)addBridgeManager:(BridgePluginManager*)object inceId:(int32_t)instanceId; 28 | + (void)removeBridgeManagerWithId:(int32_t)instanceId; 29 | @end 30 | 31 | NS_ASSUME_NONNULL_END 32 | 33 | #endif // FOUNDATION_ADAPTER_CAPABILITY_BRIDGE_BRIDGEMANAGERHOLDER_H 34 | -------------------------------------------------------------------------------- /capability/bridge/BridgePlugin+jsMessage.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 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 FOUNDATION_ADAPTER_CAPABILITY_BRIDGE_BridgePlugin_JSMESSAGE_H 17 | #define FOUNDATION_ADAPTER_CAPABILITY_BRIDGE_BridgePlugin_JSMESSAGE_H 18 | 19 | #import "BridgePlugin.h" 20 | 21 | NS_ASSUME_NONNULL_BEGIN 22 | 23 | @interface BridgePlugin (jsMessage) 24 | 25 | - (void)jsCallMethod:(MethodData*)method; 26 | 27 | - (void)jsSendMethodResult:(ResultValue*)object; 28 | 29 | - (void)jsSendMessage:(id)data; 30 | 31 | - (void)jsSendMessageResponse:(id)data; 32 | 33 | - (void)jsCancelMethod:(NSString*)bridgeName methodName:(NSString*)methodName; 34 | 35 | - (void)callPlatformError:(ResultValue*)object; 36 | 37 | @end 38 | 39 | NS_ASSUME_NONNULL_END 40 | 41 | #endif // FOUNDATION_ADAPTER_CAPABILITY_BRIDGE_BridgePlugin_JSMESSAGE_H -------------------------------------------------------------------------------- /capability/bridge/BridgePluginManager.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 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 FOUNDATION_ADAPTER_CAPABILITY_BRIDGE_BridgePluginMANAGER_H 17 | #define FOUNDATION_ADAPTER_CAPABILITY_BRIDGE_BridgePluginMANAGER_H 18 | 19 | #import 20 | #import "ResultValue.h" 21 | 22 | NS_ASSUME_NONNULL_BEGIN 23 | 24 | @interface BridgePluginManager : NSObject 25 | 26 | @end 27 | 28 | NS_ASSUME_NONNULL_END 29 | 30 | #endif // FOUNDATION_ADAPTER_CAPABILITY_BRIDGE_BridgePluginMANAGER_H -------------------------------------------------------------------------------- /capability/bridge/BridgePluginManager.mm: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 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 | #import "BridgePluginManager.h" 17 | #import "BridgePluginManager+internal.h" 18 | 19 | @implementation BridgePluginManager 20 | + (instancetype)bridgePluginManager:(int32_t)instanceId { 21 | return [self innerBridgePluginManager:instanceId]; 22 | } 23 | 24 | + (void)unbridgePluginManager:(int32_t)instanceId { 25 | return [self innerUnbridgePluginManager:instanceId]; 26 | } 27 | 28 | - (BOOL)registerBridgePlugin:(NSString*)bridgeName 29 | bridgePlugin:(id)bridgePlugin { 30 | return [self innerRegisterBridgePlugin:bridgeName bridgePlugin:bridgePlugin]; 31 | } 32 | 33 | - (BOOL)unRegisterBridgePlugin:(NSString*)bridgeName { 34 | return [self innerUnRegisterBridgePlugin:bridgeName]; 35 | } 36 | 37 | - (void)dealloc { 38 | NSLog(@"BridgePluginManager dealloc"); 39 | } 40 | 41 | @end 42 | -------------------------------------------------------------------------------- /capability/bridge/BridgeTaskInfo.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 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 FOUNDATION_ADAPTER_CAPABILITY_BRIDGE_BRIDGETASKINFO_H 17 | #define FOUNDATION_ADAPTER_CAPABILITY_BRIDGE_BRIDGETASKINFO_H 18 | 19 | #import 20 | 21 | #import "BridgeTaskQueue.h" 22 | 23 | NS_ASSUME_NONNULL_BEGIN 24 | 25 | typedef void (^BridgeTaskHandler)(void); 26 | 27 | typedef enum : int { 28 | INPUT,//js call native 29 | OUTPUT,//native call js 30 | } QueueInOutType; 31 | 32 | @interface BridgeTaskInfo : NSObject 33 | @property (nonatomic, copy) NSString* bridgeName; 34 | @property (nonatomic, copy) BridgeTaskHandler handler; 35 | @property (nonatomic, assign) QueueInOutType inOutType; 36 | 37 | + (BridgeTaskInfo*)bridgeTaskInfoFactory:(NSString*)bridgeName 38 | queueInOutType:(QueueInOutType)inOutType 39 | handler:(BridgeTaskHandler)handler; 40 | @end 41 | 42 | NS_ASSUME_NONNULL_END 43 | 44 | #endif // FOUNDATION_ADAPTER_CAPABILITY_BRIDGE_BRIDGETASKINFO_H 45 | -------------------------------------------------------------------------------- /capability/bridge/BridgeTaskInfo.mm: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 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 | #import "BridgeTaskInfo.h" 17 | 18 | @implementation BridgeTaskInfo 19 | + (BridgeTaskInfo *)bridgeTaskInfoFactory:(NSString*)bridgeName 20 | queueInOutType:(QueueInOutType)inOutType 21 | handler:(BridgeTaskHandler)handler { 22 | BridgeTaskInfo* taskInfo = [[BridgeTaskInfo alloc] init]; 23 | taskInfo.handler = handler; 24 | taskInfo.bridgeName = bridgeName; 25 | taskInfo.inOutType = inOutType; 26 | return taskInfo; 27 | } 28 | @end 29 | -------------------------------------------------------------------------------- /capability/bridge/BridgeTaskQueue.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 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 FOUNDATION_ADAPTER_CAPABILITY_BRIDGE_BRIDGETASKQUEUE_H 17 | #define FOUNDATION_ADAPTER_CAPABILITY_BRIDGE_BRIDGETASKQUEUE_H 18 | 19 | #import 20 | 21 | NS_ASSUME_NONNULL_BEGIN 22 | 23 | @protocol BridgeTaskQueueDelegate 24 | - (void)dispatch:(dispatch_block_t)block; 25 | @end 26 | 27 | @interface BridgeTaskQueue : NSObject 28 | - (instancetype)initWithQueueName:(NSString*)queueName; 29 | - (instancetype)initWithQueueName:(NSString*)queueName isSerial:(BOOL)isSerial; 30 | - (void)dispatch:(dispatch_block_t)block; 31 | @end 32 | 33 | NS_ASSUME_NONNULL_END 34 | 35 | #endif // FOUNDATION_ADAPTER_CAPABILITY_BRIDGE_BRIDGETASKQUEUE_H 36 | -------------------------------------------------------------------------------- /capability/bridge/BridgeTaskQueueHandler.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 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 FOUNDATION_ADAPTER_CAPABILITY_BRIDGE_BRIDGETASKQUEUEHANDLER_H 17 | #define FOUNDATION_ADAPTER_CAPABILITY_BRIDGE_BRIDGETASKQUEUEHANDLER_H 18 | 19 | #import 20 | 21 | #import "BridgeTaskInfo.h" 22 | NS_ASSUME_NONNULL_BEGIN 23 | 24 | @interface BridgeTaskQueueHandler : NSObject 25 | @property(nonatomic, strong) BridgeTaskQueue* outputTaskQueue; 26 | @property(nonatomic, strong) BridgeTaskQueue* inputTaskQueue; 27 | @property (nonatomic, assign) BOOL isUseTaskQueue; 28 | @property (nonatomic, assign) BOOL isSerial; 29 | 30 | - (void)dispatchTaskInfo:(BridgeTaskInfo*)taskInfo; 31 | @end 32 | 33 | NS_ASSUME_NONNULL_END 34 | 35 | #endif // FOUNDATION_ADAPTER_CAPABILITY_BRIDGE_BRIDGETASKQUEUEHANDLER_H 36 | -------------------------------------------------------------------------------- /capability/bridge/MethodData.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 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 FOUNDATION_ADAPTER_CAPABILITY_BRIDGE_MethodData_H 17 | #define FOUNDATION_ADAPTER_CAPABILITY_BRIDGE_MethodData_H 18 | 19 | #import 20 | 21 | NS_ASSUME_NONNULL_BEGIN 22 | 23 | @interface MethodData : NSObject 24 | 25 | /** 26 | * The ArkUI method name. 27 | * 28 | * @since 10 29 | */ 30 | @property (nonatomic, strong) NSString* methodName; 31 | 32 | /** 33 | * Add parameters of the ArkUI method in order of parameters 34 | * 35 | * @since 10 36 | */ 37 | @property (nonatomic, strong) NSArray* parameter; 38 | 39 | /** 40 | * Initializes MethodData 41 | * 42 | * @param methodName method name. 43 | * @param parameter method call parameters. 44 | * @since 10 45 | */ 46 | - (instancetype)initMethodWithName:(NSString* _Nonnull)methodName 47 | parameter:(NSArray* _Nullable)parameter; 48 | 49 | @end 50 | 51 | NS_ASSUME_NONNULL_END 52 | 53 | #endif // FOUNDATION_ADAPTER_CAPABILITY_BRIDGE_MethodData_H -------------------------------------------------------------------------------- /capability/bridge/MethodData.mm: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 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 | #import "MethodData.h" 17 | 18 | @implementation MethodData 19 | 20 | - (instancetype)initMethodWithName:(NSString* _Nonnull)methodName 21 | parameter:(NSArray* _Nullable)parameter { 22 | self = [super init]; 23 | if (self) { 24 | self.methodName = methodName; 25 | self.parameter = parameter; 26 | } 27 | return self; 28 | } 29 | 30 | @end 31 | 32 | -------------------------------------------------------------------------------- /capability/bridge/ParameterHelper.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 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 FOUNDATION_ADAPTER_CAPABILITY_BRIDGE_ParameterHelper_H 17 | #define FOUNDATION_ADAPTER_CAPABILITY_BRIDGE_ParameterHelper_H 18 | 19 | #import 20 | 21 | NS_ASSUME_NONNULL_BEGIN 22 | 23 | @interface ParameterHelper : NSObject 24 | 25 | + (id)objectWithJSONString:(NSString*)jsonString; 26 | 27 | + (NSString*)jsonStringWithObject:(id)object; 28 | 29 | @end 30 | 31 | NS_ASSUME_NONNULL_END 32 | 33 | #endif // FOUNDATION_ADAPTER_CAPABILITY_BRIDGE_ParameterHelper_H -------------------------------------------------------------------------------- /capability/bridge/TaskOption.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 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 FOUNDATION_ADAPTER_CAPABILITY_BRIDGE_TASKOPTION_H 17 | #define FOUNDATION_ADAPTER_CAPABILITY_BRIDGE_TASKOPTION_H 18 | 19 | #import 20 | 21 | NS_ASSUME_NONNULL_BEGIN 22 | 23 | @interface TaskOption : NSObject 24 | 25 | /** 26 | * get option of task. 27 | * 28 | * @return option of task. 29 | */ 30 | @property (nonatomic, assign, readonly) BOOL isSerial; 31 | 32 | /** 33 | * Constructor of modifiable TaskOption. 34 | * 35 | * @param isSerial option of task. 36 | * @return TaskOption object. 37 | */ 38 | - (instancetype)initTaskOption:(BOOL)isSerial; 39 | 40 | @end 41 | 42 | NS_ASSUME_NONNULL_END 43 | 44 | #endif // FOUNDATION_ADAPTER_CAPABILITY_BRIDGE_TASKOPTION_H -------------------------------------------------------------------------------- /capability/bridge/TaskOption.mm: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 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 | #import "TaskOption.h" 17 | 18 | @implementation TaskOption 19 | 20 | - (instancetype)init { 21 | self = [super init]; 22 | if (self) { 23 | _isSerial = true; 24 | } 25 | return self; 26 | } 27 | 28 | - (instancetype)initTaskOption:(BOOL)isSerial { 29 | self = [super init]; 30 | if (self) { 31 | _isSerial = isSerial; 32 | } 33 | return self; 34 | } 35 | @end 36 | -------------------------------------------------------------------------------- /capability/bridge/codec/BUILD.gn: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2023 Huawei Device Co., Ltd. 2 | # Licensed under the Apache License, Version 2.0 (the "License"); 3 | # you may not use this file except in compliance with the License. 4 | # You may obtain a copy of the License at 5 | # 6 | # http://www.apache.org/licenses/LICENSE-2.0 7 | # 8 | # Unless required by applicable law or agreed to in writing, software 9 | # distributed under the License is distributed on an "AS IS" BASIS, 10 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | # See the License for the specific language governing permissions and 12 | # limitations under the License. 13 | 14 | import("//build/ohos.gni") 15 | import("//foundation/arkui/ace_engine/ace_config.gni") 16 | 17 | ohos_source_set("bridegecodec") { 18 | cflags_objc = [ 19 | "-fobjc-arc", 20 | "-fobjc-weak", 21 | ] 22 | 23 | cflags_objcc = cflags_objc 24 | 25 | include_dirs = [ 26 | "$ace_root/frameworks", 27 | "$ace_root", 28 | ] 29 | 30 | sources = [ 31 | "BridgeArray.m", 32 | "BridgeBinaryCodec.mm", 33 | "BridgeCodecUtil.h", 34 | "BridgeCodecUtil.mm", 35 | "BridgeJsonCodec.mm", 36 | "BridgeSerializer.mm", 37 | ] 38 | 39 | frameworks = [ 40 | "AVFoundation.framework", 41 | "UIKit.framework", 42 | ] 43 | } 44 | -------------------------------------------------------------------------------- /capability/bridge/codec/BridgeArray.m: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 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 | #import "BridgeArray.h" 17 | 18 | @implementation BridgeArray 19 | 20 | + (instancetype)bridgeArray:(NSArray*)array type:(BridgeArrayType)type { 21 | return [[self alloc] initWithArray:array type:type]; 22 | } 23 | 24 | - (instancetype)initWithArray:(NSArray*)array type:(BridgeArrayType)type { 25 | self = [super init]; 26 | if (self) { 27 | _array = [array copy]; 28 | _arrayType = type; 29 | } 30 | return self; 31 | } 32 | @end -------------------------------------------------------------------------------- /capability/bridge/codec/BridgeBinaryCodec.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 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 FOUNDATION_ADAPTER_CAPABILITY_BRIDGE_CODEC_BridgeBinaryCodec_H 17 | #define FOUNDATION_ADAPTER_CAPABILITY_BRIDGE_CODEC_BridgeBinaryCodec_H 18 | 19 | #import 20 | #import "BridgeCodesDelegate.h" 21 | NS_ASSUME_NONNULL_BEGIN 22 | 23 | @interface BridgeBinaryCodec : NSObject 24 | + (instancetype)sharedInstance; 25 | 26 | // get binary type 27 | - (NSInteger)getBinaryType:(NSData* _Nullable)message; 28 | @end 29 | 30 | NS_ASSUME_NONNULL_END 31 | #endif // FOUNDATION_ADAPTER_CAPABILITY_BRIDGE__CODEC_BridgeBinaryCodec_H -------------------------------------------------------------------------------- /capability/bridge/codec/BridgeCodesDelegate.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 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 FOUNDATION_ADAPTER_CAPABILITY_BRIDGE_BridgeCodesDelegate_H 17 | #define FOUNDATION_ADAPTER_CAPABILITY_BRIDGE_BridgeCodesDelegate_H 18 | 19 | #import 20 | 21 | NS_ASSUME_NONNULL_BEGIN 22 | 23 | @protocol BridgeCodesDelegate 24 | + (instancetype)sharedInstance; 25 | - (id _Nullable)encode:(id _Nullable)message; 26 | - (id _Nullable)decode:(id _Nullable)message; 27 | @end 28 | 29 | NS_ASSUME_NONNULL_END 30 | #endif // FOUNDATION_ADAPTER_CAPABILITY_BRIDGE_BridgeCodesDelegate_H -------------------------------------------------------------------------------- /capability/bridge/codec/BridgeSerializer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 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 FOUNDATION_ADAPTER_CAPABILITY_BRIDGE_CODEC_BridgeSerializer_H 17 | #define FOUNDATION_ADAPTER_CAPABILITY_BRIDGE_CODEC_BridgeSerializer_H 18 | 19 | #import 20 | NS_ASSUME_NONNULL_BEGIN 21 | 22 | @class BridgeStreamWriter,BridgeStreamReader; 23 | 24 | @interface BridgeSerializer : NSObject 25 | 26 | - (BridgeStreamWriter*)writerWithData:(NSMutableData*)data; 27 | 28 | - (BridgeStreamReader*)readerWithData:(NSData*)data; 29 | @end 30 | 31 | @interface BridgeStreamWriter : NSObject 32 | 33 | - (instancetype)initWithData:(NSMutableData*)data; 34 | 35 | - (bool)writeValue:(id)value; 36 | @end 37 | 38 | @interface BridgeStreamReader : NSObject 39 | 40 | - (instancetype)initWithData:(NSData*)data; 41 | 42 | - (BOOL)isNoMoreData; 43 | 44 | - (UInt8)readUnitByte; 45 | 46 | - (nullable id)readValue; 47 | @end 48 | 49 | NS_ASSUME_NONNULL_END 50 | 51 | #endif // FOUNDATION_ADAPTER_CAPABILITY_BRIDGE__CODEC_BridgeSerializer_H -------------------------------------------------------------------------------- /capability/clipboard/clipboard_proxy_impl.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2022 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 | #include "adapter/ios/capability/clipboard/clipboard_proxy_impl.h" 17 | #include "adapter/ios/capability/clipboard/clipboard_impl.h" 18 | 19 | namespace OHOS::Ace::Platform { 20 | 21 | RefPtr ClipboardProxyImpl::GetClipboard(const RefPtr& taskExecutor) const 22 | { 23 | return AceType::MakeRefPtr(taskExecutor); 24 | } 25 | 26 | } // namespace OHOS::Ace::Platform 27 | -------------------------------------------------------------------------------- /capability/clipboard/clipboard_proxy_impl.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2022 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 FOUNDATION_ACE_ADAPTER_IOS_CAPABILITY_CLIPBOARD_CLIPBOARD_IMPL_H 17 | #define FOUNDATION_ACE_ADAPTER_IOS_CAPABILITY_CLIPBOARD_CLIPBOARD_IMPL_H 18 | 19 | #include "base/utils/noncopyable.h" 20 | #include "core/common/clipboard/clipboard_interface.h" 21 | 22 | namespace OHOS::Ace::Platform { 23 | 24 | class ClipboardProxyImpl final : public ClipboardInterface { 25 | public: 26 | ClipboardProxyImpl() = default; 27 | ~ClipboardProxyImpl() = default; 28 | 29 | RefPtr GetClipboard(const RefPtr& taskEexcutor) const override; 30 | private: 31 | 32 | ACE_DISALLOW_COPY_AND_MOVE(ClipboardProxyImpl); 33 | }; 34 | 35 | } // namespace OHOS::Ace::Platform 36 | 37 | #endif // FOUNDATION_ACE_ADAPTER_IOS_CAPABILITY_CLIPBOARD_CLIPBOARD_IMPL_H 38 | -------------------------------------------------------------------------------- /capability/clipboard/multiType_record_impl.cpp: -------------------------------------------------------------------------------- 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 | #include "adapter/preview/entrance/clipboard/multiType_record_impl.h" 17 | 18 | namespace OHOS::Ace { 19 | 20 | MultiTypeRecordImpl::MultiTypeRecordImpl() {} 21 | 22 | void MultiTypeRecordImpl::SetPlainText(const std::string plainText) 23 | { 24 | plainText_ = plainText; 25 | } 26 | void MultiTypeRecordImpl::SetUri(const std::string uri) 27 | { 28 | uri_ = uri; 29 | } 30 | void MultiTypeRecordImpl::SetPixelMap(RefPtr pixelMap) 31 | { 32 | pixelMap_ = pixelMap; 33 | } 34 | const RefPtr MultiTypeRecordImpl::GetPixelMap() 35 | { 36 | return pixelMap_; 37 | } 38 | const std::string MultiTypeRecordImpl::GetPlainText() 39 | { 40 | return plainText_; 41 | } 42 | const std::string MultiTypeRecordImpl::GetUri() 43 | { 44 | return uri_; 45 | } 46 | std::vector& MultiTypeRecordImpl::GetSpanStringBuffer() 47 | { 48 | return spanStringBuffer_; 49 | } 50 | 51 | } // namespace OHOS::Ace 52 | -------------------------------------------------------------------------------- /capability/editing/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2013 The Flutter Authors. All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without modification, 4 | are permitted provided that the following conditions are met: 5 | 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above 9 | copyright notice, this list of conditions and the following 10 | disclaimer in the documentation and/or other materials provided 11 | with the distribution. 12 | * Neither the name of Google Inc. nor the names of its 13 | contributors may be used to endorse or promote products derived 14 | from this software without specific prior written permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 20 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 23 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- /capability/editing/iOSTextInputDelegate.h: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Flutter Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #ifndef iOSTextInputDelegate_h 6 | #define iOSTextInputDelegate_h 7 | 8 | #import 9 | 10 | typedef NS_ENUM(NSInteger, iOSTextInputAction) { 11 | iOSTextInputActionUnspecified, 12 | iOSTextInputActionDone, 13 | iOSTextInputActionGo, 14 | iOSTextInputActionSend, 15 | iOSTextInputActionSearch, 16 | iOSTextInputActionNext, 17 | iOSTextInputActionContinue, 18 | iOSTextInputActionJoin, 19 | iOSTextInputActionRoute, 20 | iOSTextInputActionEmergencyCall, 21 | iOSTextInputActionNewline, 22 | }; 23 | 24 | typedef NS_ENUM(NSInteger, iOSFloatingCursorDragState) { 25 | iOSFloatingCursorDragStateStart, 26 | iOSFloatingCursorDragStateUpdate, 27 | iOSFloatingCursorDragStateEnd, 28 | }; 29 | 30 | typedef void (^updateEditingClientBlock)(int client, NSDictionary *state); 31 | typedef void (^updateErrorTextBlock)(int client, NSDictionary *state); 32 | typedef void (^performActionBlock)(int action, int client); 33 | 34 | @protocol iOSTextInputDelegate 35 | 36 | - (void)updateEditingClient:(int)client withState:(NSDictionary*)state; 37 | - (void)performAction:(iOSTextInputAction)action withClient:(int)client; 38 | - (void)updateFloatingCursor:(iOSFloatingCursorDragState)state 39 | withClient:(int)client 40 | withPosition:(NSDictionary*)point; 41 | 42 | @end 43 | 44 | #endif /* iOSTextInputDelegate_h */ 45 | -------------------------------------------------------------------------------- /capability/editing/iOSTxtInputManager.h: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Flutter Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #import 6 | 7 | #include "iOSTextInputDelegate.h" 8 | 9 | NS_ASSUME_NONNULL_BEGIN 10 | 11 | @interface iOSTxtInputManager : NSObject 12 | 13 | + (instancetype)shareintance; 14 | @property(nonatomic, weak) id textInputDelegate; 15 | @property (nonatomic, copy) updateEditingClientBlock textInputBlock; 16 | @property (nonatomic, copy) updateErrorTextBlock errorTextBlock; 17 | @property (nonatomic, copy) performActionBlock textPerformBlock; 18 | @property (nonatomic, assign) CGFloat inputBoxY; 19 | @property (nonatomic, assign) CGFloat inputBoxTopY; 20 | @property (nonatomic, assign) bool isDeclarative; 21 | 22 | - (UIView*)textInputView; 23 | - (void)showTextInput; 24 | - (void)hideTextInput; 25 | - (void)setTextInputClient:(int)client withConfiguration:(NSDictionary*)configuration; 26 | - (void)setTextInputEditingState:(NSDictionary*)state; 27 | - (void)clearTextInputClient; 28 | 29 | @end 30 | 31 | @interface iOSTextPosition : UITextPosition 32 | 33 | @property(nonatomic, readonly) NSUInteger index; 34 | 35 | + (instancetype)positionWithIndex:(NSUInteger)index; 36 | - (instancetype)initWithIndex:(NSUInteger)index; 37 | 38 | @end 39 | 40 | @interface iOSTextRange : UITextRange 41 | 42 | @property(nonatomic, readonly) NSRange range; 43 | + (instancetype)rangeWithNSRange:(NSRange)range; 44 | 45 | @end 46 | 47 | NS_ASSUME_NONNULL_END 48 | -------------------------------------------------------------------------------- /capability/editing/text_input_plugin.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2022 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 | #include "adapter/ios/capability/editing/text_input_plugin.h" 17 | 18 | #include "adapter/ios/capability/editing/text_input_client_handler.h" 19 | #include "adapter/ios/capability/editing/text_input_connection_impl.h" 20 | #include "base/log/log.h" 21 | 22 | namespace OHOS::Ace::Platform { 23 | 24 | RefPtr TextInputPlugin::Attach(const WeakPtr& client, 25 | const TextInputConfiguration& config, const RefPtr& taskExecutor, int32_t instanceId) 26 | { 27 | LOGE("vail->iOSTxtInput::Attach"); 28 | auto connection = AceType::MakeRefPtr(client, taskExecutor, config); 29 | TextInputClientHandler::GetInstance().SetCurrentConnection(connection); 30 | return connection; 31 | } 32 | 33 | } // namespace OHOS::Ace::Platform 34 | -------------------------------------------------------------------------------- /capability/editing/text_input_plugin.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2022 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 FOUNDATION_ACE_ADAPTER_IOS_CAPABILITY_EDITING_TEXT_INPUT_PLUGIN_H 17 | #define FOUNDATION_ACE_ADAPTER_IOS_CAPABILITY_EDITING_TEXT_INPUT_PLUGIN_H 18 | 19 | #include "base/utils/noncopyable.h" 20 | #include "core/common/ime/text_input.h" 21 | 22 | namespace OHOS::Ace::Platform { 23 | 24 | class TextInputPlugin final : public TextInput { 25 | public: 26 | TextInputPlugin() = default; 27 | ~TextInputPlugin() = default; 28 | 29 | // Implement TextInput 30 | RefPtr Attach(const WeakPtr& client, const TextInputConfiguration& config, 31 | const RefPtr& taskExecutor, int32_t instanceId) override; 32 | 33 | private: 34 | ACE_DISALLOW_COPY_AND_MOVE(TextInputPlugin); 35 | }; 36 | 37 | } // namespace OHOS::Ace::Platform 38 | 39 | #endif // FOUNDATION_ACE_ADAPTER_IOS_CAPABILITY_EDITING_TEXT_INPUT_PLUGIN_H -------------------------------------------------------------------------------- /capability/environment/environment_impl.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2022 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 FOUNDATION_ACE_ADAPTER_IOS_CAPABILITY_ENVIRONMENT_ENVIRONMENT_IMPL_H 17 | #define FOUNDATION_ACE_ADAPTER_IOS_CAPABILITY_ENVIRONMENT_ENVIRONMENT_IMPL_H 18 | 19 | #include "core/common/environment/environment.h" 20 | 21 | namespace OHOS::Ace::Platform { 22 | 23 | class EnvironmentImpl : public Environment { 24 | public: 25 | explicit EnvironmentImpl(const RefPtr& taskExecutor); 26 | ~EnvironmentImpl() override = default; 27 | 28 | std::string GetAccessibilityEnabled() override; 29 | }; 30 | 31 | } // namespace OHOS::Ace::Platform 32 | 33 | #endif // FOUNDATION_ACE_ADAPTER_ANDROID_CAPABILITY_JAVA_JNI_ENVIRONMENT_ENVIRONMENT_IMPL_H -------------------------------------------------------------------------------- /capability/environment/environment_impl.mm: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2022 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 | #include "adapter/ios/capability/environment/environment_impl.h" 17 | 18 | #import 19 | 20 | namespace OHOS::Ace::Platform { 21 | 22 | EnvironmentImpl::EnvironmentImpl(const RefPtr& taskExecutor) : Environment(taskExecutor) {} 23 | 24 | std::string EnvironmentImpl::GetAccessibilityEnabled() 25 | { 26 | std::string result; 27 | if (taskExecutor_) { 28 | taskExecutor_->PostSyncTask([&result] { 29 | result = "false"; 30 | // 辅助功能->旁白、切换控制 31 | bool enabled = UIAccessibilityIsVoiceOverRunning() || UIAccessibilityIsSwitchControlRunning(); 32 | if(enabled){ 33 | result = "true"; 34 | } 35 | }, TaskExecutor::TaskType::JS, "ArkUI-XEnvironmentImplGetAccessibilityEnabled"); 36 | } 37 | return result; 38 | } 39 | 40 | } // namespace OHOS::Ace::Platform -------------------------------------------------------------------------------- /capability/environment/environment_proxy_impl.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2022-2025 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 | #include "adapter/ios/capability/environment/environment_proxy_impl.h" 17 | 18 | #include "adapter/ios/capability/environment/environment_impl.h" 19 | 20 | namespace OHOS::Ace::Platform { 21 | 22 | EnvironmentProxyImpl* EnvironmentProxyImpl::inst_ = nullptr; 23 | 24 | std::mutex EnvironmentProxyImpl::mutex_; 25 | 26 | EnvironmentProxyImpl* EnvironmentProxyImpl::GetInstance() 27 | { 28 | if (inst_ == nullptr) { 29 | std::lock_guard lock(mutex_); 30 | if (inst_ == nullptr) { 31 | inst_ = new EnvironmentProxyImpl(); 32 | } 33 | } 34 | return (inst_); 35 | } 36 | 37 | RefPtr EnvironmentProxyImpl::GetEnvironment(const RefPtr& taskExecutor) const 38 | { 39 | return AceType::MakeRefPtr(taskExecutor); 40 | } 41 | 42 | } // namespace OHOS::Ace::Platform 43 | -------------------------------------------------------------------------------- /capability/environment/environment_proxy_impl.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2022-2025 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 FOUNDATION_ACE_ADAPTER_IOS_CAPABILITY_ENVIRONMENT_PROXY_IMPL_H 17 | #define FOUNDATION_ACE_ADAPTER_IOS_CAPABILITY_ENVIRONMENT_PROXY_IMPL_H 18 | 19 | #include "base/utils/noncopyable.h" 20 | #include "core/common/environment/environment_interface.h" 21 | 22 | namespace OHOS::Ace::Platform { 23 | 24 | class EnvironmentProxyImpl final : public EnvironmentInterface { 25 | public: 26 | EnvironmentProxyImpl() = default; 27 | ~EnvironmentProxyImpl() = default; 28 | 29 | static EnvironmentProxyImpl* GetInstance(); 30 | 31 | RefPtr GetEnvironment(const RefPtr& taskExecutor) const override; 32 | 33 | ACE_DISALLOW_COPY_AND_MOVE(EnvironmentProxyImpl); 34 | 35 | private: 36 | static EnvironmentProxyImpl* inst_; 37 | static std::mutex mutex_; 38 | }; 39 | 40 | } // namespace OHOS::Ace::Platform 41 | 42 | #endif // FOUNDATION_ACE_ADAPTER_IOS_CAPABILITY_ENVIRONMENT_PROXY_IMPL_H 43 | -------------------------------------------------------------------------------- /capability/font/font_platform_impl.cpp: -------------------------------------------------------------------------------- 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 | #include "adapter/ios/capability/font/font_platform_impl.h" 17 | 18 | #include "adapter/ios/capability/font/system_font_manager.h" 19 | 20 | namespace OHOS::Ace::Platform { 21 | 22 | void FontPlatformImpl::GetSystemFontList(std::vector& fontList) 23 | { 24 | SystemFontManager systemFontManager; 25 | systemFontManager.GetSystemFontList(fontList); 26 | } 27 | 28 | bool FontPlatformImpl::GetSystemFont(const std::string& fontName, FontInfo& fontInfo) 29 | { 30 | SystemFontManager systemFontManager; 31 | return systemFontManager.GetSystemFont(fontName, fontInfo); 32 | } 33 | 34 | } // namespace OHOS::Ace::Platform -------------------------------------------------------------------------------- /capability/font/font_platform_impl.h: -------------------------------------------------------------------------------- 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 FOUNDATION_ACE_ADAPTER_IOS_CAPABILITY_FONT_FONT_PLATFORM_IMPL_H 17 | #define FOUNDATION_ACE_ADAPTER_IOS_CAPABILITY_FONT_FONT_PLATFORM_IMPL_H 18 | 19 | #include "core/common/font/font_platform.h" 20 | 21 | namespace OHOS::Ace::Platform { 22 | 23 | class FontPlatformImpl : public FontPlatform { 24 | public: 25 | FontPlatformImpl() = default; 26 | ~FontPlatformImpl() override = default; 27 | 28 | void GetSystemFontList(std::vector& fontList) override; 29 | bool GetSystemFont(const std::string& fontName, FontInfo& fontInfo) override; 30 | }; 31 | 32 | } // namespace OHOS::Ace::Platform 33 | #endif // FOUNDATION_ACE_ADAPTER_IOS_CAPABILITY_FONT_FONT_PLATFORM_IMPL_H -------------------------------------------------------------------------------- /capability/font/font_platform_proxy_impl.cpp: -------------------------------------------------------------------------------- 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 | #include "adapter/ios/capability/font/font_platform_proxy_impl.h" 17 | 18 | #include "adapter/ios/capability/font/font_platform_impl.h" 19 | 20 | namespace OHOS::Ace::Platform { 21 | 22 | RefPtr FontPlatformProxyImpl::GetFontPlatform() const 23 | { 24 | return AceType::MakeRefPtr(); 25 | } 26 | 27 | } // namespace OHOS::Ace::Platform 28 | -------------------------------------------------------------------------------- /capability/font/font_platform_proxy_impl.h: -------------------------------------------------------------------------------- 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 FOUNDATION_ACE_ADAPTER_IOS_CAPABILITY_FONT_FONT_PLATFORM_PROXY_IMPL_H 17 | #define FOUNDATION_ACE_ADAPTER_IOS_CAPABILITY_FONT_FONT_PLATFORM_PROXY_IMPL_H 18 | 19 | #include "base/utils/noncopyable.h" 20 | 21 | #include "core/common/font/font_platform_interface.h" 22 | 23 | namespace OHOS::Ace::Platform { 24 | 25 | class FontPlatformProxyImpl final : public FontPlatformInterface { 26 | public: 27 | FontPlatformProxyImpl() = default; 28 | ~FontPlatformProxyImpl() = default; 29 | 30 | RefPtr GetFontPlatform() const override; 31 | 32 | ACE_DISALLOW_COPY_AND_MOVE(FontPlatformProxyImpl); 33 | }; 34 | 35 | } // namespace OHOS::Ace::Platform 36 | #endif // FOUNDATION_ACE_ADAPTER_IOS_CAPABILITY_FONT_FONT_PLATFORM_PROXY_IMPL_H 37 | -------------------------------------------------------------------------------- /capability/font/system_font_manager.h: -------------------------------------------------------------------------------- 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 FOUNDATION_ACE_ADAPTER_IOS_CAPABILITY_FONT_SYSTEM_FONT_MANAGER_H 17 | #define FOUNDATION_ACE_ADAPTER_IOS_CAPABILITY_FONT_SYSTEM_FONT_MANAGER_H 18 | 19 | #include 20 | #include 21 | #include 22 | 23 | #include "core/common/font_manager.h" 24 | 25 | namespace OHOS::Ace::Platform { 26 | 27 | using FontNameFamilyMap = std::map; 28 | 29 | class SystemFontManager { 30 | public: 31 | SystemFontManager() = default; 32 | virtual ~SystemFontManager() = default; 33 | 34 | void GetSystemFontList(std::vector& fontList); 35 | bool GetSystemFont(const std::string& fontName, FontInfo& fontInfo); 36 | private: 37 | void GetSystemFontNameFamilyMap(); 38 | bool GetSystemFontDetailByName(const std::string& fontName, FontInfo& fontInfo); 39 | 40 | static std::unique_ptr fontNameFamilyMap_; 41 | }; 42 | } // namespace OHOS::Ace::Platform 43 | #endif // FOUNDATION_ACE_ADAPTER_IOS_CAPABILITY_FONT_SYSTEM_FONT_MANAGER_H -------------------------------------------------------------------------------- /capability/platformview/AcePlatformViewDelegate.h: -------------------------------------------------------------------------------- 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 | #ifndef FOUNDATION_ADAPTER_CAPABILITY_PLATFORMVIEW_ACEPLATFORMVIEWDELEGATE_H 16 | #define FOUNDATION_ADAPTER_CAPABILITY_PLATFORMVIEW_ACEPLATFORMVIEWDELEGATE_H 17 | 18 | #import 19 | 20 | @protocol AcePlatformViewDelegate 21 | 22 | - (void)registerBufferWithInstanceId:(int32_t)instanceId textureId:(int64_t)textureId 23 | texturePixelBuffer:(void*)texturePixelBuffer; 24 | - (void)unregisterBufferWithInstanceId:(int32_t)instanceId textureId:(int64_t)textureId; 25 | 26 | - (void)registerContextPtrWithInstanceId:(int32_t)instanceId textureId:(int64_t)textureId 27 | contextPtr:(void*)contextPtr; 28 | @end 29 | 30 | #endif // FOUNDATION_ADAPTER_CAPABILITY_PLATFORMVIEW_ACEPLATFORMVIEWDELEGATE_H 31 | -------------------------------------------------------------------------------- /capability/platformview/IPlatformView.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 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 | #ifndef FOUNDATION_ADAPTER_CAPABILITY_IPLATFORMVIEW_H 16 | #define FOUNDATION_ADAPTER_CAPABILITY_IPLATFORMVIEW_H 17 | 18 | #import 19 | 20 | NS_ASSUME_NONNULL_BEGIN 21 | 22 | /** 23 | * include `UIView` for embedding in arkui framework 24 | */ 25 | @protocol IPlatformView 26 | /** 27 | * return a reference to `UIView` . 28 | */ 29 | - (UIView*)view; 30 | 31 | /** 32 | * dispose platform view 33 | */ 34 | - (void) onDispose; 35 | 36 | /** 37 | * return tag of platform view 38 | */ 39 | - (NSString*)getPlatformViewID; 40 | 41 | @end 42 | 43 | NS_ASSUME_NONNULL_END 44 | 45 | #endif // FOUNDATION_ADAPTER_CAPABILITY_IPLATFORMVIEW_H -------------------------------------------------------------------------------- /capability/platformview/PlatformViewFactory.h: -------------------------------------------------------------------------------- 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 | #ifndef FOUNDATION_ADAPTER_CAPABILITY_PLATFORMVIEWFACTORY_H 16 | #define FOUNDATION_ADAPTER_CAPABILITY_PLATFORMVIEWFACTORY_H 17 | 18 | #import 19 | #import "IPlatformView.h" 20 | 21 | NS_ASSUME_NONNULL_BEGIN 22 | 23 | /** 24 | * factory for platform view 25 | */ 26 | @protocol PlatformViewFactory 27 | /** 28 | * return a reference to `IPlatformView` . 29 | */ 30 | - (NSObject*) getPlatformView:(NSString*) xComponentId; 31 | 32 | @end 33 | 34 | NS_ASSUME_NONNULL_END 35 | 36 | #endif // FOUNDATION_ADAPTER_CAPABILITY_PLATFORMVIEWFACTORY_H -------------------------------------------------------------------------------- /capability/platformview/render/RenderProgram.h: -------------------------------------------------------------------------------- 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 RENDER_PROGRAM_H 17 | #define RENDER_PROGRAM_H 18 | 19 | #import 20 | #import 21 | #import 22 | 23 | @interface RenderProgram : NSObject 24 | { 25 | GLuint filterProgram; 26 | } 27 | 28 | - (instancetype)initWithVertexShaderType:(NSString*)vString fragShader:(NSString*)fString; 29 | - (GLint)attribLocationForName:(NSString*)atrname; 30 | - (GLint)uniformLocationForName:(NSString*)uname; 31 | - (void)use; 32 | - (void)destroy; 33 | @end 34 | 35 | #endif // RENDER_PROGRAM_H -------------------------------------------------------------------------------- /capability/platformview/render/RenderView.h: -------------------------------------------------------------------------------- 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 | #ifndef RENDER_VIEW_H 16 | #define RENDER_VIEW_H 17 | 18 | #import 19 | 20 | #import 21 | #import 22 | #import 23 | 24 | @interface RenderView : UIView 25 | - (void)init; 26 | - (void)setEAGLContext:(EAGLContext*)context; 27 | - (void)setTextureName:(int32_t)textureName; 28 | - (bool)startRender:(UIView *)view; 29 | - (void)exchangeBind; 30 | 31 | - (bool)setupImageData:(UIImage *)image; 32 | @end 33 | 34 | #endif // RENDER_VIEW_H -------------------------------------------------------------------------------- /capability/storage/storage_impl.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2022 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 FOUNDATION_ACE_ADAPTER_IOS_CAPABILITY_STORAGE_STORAGE_IMPL_H 17 | #define FOUNDATION_ACE_ADAPTER_IOS_CAPABILITY_STORAGE_STORAGE_IMPL_H 18 | 19 | #include "core/common/storage/storage.h" 20 | 21 | namespace OHOS::Ace::Platform { 22 | 23 | class StorageImpl : public Storage { 24 | public: 25 | explicit StorageImpl(); 26 | ~StorageImpl() override = default; 27 | 28 | void SetString(const std::string& key, const std::string& value) override; 29 | std::string GetString(const std::string& key) override; 30 | void SetDouble(const std::string& key, const double value) override; 31 | bool GetDouble(const std::string& key, double& value) override; 32 | void SetBoolean(const std::string& key, const bool value) override; 33 | bool GetBoolean(const std::string& key, bool& value) override; 34 | void Clear() override; 35 | void Delete(const std::string& key) override; 36 | }; 37 | 38 | } // namespace OHOS::Ace::Platform 39 | 40 | #endif // FOUNDATION_ACE_ADAPTER_IOS_CAPABILITY_STORAGE_STORAGE_IMPL_H 41 | -------------------------------------------------------------------------------- /capability/storage/storage_proxy_impl.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2022 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 | #include "adapter/ios/capability/storage/storage_proxy_impl.h" 17 | 18 | #include "adapter/ios/capability/storage/storage_impl.h" 19 | 20 | namespace OHOS::Ace::Platform { 21 | 22 | RefPtr StorageProxyImpl::GetStorage(int areaMode) const 23 | { 24 | return AceType::MakeRefPtr(); 25 | } 26 | 27 | } // namespace OHOS::Ace::Platform -------------------------------------------------------------------------------- /capability/storage/storage_proxy_impl.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2022 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 FOUNDATION_ACE_ADAPTER_IOS_CAPABILITY_STORAGE_STORAGE_PROXY_IMPL_H 17 | #define FOUNDATION_ACE_ADAPTER_IOS_CAPABILITY_STORAGE_STORAGE_PROXY_IMPL_H 18 | 19 | #include "base/utils/noncopyable.h" 20 | #include "core/common/storage/storage_interface.h" 21 | 22 | namespace OHOS::Ace::Platform { 23 | 24 | class StorageProxyImpl final : public StorageInterface { 25 | public: 26 | StorageProxyImpl() = default; 27 | ~StorageProxyImpl() = default; 28 | 29 | RefPtr GetStorage(int areaMode = -1) const override; 30 | 31 | ACE_DISALLOW_COPY_AND_MOVE(StorageProxyImpl); 32 | }; 33 | 34 | } // namespace OHOS::Ace::Platform 35 | 36 | #endif // FOUNDATION_ACE_ADAPTER_IOS_CAPABILITY_STORAGE_STORAGE_PROXY_IMPL_H 37 | -------------------------------------------------------------------------------- /capability/surface/AceSurfacePlugin.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023-2025 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 FOUNDATION_ADAPTER_CAPABILITY_SURFACE_ACESURFACEPLUGIN_H 17 | #define FOUNDATION_ADAPTER_CAPABILITY_SURFACE_ACESURFACEPLUGIN_H 18 | 19 | #import 20 | #import "AceResourcePlugin.h" 21 | #import "IAceSurface.h" 22 | NS_ASSUME_NONNULL_BEGIN 23 | 24 | @interface AceSurfacePlugin : AceResourcePlugin 25 | + (AceSurfacePlugin *)createRegister:(UIViewController *)target abilityInstanceId:(int32_t)abilityInstanceId 26 | delegate:(id)delegate; 27 | - (int64_t)create:(NSDictionary *)param; 28 | - (id)getObject:(int64_t)incId; 29 | - (void)notifyOrientationDidChange; 30 | - (BOOL)release:(NSString *)incId; 31 | - (void)releaseObject; 32 | @end 33 | 34 | NS_ASSUME_NONNULL_END 35 | 36 | #endif // FOUNDATION_ADAPTER_CAPABILITY_SURFACE_ACESURFACEPLUGIN_H -------------------------------------------------------------------------------- /capability/surface/IAceSurface.h: -------------------------------------------------------------------------------- 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 | #ifndef FOUNDATION_ADAPTER_CAPABILITY_SURFACE_IACESURFACE_H 16 | #define FOUNDATION_ADAPTER_CAPABILITY_SURFACE_IACESURFACE_H 17 | 18 | #import 19 | 20 | @protocol IAceSurface 21 | 22 | - (uintptr_t)attachNaitveSurface:(CALayer *)layer; 23 | 24 | @end 25 | 26 | #endif // FOUNDATION_ADAPTER_CAPABILITY_SURFACE_IACESURFACE_H -------------------------------------------------------------------------------- /capability/texture/AceTexture.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 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 | #ifndef FOUNDATION_ADAPTER_CAPABILITY_TEXTURE_ACETEXTURE_H 16 | #define FOUNDATION_ADAPTER_CAPABILITY_TEXTURE_ACETEXTURE_H 17 | 18 | #import 19 | #import 20 | #import 21 | #import 22 | #import "IAceOnCallResourceMethod.h" 23 | #import "IAceOnResourceEvent.h" 24 | 25 | typedef void (^IAceTextureAttachEventCallback)(int32_t textureName); 26 | 27 | NS_ASSUME_NONNULL_BEGIN 28 | 29 | @interface AceTexture : NSObject 30 | @property (nonatomic, strong) AVPlayerItemVideoOutput *videoOutput; 31 | - (instancetype)initWithEvents:(IAceOnResourceEvent)callback 32 | textureId:(int64_t)textureId abilityInstanceId:(int32_t)abilityInstanceId; 33 | - (NSDictionary*)getCallMethod; 34 | - (void)refreshPixelBuffer; 35 | - (void)releaseObject; 36 | - (void)addAttachEventCallback:(IAceTextureAttachEventCallback)callback; 37 | 38 | @end 39 | 40 | NS_ASSUME_NONNULL_END 41 | 42 | #endif // FOUNDATION_ADAPTER_CAPABILITY_TEXTURE_ACETEXTURE_H -------------------------------------------------------------------------------- /capability/texture/AceTextureDelegate.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 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 | #ifndef FOUNDATION_ADAPTER_CAPABILITY_TEXTURE_ACETEXTUREDELEGATE_H 16 | #define FOUNDATION_ADAPTER_CAPABILITY_TEXTURE_ACETEXTUREDELEGATE_H 17 | 18 | #import 19 | 20 | @protocol AceTextureDelegate 21 | 22 | - (void)registerSurfaceWithInstanceId:(int32_t)instanceId textureId:(int64_t)textureId 23 | textureObject:(void*)textureObject; 24 | 25 | - (void)unregisterSurfaceWithInstanceId:(int32_t)instanceId textureId:(int64_t)textureId; 26 | 27 | - (void*)getNativeWindowWithInstanceId:(int32_t)instanceId textureId:(int64_t)textureId; 28 | 29 | @end 30 | 31 | #endif // FOUNDATION_ADAPTER_CAPABILITY_TEXTURE_ACETEXTURE_H 32 | -------------------------------------------------------------------------------- /capability/texture/AceTextureResourcePlugin.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 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 | #ifndef FOUNDATION_ADAPTER_CAPABILITY_TEXTURE_ACETEXTURERESOURCEPLUGIN_H 16 | #define FOUNDATION_ADAPTER_CAPABILITY_TEXTURE_ACETEXTURERESOURCEPLUGIN_H 17 | 18 | #import 19 | 20 | #import "AceResourcePlugin.h" 21 | #import "AceTextureDelegate.h" 22 | 23 | NS_ASSUME_NONNULL_BEGIN 24 | 25 | @interface AceTextureResourcePlugin : AceResourcePlugin 26 | @property (nonatomic, weak) id delegate; 27 | + (AceTextureResourcePlugin *)createTexturePluginWithInstanceId:(int32_t)instanceId; 28 | 29 | - (id)getObject:(NSString *)id; 30 | - (int64_t)create:(NSDictionary *)param; 31 | - (BOOL)release:(NSString *)id; 32 | - (void)releaseObject; 33 | @end 34 | 35 | NS_ASSUME_NONNULL_END 36 | 37 | #endif // FOUNDATION_ADAPTER_CAPABILITY_TEXTURE_ACETEXTURERESOURCEPLUGIN_H 38 | -------------------------------------------------------------------------------- /capability/vibrator/iOSVibratorManager.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2022 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 | #import 17 | 18 | NS_ASSUME_NONNULL_BEGIN 19 | 20 | @interface iOSVibratorManager : NSObject 21 | 22 | + (instancetype)shareintance; 23 | @property(nonatomic,assign) NSInteger duration; 24 | - (void)addVibrate:(NSInteger)duration; 25 | - (void)addVibrateSingle; 26 | 27 | @end 28 | 29 | NS_ASSUME_NONNULL_END 30 | -------------------------------------------------------------------------------- /capability/vibrator/vibrator_impl.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2022 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 FOUNDATION_ACE_ADAPTER_IOS_CAPABILITY_VIBRATOR_VIBRATOR_IMPL_H 17 | #define FOUNDATION_ACE_ADAPTER_IOS_CAPABILITY_VIBRATOR_VIBRATOR_IMPL_H 18 | 19 | #include "core/common/vibrator/vibrator.h" 20 | 21 | namespace OHOS::Ace::Platform { 22 | 23 | class VibratorImpl : public Vibrator { 24 | public: 25 | explicit VibratorImpl(const RefPtr& taskExecutor); 26 | ~VibratorImpl() override = default; 27 | 28 | void Vibrate(int32_t duration) override; 29 | void Vibrate(const std::string& effectId) override; 30 | }; 31 | 32 | } // namespace OHOS::Ace::Platform 33 | 34 | #endif // FOUNDATION_ACE_ADAPTER_IOS_CAPABILITY_VIBRATOR_VIBRATOR_IMPL_H 35 | -------------------------------------------------------------------------------- /capability/vibrator/vibrator_impl.mm: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2022 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 | #include "adapter/ios/capability/vibrator/vibrator_impl.h" 17 | 18 | #import "iOSVibratorManager.h" 19 | 20 | namespace OHOS::Ace::Platform { 21 | 22 | VibratorImpl::VibratorImpl(const RefPtr& taskExecutor) : Vibrator(taskExecutor) {} 23 | 24 | void VibratorImpl::Vibrate(int32_t duration) 25 | { 26 | if (taskExecutor_) { 27 | taskExecutor_->PostTask([duration] { 28 | [[iOSVibratorManager shareintance] addVibrate:duration]; 29 | }, TaskExecutor::TaskType::PLATFORM, "ArkUI-XVibratorImplVibrateInt"); 30 | } 31 | } 32 | 33 | void VibratorImpl::Vibrate(const std::string& effectId) 34 | { 35 | if (taskExecutor_) { 36 | taskExecutor_->PostTask([effectId] { 37 | [[iOSVibratorManager shareintance] addVibrateSingle]; 38 | }, TaskExecutor::TaskType::PLATFORM, "ArkUI-XVibratorImplVibrateString"); 39 | } 40 | } 41 | 42 | 43 | } // namespace OHOS::Ace::Platform 44 | -------------------------------------------------------------------------------- /capability/vibrator/vibrator_proxy_impl.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2022 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 | #include "adapter/ios/capability/vibrator/vibrator_proxy_impl.h" 17 | #include "adapter/ios/capability/vibrator/vibrator_impl.h" 18 | 19 | namespace OHOS::Ace::Platform { 20 | 21 | RefPtr VibratorProxyImpl::GetVibrator(const RefPtr& taskExecutor) 22 | { 23 | return AceType::MakeRefPtr(taskExecutor); 24 | } 25 | 26 | } // namespace OHOS::Ace::Platform -------------------------------------------------------------------------------- /capability/vibrator/vibrator_proxy_impl.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2022 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 FOUNDATION_ACE_ADAPTER_IOS_CAPABILITY_VIBRATOR_VIBRATOR_PROXY_IMPL_H 17 | #define FOUNDATION_ACE_ADAPTER_IOS_CAPABILITY_VIBRATOR_VIBRATOR_PROXY_IMPL_H 18 | 19 | #include "base/utils/noncopyable.h" 20 | #include "core/common/vibrator/vibrator_interface.h" 21 | 22 | namespace OHOS::Ace::Platform { 23 | 24 | class VibratorProxyImpl final : public VibratorInterface { 25 | public: 26 | VibratorProxyImpl() = default; 27 | ~VibratorProxyImpl() = default; 28 | 29 | RefPtr GetVibrator(const RefPtr& taskExecutor) override; 30 | 31 | ACE_DISALLOW_COPY_AND_MOVE(VibratorProxyImpl); 32 | }; 33 | 34 | } // namespace OHOS::Ace::Platform 35 | 36 | #endif // FOUNDATION_ACE_ADAPTER_IOS_CAPABILITY_VIBRATOR_VIBRATOR_PROXY_IMPL_H 37 | -------------------------------------------------------------------------------- /capability/video/AceVideo.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2022 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 FOUNDATION_ADAPTER_CAPABILITY_VIDEO_ACEVIDEO_H 17 | #define FOUNDATION_ADAPTER_CAPABILITY_VIDEO_ACEVIDEO_H 18 | 19 | #import 20 | 21 | #import "AceTexture.h" 22 | #import "IAceOnCallResourceMethod.h" 23 | #import "IAceOnResourceEvent.h" 24 | 25 | NS_ASSUME_NONNULL_BEGIN 26 | 27 | @interface AceVideo : NSObject 28 | - (instancetype)init:(int64_t)incId 29 | moudleName:(NSString*)moudleName 30 | onEvent:(IAceOnResourceEvent)callback 31 | texture:(AceTexture *)texture 32 | abilityInstanceId:(int32_t)abilityInstanceId; 33 | - (NSDictionary *)getSyncCallMethod; 34 | - (void)onActivityResume; 35 | - (void)onActivityPause; 36 | - (void)releaseObject; 37 | @end 38 | 39 | NS_ASSUME_NONNULL_END 40 | 41 | #endif // FOUNDATION_ADAPTER_CAPABILITY_VIDEO_ACEVIDEO_H -------------------------------------------------------------------------------- /capability/video/AceVideoResourcePlugin.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2022 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 FOUNDATION_ADAPTER_CAPABILITY_VIDEO_ACEVIDEORESOURCEPLUGIN_H 17 | #define FOUNDATION_ADAPTER_CAPABILITY_VIDEO_ACEVIDEORESOURCEPLUGIN_H 18 | 19 | #import 20 | 21 | #import "AceResourcePlugin.h" 22 | 23 | NS_ASSUME_NONNULL_BEGIN 24 | 25 | @interface AceVideoResourcePlugin : AceResourcePlugin 26 | + (AceVideoResourcePlugin *)createRegister:(NSString *)moudleName abilityInstanceId:(int32_t)abilityInstanceId; 27 | - (id)getObject:(NSString *)incId; 28 | - (int64_t)create:(NSDictionary *)param; 29 | - (BOOL)release:(NSString *)incId; 30 | - (void)releaseObject; 31 | @end 32 | 33 | NS_ASSUME_NONNULL_END 34 | 35 | #endif // FOUNDATION_ADAPTER_CAPABILITY_VIDEO_ACEVIDEORESOURCEPLUGIN_H -------------------------------------------------------------------------------- /capability/web/AceWebCallbackObjectWrapper.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 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 AceWebCallbackObjectWrapper_hpp 17 | #define AceWebCallbackObjectWrapper_hpp 18 | #include 19 | #include 20 | #include 21 | 22 | enum class AceWebHandleResult { 23 | CONFIRM, 24 | CANCEL, 25 | HTTPAUTHINFOSAVED, 26 | PROMPTCONFIRM, 27 | GRANT, 28 | DENY, 29 | }; 30 | 31 | void InjectAceWebResourceObject(); 32 | 33 | #endif /* AceWebCallbackObjectWrapper_hpp */ 34 | -------------------------------------------------------------------------------- /capability/web/AceWebErrorReceiveInfoObject.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 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 | #include "AceWebErrorReceiveInfoObject.h" 17 | 18 | std::string AceWebErrorReceiveInfoObject::GetRequestUrl() { 19 | return this->requestUrl_; 20 | } 21 | 22 | std::string AceWebErrorReceiveInfoObject::GetErrorInfo() { 23 | return this->errorInfo_; 24 | } 25 | 26 | long AceWebErrorReceiveInfoObject::GetErrorCode() { 27 | return this->errorCode_; 28 | } 29 | -------------------------------------------------------------------------------- /capability/web/AceWebErrorReceiveInfoObject.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 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 AceWebErrorReceiveInfoObject_hpp 17 | #define AceWebErrorReceiveInfoObject_hpp 18 | #include 19 | #include 20 | 21 | class AceWebErrorReceiveInfoObject { 22 | public: 23 | AceWebErrorReceiveInfoObject(const std::string& url,const std::string& info, long code): 24 | requestUrl_(url), errorInfo_(info), errorCode_(code) {} 25 | std::string GetRequestUrl(); 26 | std::string GetErrorInfo(); 27 | long GetErrorCode(); 28 | private: 29 | std::string requestUrl_; 30 | std::string errorInfo_ ; 31 | long errorCode_ = 0; 32 | }; 33 | 34 | #endif /* AceWebErrorReceiveInfoObject_hpp */ 35 | -------------------------------------------------------------------------------- /capability/web/AceWebPatternBridge.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 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 | #include 17 | #include 18 | #include "core/components/web/web_event.h" 19 | 20 | void AceWebObject(const std::string& id, const std::string& event,void* object); 21 | bool AceWebObjectWithBoolReturn(const std::string& id, const std::string& event, void* object); 22 | bool AceWebObjectWithResponseReturn(const std::string& id, const std::string& event, void* object); 23 | void AceWebObjectWithUnResponseReturn(const std::string& id); 24 | const OHOS::Ace::RefPtr& AceWebObjectGetResponse(); 25 | 26 | -------------------------------------------------------------------------------- /capability/web/AceWebResourcePlugin.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 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 | #import 17 | 18 | #import "AceResourcePlugin.h" 19 | #import 20 | #import "AceWeb.h" 21 | NS_ASSUME_NONNULL_BEGIN 22 | 23 | @interface AceWebResourcePlugin : AceResourcePlugin 24 | + (AceWebResourcePlugin *)createRegister:(UIViewController *)target abilityInstanceId:(int32_t)abilityInstanceId; 25 | 26 | - (id)getObject:(NSString *)incId; 27 | + (NSDictionary*) getObjectMap; 28 | - (int64_t)create:(NSDictionary *)param; 29 | - (BOOL)release:(NSString *)incId; 30 | - (void)releaseObject; 31 | @end 32 | 33 | NS_ASSUME_NONNULL_END 34 | -------------------------------------------------------------------------------- /capability/web/WebMessageChannel.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2022 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 | #import 16 | #import 17 | 18 | NS_ASSUME_NONNULL_BEGIN 19 | 20 | @interface WebMessageChannel : NSObject 21 | 22 | - (instancetype)init:(NSArray*)portsName webView:(WKWebView*)webView; 23 | - (void)initJsPortInstance; 24 | - (void)postMessage:(NSString*)name portName:(NSString*)portName uri:(NSString*)uri; 25 | - (void)postMessageEvent:(NSString*)message; 26 | - (void)postMessageEventExt:(id)message; 27 | - (void)closePort; 28 | @end 29 | 30 | NS_ASSUME_NONNULL_END 31 | -------------------------------------------------------------------------------- /entrance/AcePlatformPlugin.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023-2025 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 | #ifndef FOUNDATION_ACE_ADAPTER_IOS_ENTRANCE_ACE_PLATFORM_PLUGIN_H 16 | #define FOUNDATION_ACE_ADAPTER_IOS_ENTRANCE_ACE_PLATFORM_PLUGIN_H 17 | 18 | #import 19 | #import "adapter/ios/entrance/resource/AceResourceRegisterOC.h" 20 | #import "PlatformViewFactory.h" 21 | 22 | NS_ASSUME_NONNULL_BEGIN 23 | 24 | @interface AcePlatformPlugin : NSObject 25 | 26 | - (instancetype)initPlatformPlugin:(id)target 27 | instanceId:(int32_t)instanceId moduleName:(NSString *_Nonnull)moduleName; 28 | - (void)notifyLifecycleChanged:(BOOL)isBackground; 29 | - (void)platformRelease; 30 | - (void)registerPlatformViewFactory:(NSObject *)platformViewFactory; 31 | - (void)notifyOrientationDidChange; 32 | @end 33 | 34 | NS_ASSUME_NONNULL_END 35 | 36 | #endif // FOUNDATION_ACE_ADAPTER_IOS_ENTRANCE_ACE_PLATFORM_PLUGIN_H -------------------------------------------------------------------------------- /entrance/AceSurfaceHolder.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 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 FOUNDATION_ACE_ADAPTER_IOS_ENTRANCE_ACESURFACEHOLDER_H 17 | #define FOUNDATION_ACE_ADAPTER_IOS_ENTRANCE_ACESURFACEHOLDER_H 18 | 19 | #import 20 | 21 | NS_ASSUME_NONNULL_BEGIN 22 | 23 | @interface AceSurfaceHolder : NSObject 24 | + (CALayer *)getLayerWithId:(long)layerId inceId:(long)inceId; 25 | + (void)addLayer:(CALayer *)layer withId:(long)layerId inceId:(long)inceId; 26 | + (void)removeLayerWithId:(long)layerId inceId:(long)inceId; 27 | @end 28 | 29 | NS_ASSUME_NONNULL_END 30 | 31 | #endif // FOUNDATION_ACE_ADAPTER_IOS_ENTRANCE_ACESURFACEHOLDER_H 32 | -------------------------------------------------------------------------------- /entrance/AceTextureHolder.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 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 FOUNDATION_ADAPTER_CAPABILITY_VIDEO_ACETEXTUREHOLDER_H 17 | #define FOUNDATION_ADAPTER_CAPABILITY_VIDEO_ACETEXTUREHOLDER_H 18 | 19 | #import 20 | NS_ASSUME_NONNULL_BEGIN 21 | 22 | @interface AceTextureHolder : NSObject 23 | + (id)getTextureWithId:(long)textureId inceId:(long)inceId; 24 | + (void)addTexture:(id)texture withId:(long)textureId inceId:(long)inceId; 25 | + (void)removeTextureWithId:(long)textureId inceId:(long)inceId; 26 | @end 27 | 28 | NS_ASSUME_NONNULL_END 29 | 30 | #endif // FOUNDATION_ADAPTER_CAPABILITY_VIDEO_ACETEXTUREHOLDER_H -------------------------------------------------------------------------------- /entrance/DownloadManager.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 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 FOUNDATION_ACE_ADAPTER_IOS_ENTRANCE_DOWNLOADMANAGER_H 17 | #define FOUNDATION_ACE_ADAPTER_IOS_ENTRANCE_DOWNLOADMANAGER_H 18 | 19 | #import 20 | 21 | NS_ASSUME_NONNULL_BEGIN 22 | 23 | @interface DownloadManager : NSObject 24 | 25 | + (DownloadManager *)sharedManage; 26 | 27 | - (NSData *)download:(NSString*)urlStr; 28 | 29 | @end 30 | 31 | NS_ASSUME_NONNULL_END 32 | 33 | #endif // FOUNDATION_ACE_ADAPTER_IOS_ENTRANCE_DOWNLOADMANAGER_H -------------------------------------------------------------------------------- /entrance/UINavigationController+StatusBar.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 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 FOUNDATION_ACE_ADAPTER_IOS_ENTRANCE_UI_NAVIGATION_CONTROLLER_STATUSBAR_H 17 | #define FOUNDATION_ACE_ADAPTER_IOS_ENTRANCE_UI_NAVIGATION_CONTROLLER_STATUSBAR_H 18 | 19 | #include 20 | 21 | NS_ASSUME_NONNULL_BEGIN 22 | 23 | @interface UINavigationController (StatusBar) 24 | 25 | @end 26 | 27 | NS_ASSUME_NONNULL_END 28 | #endif // FOUNDATION_ACE_ADAPTER_IOS_ENTRANCE_UI_NAVIGATION_CONTROLLER_STATUSBAR_H 29 | -------------------------------------------------------------------------------- /entrance/UINavigationController+StatusBar.mm: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 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 | #include "UINavigationController+StatusBar.h" 17 | 18 | @implementation UINavigationController (StatusBar) 19 | 20 | - (BOOL)prefersStatusBarHidden { 21 | return self.visibleViewController.prefersStatusBarHidden; 22 | } 23 | 24 | - (UIInterfaceOrientationMask)supportedInterfaceOrientations { 25 | return UIInterfaceOrientationMaskAll; 26 | } 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /entrance/WantParams.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2025 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 FOUNDATION_ACE_ADAPTER_IOS_STAGE_ABILITY_WANTPARAMS_H 17 | #define FOUNDATION_ACE_ADAPTER_IOS_STAGE_ABILITY_WANTPARAMS_H 18 | 19 | #import 20 | 21 | @interface WantParams : NSObject 22 | 23 | @property (nonatomic, strong) NSMutableArray *arrWantParams; 24 | @property (nonatomic, strong) NSMutableDictionary* dicWantParams; 25 | 26 | -(void)addValue:(NSString *)key value:(id)value; 27 | -(NSString *)toWantParamsString; 28 | - (id)getValue:(NSString*)key; 29 | 30 | @end 31 | 32 | #endif //FOUNDATION_ACE_ADAPTER_IOS_STAGE_ABILITY_WANTPARAMS_H 33 | -------------------------------------------------------------------------------- /entrance/accessibility/AccessibilityNodeInfo.mm: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2025 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 | #import "AccessibilityNodeInfo.h" 17 | 18 | @implementation AccessibilityNodeInfo 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /entrance/accessibility/BUILD.gn: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2025 Huawei Device Co., Ltd. 2 | # Licensed under the Apache License, Version 2.0 (the "License"); 3 | # you may not use this file except in compliance with the License. 4 | # You may obtain a copy of the License at 5 | # 6 | # http://www.apache.org/licenses/LICENSE-2.0 7 | # 8 | # Unless required by applicable law or agreed to in writing, software 9 | # distributed under the License is distributed on an "AS IS" BASIS, 10 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | # See the License for the specific language governing permissions and 12 | # limitations under the License. 13 | 14 | import("//build/ohos.gni") 15 | import("//foundation/arkui/ace_engine/ace_config.gni") 16 | 17 | ohos_source_set("accessibility") { 18 | cflags_objc = [ 19 | "-fobjc-arc", 20 | "-fobjc-weak", 21 | ] 22 | 23 | cflags_objcc = cflags_objc 24 | cflags_cc = [ "-fvisibility=hidden" ] 25 | 26 | include_dirs = [ 27 | "$ace_root/frameworks", 28 | "$ace_root", 29 | ] 30 | 31 | sources = [ 32 | "AccessibilityElement.mm", 33 | "AccessibilityNodeInfo.mm", 34 | "AccessibilityWindowView.mm", 35 | "AceAccessibilityBridge.mm", 36 | ] 37 | 38 | deps = [ "//foundation/graphic/graphic_2d/rosen/modules/render_service_client:librender_service_client_static" ] 39 | 40 | defines = [ 41 | "BUILD_FOR_ARKUI", 42 | "CROSS_PLATFORM", 43 | ] 44 | 45 | configs = [ 46 | "$ace_root:ace_config", 47 | "//foundation/appframework/ability/ability_runtime/cross_platform/interfaces/kits/native/ability:abilitykit_native_config", 48 | "//foundation/appframework/ability/ability_runtime/cross_platform/interfaces/kits/native/appkit:appkit_native_config", 49 | ] 50 | } 51 | -------------------------------------------------------------------------------- /entrance/ace_bridge.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2022 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 | int64_t CallOC_CreateResource(void *obj, const std::string& resourceType, const std::string& param); 17 | bool CallOC_OnMethodCall(void *obj, const std::string& method, const std::string& param, std::string& result); 18 | bool CallOC_ReleaseResource(void *obj, const std::string& resourceHash); -------------------------------------------------------------------------------- /entrance/ace_download_bridge.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 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 FOUNDATION_ACE_ADAPTER_IOS_ENTRANCE_ACE_DOWNLOAD_BRIDGE_H 17 | #define FOUNDATION_ACE_ADAPTER_IOS_ENTRANCE_ACE_DOWNLOAD_BRIDGE_H 18 | 19 | #include 20 | #include 21 | 22 | namespace OHOS::Ace::Platform { 23 | class AceDownloadBridge { 24 | public: 25 | AceDownloadBridge() = delete; 26 | ~AceDownloadBridge() = delete; 27 | 28 | static bool download(const std::string& url, std::vector& dataOut); 29 | }; 30 | } // namespace OHOS::Ace::Platform 31 | #endif // FOUNDATION_ACE_ADAPTER_IOS_ACE_DOWNLOAD_BRIDGE_H -------------------------------------------------------------------------------- /entrance/ace_download_bridge.mm: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 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 | #include "adapter/ios/entrance/ace_download_bridge.h" 17 | 18 | #include 19 | #include 20 | #include 21 | 22 | #import 23 | #import "DownloadManager.h" 24 | 25 | namespace OHOS::Ace::Platform { 26 | bool AceDownloadBridge::download(const std::string& url, std::vector& dataOut) 27 | { 28 | NSString *urlstr = [NSString stringWithCString:url.c_str() encoding:NSUTF8StringEncoding]; 29 | NSData *data = [[DownloadManager sharedManager] download:urlstr]; 30 | if (![data isKindOfClass:[NSData class]]) { 31 | NSLog(@"DownloadManager data class error"); 32 | return false; 33 | } 34 | if (!data || data.length == 0) { 35 | NSLog(@"DownloadManager no data"); 36 | return false; 37 | } 38 | int32_t size = (int32_t)data.length; 39 | const uint8_t *newData = (const uint8_t*)data.bytes; 40 | std::copy(newData, newData+size, std::back_inserter(dataOut)); 41 | return true; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /entrance/ace_pointer_data.cc: -------------------------------------------------------------------------------- 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 | #include "ace_pointer_data.h" 17 | 18 | namespace OHOS::Ace::Platform { 19 | 20 | static constexpr int ACE_POINTER_DATA_FIELD_COUNT = 17; 21 | 22 | static_assert(sizeof(AcePointerData) == sizeof(int64_t) * ACE_POINTER_DATA_FIELD_COUNT, 23 | "AcePointerData has the wrong size"); 24 | 25 | void AcePointerData::Clear() { 26 | memset(this, 0, sizeof(AcePointerData)); 27 | } 28 | } // namespace OHOS::Ace::Platform -------------------------------------------------------------------------------- /entrance/ace_pointer_data_packet.cc: -------------------------------------------------------------------------------- 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 | #include "ace_pointer_data_packet.h" 17 | #include 18 | 19 | namespace OHOS::Ace::Platform { 20 | 21 | AcePointerDataPacket::AcePointerDataPacket(size_t count) 22 | : data_(count * sizeof(AcePointerData)) {} 23 | 24 | AcePointerDataPacket::AcePointerDataPacket(uint8_t* data, size_t bytes) 25 | : data_(data, data + bytes) {} 26 | 27 | AcePointerDataPacket::~AcePointerDataPacket() = default; 28 | 29 | void AcePointerDataPacket::SetPointerData(size_t i, const AcePointerData& data) 30 | { 31 | memcpy(&data_[i * sizeof(AcePointerData)], &data, sizeof(AcePointerData)); 32 | } 33 | 34 | } -------------------------------------------------------------------------------- /entrance/ace_pointer_data_packet.h: -------------------------------------------------------------------------------- 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 FOUNDATION_ADAPTER_IOS_ENTRANCE_ACE_POINTER_DATA_PACKET_H 17 | #define FOUNDATION_ADAPTER_IOS_ENTRANCE_ACE_POINTER_DATA_PACKET_H 18 | 19 | #include 20 | #include 21 | #include "ace_pointer_data.h" 22 | namespace OHOS::Ace::Platform { 23 | 24 | class AcePointerDataPacket { 25 | public: 26 | explicit AcePointerDataPacket(size_t count); 27 | AcePointerDataPacket(uint8_t* data, size_t bytes); 28 | ~AcePointerDataPacket(); 29 | AcePointerDataPacket(const AcePointerDataPacket&) = delete; 30 | AcePointerDataPacket& operator=(const AcePointerDataPacket&) = delete; 31 | 32 | void SetPointerData(size_t i, const AcePointerData& data); 33 | const std::vector& data() const { return data_; } 34 | 35 | private: 36 | std::vector data_; 37 | }; 38 | }// namespace OHOS::Ace::Platform 39 | #endif // FOUNDATION_ADAPTER_IOS_ENTRANCE_ACE_POINTER_DATA_PACKET_H -------------------------------------------------------------------------------- /entrance/ace_resource_register.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2022 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 FOUNDATION_ACE_ADAPTER_IOS_ENTRANCE_ACE_RESOURCE_REGISTER_H 17 | #define FOUNDATION_ACE_ADAPTER_IOS_ENTRANCE_ACE_RESOURCE_REGISTER_H 18 | 19 | #include 20 | #include 21 | 22 | #include "core/common/platform_res_register.h" 23 | 24 | namespace OHOS::Ace::Platform { 25 | 26 | class AceResourceRegister final : public PlatformResRegister { 27 | public: 28 | AceResourceRegister(void*); 29 | ~AceResourceRegister(); 30 | int64_t CreateResource(const std::string& resourceType, const std::string& param) override; 31 | bool ReleaseResource(const std::string& resourceHash) override; 32 | bool OnMethodCall(const std::string& method, const std::string& param, std::string& result) override; 33 | 34 | private: 35 | void* client_; 36 | }; 37 | 38 | } // namespace OHOS::Ace::Platform 39 | 40 | #endif // FOUNDATION_ACE_ADAPTER_IOS_ENTRANCE_ACE_RESOURCE_REGISTER_H 41 | -------------------------------------------------------------------------------- /entrance/ace_translate_manager.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2025 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 | #include "core/common/ace_translate_manager.h" 16 | 17 | #include 18 | 19 | #include "base/utils/macros.h" 20 | 21 | namespace OHOS::Ace { 22 | void UiTranslateManagerImpl::AddPixelMap(int32_t nodeId, RefPtr pixelMap) {} 23 | void UiTranslateManagerImpl::GetAllPixelMap(RefPtr pageNode) {} 24 | void UiTranslateManagerImpl::FindTopNavDestination(RefPtr currentNode, RefPtr& result) {} 25 | } // namespace OHOS::Ace 26 | -------------------------------------------------------------------------------- /entrance/capability_registry.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2022 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 FOUNDATION_ACE_ACE_ENGINE_ADAPTER_IOS_ENTRANCE_CAPABILITY_REGISTRY_H 17 | #define FOUNDATION_ACE_ACE_ENGINE_ADAPTER_IOS_ENTRANCE_CAPABILITY_REGISTRY_H 18 | 19 | #include 20 | 21 | #include "base/log/log.h" 22 | 23 | namespace OHOS::Ace::Platform { 24 | 25 | class CapabilityRegistry { 26 | public: 27 | CapabilityRegistry() = delete; 28 | ~CapabilityRegistry() = delete; 29 | 30 | static void Register(); 31 | }; 32 | 33 | } // namespace OHOS::Ace::Platform 34 | 35 | #endif // FOUNDATION_ACE_ACE_ENGINE_ADAPTER_IOS_ENTRANCE_CAPABILITY_REGISTRY_H 36 | -------------------------------------------------------------------------------- /entrance/foldable_window_ios.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 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 | #include "base/window/foldable_window.h" 17 | namespace OHOS::Ace { 18 | RefPtr FoldableWindow::CreateFoldableWindow(int32_t instanceId) 19 | { 20 | return nullptr; 21 | } 22 | } // namespace OHOS::Ace -------------------------------------------------------------------------------- /entrance/html/html_to_span.cpp: -------------------------------------------------------------------------------- 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 | 17 | #include "core/components_ng/pattern/text/span/mutable_span_string.h" 18 | #include "core/text/html_utils.h" 19 | 20 | namespace OHOS::Ace { 21 | 22 | // Currently not completed 23 | RefPtr HtmlUtils::FromHtml(const std::string& str) 24 | { 25 | return nullptr; 26 | } 27 | 28 | } // namespace OHOS::Ace 29 | -------------------------------------------------------------------------------- /entrance/html/span_to_html.cpp: -------------------------------------------------------------------------------- 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 | #include "core/components_ng/pattern/text/span/span_string.h" 17 | #include "core/text/html_utils.h" 18 | 19 | namespace OHOS::Ace { 20 | 21 | // Currently not completed 22 | std::string HtmlUtils::ToHtml(const SpanString* str) 23 | { 24 | return ""; 25 | } 26 | 27 | } // namespace OHOS::Ace 28 | -------------------------------------------------------------------------------- /entrance/logIntercept/BUILD.gn: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2024 Huawei Device Co., Ltd. 2 | # Licensed under the Apache License, Version 2.0 (the "License"); 3 | # you may not use this file except in compliance with the License. 4 | # You may obtain a copy of the License at 5 | # 6 | # http://www.apache.org/licenses/LICENSE-2.0 7 | # 8 | # Unless required by applicable law or agreed to in writing, software 9 | # distributed under the License is distributed on an "AS IS" BASIS, 10 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | # See the License for the specific language governing permissions and 12 | # limitations under the License. 13 | 14 | import("//build/ohos.gni") 15 | import("//foundation/arkui/ace_engine/ace_config.gni") 16 | 17 | ohos_source_set("logIntercept") { 18 | cflags_objc = [ 19 | "-fvisibility=default", 20 | "-fobjc-arc", 21 | "-fobjc-weak", 22 | "-Wno-nullability-completeness", 23 | "-O0", 24 | ] 25 | 26 | configs = [ "$ace_root/interfaces/inner_api/ace_kit:ace_kit_config" ] 27 | 28 | deps = [ "//foundation/appframework/resource_management/interfaces/native/resource:rawfile" ] 29 | 30 | cflags_objcc = cflags_objc 31 | 32 | sources = [ 33 | "LogInterfaceBridge.mm", 34 | "Logger.mm", 35 | ] 36 | } 37 | -------------------------------------------------------------------------------- /entrance/logIntercept/LogInterfaceBridge.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2024-2025 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 FOUNDATION_ACE_ADAPTER_IOS_ENTRANCE_LOGINTERCEPT_BRIDGE_H 17 | #define FOUNDATION_ACE_ADAPTER_IOS_ENTRANCE_LOGINTERCEPT_BRIDGE_H 18 | 19 | #include 20 | #include 21 | 22 | #include "base/log/log_wrapper.h" 23 | 24 | void SetLevel(int level); 25 | 26 | bool HasDelegateMethod(); 27 | 28 | void PassLogMessageOC(const std::string& domain, const int& level, const std::string& logInfo); 29 | 30 | OHOS::Ace::LogLevel GetCurrentLogLevel(); 31 | #endif // FOUNDATION_ACE_ADAPTER_IOS_ENTRANCE_LOGINTERCEPT_BRIDGE_H -------------------------------------------------------------------------------- /entrance/logIntercept/LogInterfaceBridge.mm: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2024-2025 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 | #import "LogInterfaceBridge.h" 17 | 18 | #import 19 | #include 20 | #include 21 | 22 | #import "Logger.h" 23 | 24 | namespace { 25 | OHOS::Ace::LogLevel g_currentLogLevel = OHOS::Ace::LogLevel::ERROR; 26 | } 27 | 28 | void SetLevel(int level) 29 | { 30 | OHOS::Ace::LogWrapper::SetLogLevel(static_cast(level)); 31 | g_currentLogLevel = static_cast(level); 32 | } 33 | 34 | bool HasDelegateMethod() 35 | { 36 | return [[Logger sharedInstance] isOsDelegateLog]; 37 | } 38 | 39 | void PassLogMessageOC(const std::string& domain, const int& level, const std::string& logInfo) 40 | { 41 | NSString* strLogInfo = [NSString stringWithUTF8String:logInfo.c_str()]; 42 | NSString* strDomain = [NSString stringWithUTF8String:domain.c_str()]; 43 | [[Logger sharedInstance] PassLogMessage:strDomain level:level info:strLogInfo]; 44 | } 45 | 46 | OHOS::Ace::LogLevel GetCurrentLogLevel() 47 | { 48 | return g_currentLogLevel; 49 | } -------------------------------------------------------------------------------- /entrance/logIntercept/Logger.h: -------------------------------------------------------------------------------- 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 FOUNDATION_ACE_ADAPTER_IOS_ENTRANCE_LOGINTERCEPT_LOGGER_H 17 | #define FOUNDATION_ACE_ADAPTER_IOS_ENTRANCE_LOGINTERCEPT_LOGGER_H 18 | 19 | #import 20 | 21 | #import "ILogger.h" 22 | 23 | NS_ASSUME_NONNULL_BEGIN 24 | 25 | @interface Logger : NSObject 26 | 27 | @property(nonatomic, weak) id delegate; 28 | 29 | + (instancetype)sharedInstance; 30 | 31 | - (void)NativeSetLogger:(id)log; 32 | 33 | - (void)NativeSetLogLevel:(int)logLevel; 34 | 35 | - (void)PassLogMessage:(NSString*)strDomain level:(int)Level info:(NSString*)strInfo; 36 | 37 | - (BOOL)isOsDelegateLog; 38 | 39 | @end 40 | 41 | NS_ASSUME_NONNULL_END 42 | #endif // FOUNDATION_ACE_ADAPTER_IOS_ENTRANCE_LOGINTERCEPT_LOGGER_H 43 | -------------------------------------------------------------------------------- /entrance/picker/picker_haptic_factory.cpp: -------------------------------------------------------------------------------- 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 | #include "adapter/ohos/entrance/picker/picker_haptic_factory.h" 17 | #include "adapter/ohos/entrance/picker/picker_haptic_interface.h" 18 | 19 | 20 | namespace OHOS::Ace::NG { 21 | std::shared_ptr PickerAudioHapticFactory::GetInstance( 22 | const std::string& uri, const std::string& effectId) 23 | { 24 | return nullptr; 25 | } 26 | } // namespace OHOS::Ace::NG 27 | -------------------------------------------------------------------------------- /entrance/plugin_lifecycle/BUILD.gn: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2023 Huawei Device Co., Ltd. 2 | # Licensed under the Apache License, Version 2.0 (the "License"); 3 | # you may not use this file except in compliance with the License. 4 | # You may obtain a copy of the License at 5 | # 6 | # http://www.apache.org/licenses/LICENSE-2.0 7 | # 8 | # Unless required by applicable law or agreed to in writing, software 9 | # distributed under the License is distributed on an "AS IS" BASIS, 10 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | # See the License for the specific language governing permissions and 12 | # limitations under the License. 13 | 14 | import("//build/ohos.gni") 15 | import("//foundation/arkui/ace_engine/ace_config.gni") 16 | 17 | ohos_source_set("plugin_lifecycle") { 18 | cflags_objc = [ 19 | "-fobjc-arc", 20 | "-fobjc-weak", 21 | ] 22 | 23 | cflags_objcc = cflags_objc 24 | 25 | include_dirs = [ 26 | "//foundation/arkui/ace_engine/adapter/ios/capability/bridge", 27 | "//foundation/arkui/ace_engine/adapter/ios/stage/ability", 28 | ] 29 | 30 | sources = [ 31 | "ArkUIXPluginRegistry.mm", 32 | "PluginContext.mm", 33 | ] 34 | } 35 | -------------------------------------------------------------------------------- /entrance/plugin_lifecycle/IArkUIXPlugin.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2023 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 FOUNDATION_ACE_ADAPTER_IOS_ENTRANCE_PLUGINLIFECYCLE_IARKUIXPLUGIN_H 17 | #define FOUNDATION_ACE_ADAPTER_IOS_ENTRANCE_PLUGINLIFECYCLE_IARKUIXPLUGIN_H 18 | 19 | #import "PluginContext.h" 20 | 21 | /** 22 | * ArkUI-X plugin. 23 | * 24 | * Interface to be implemented by all ArkUI-X plugins. 25 | * 26 | * @since 11 27 | */ 28 | @protocol IArkUIXPlugin 29 | @required 30 | 31 | /** 32 | * ArkUI-X plugin registry callback, called at registry. 33 | * 34 | * @param pluginContext provides the resources that the plugin might need. 35 | * @since 11 36 | */ 37 | - (void)onRegistry:(PluginContext *)pluginContext; 38 | 39 | /** 40 | * ArkUI-X plugin unregistry callback, called at unregistry. 41 | * 42 | * @param pluginContext provides the resources that the plugin might need. 43 | * @since 11 44 | */ 45 | - (void)onUnRegistry:(PluginContext *)pluginContext; 46 | 47 | @end 48 | 49 | #endif // FOUNDATION_ACE_ADAPTER_IOS_ENTRANCE_PLUGINLIFECYCLE_IARKUIXPLUGIN_H -------------------------------------------------------------------------------- /entrance/resource/AceResourceRegisterDelegate.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2022 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 | #import 17 | #import "IAceOnCallResourceMethod.h" 18 | 19 | #ifndef AceResourceRegisterDelegate_h 20 | #define AceResourceRegisterDelegate_h 21 | 22 | @protocol AceResourceRegisterDelegate 23 | 24 | - (id)getObject:(NSString *)resourceType incId:(int64_t)incId; 25 | 26 | // register sync method 27 | - (void)registerSyncCallMethod:(NSString *)methodId 28 | callMethod:(IAceOnCallSyncResourceMethod)callMethod; 29 | 30 | // unregister sync method 31 | - (void)unregisterSyncCallMethod:(NSString *)methodId; 32 | 33 | @end 34 | 35 | #endif /* AceResourceRegisterDelegate_h */ 36 | -------------------------------------------------------------------------------- /entrance/resource/BUILD.gn: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022 Huawei Device Co., Ltd. 2 | # Licensed under the Apache License, Version 2.0 (the "License"); 3 | # you may not use this file except in compliance with the License. 4 | # You may obtain a copy of the License at 5 | # 6 | # http://www.apache.org/licenses/LICENSE-2.0 7 | # 8 | # Unless required by applicable law or agreed to in writing, software 9 | # distributed under the License is distributed on an "AS IS" BASIS, 10 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | # See the License for the specific language governing permissions and 12 | # limitations under the License. 13 | 14 | import("//build/ohos.gni") 15 | import("//foundation/arkui/ace_engine/ace_config.gni") 16 | 17 | ohos_source_set("resource") { 18 | cflags_objc = [ 19 | "-fobjc-arc", 20 | "-fobjc-weak", 21 | ] 22 | 23 | cflags_objcc = cflags_objc 24 | 25 | include_dirs = [ 26 | "//third_party/", 27 | "//third_party/flutter", 28 | "//third_party/flutter/engine", 29 | "//third_party/flutter/skia", 30 | "//third_party/flutter/engine/flutter/shell/platform/darwin/common/framework/Headers", 31 | "//third_party/flutter/engine/flutter/shell/platform/darwin/ios/framework/Headers", 32 | "//third_party/flutter/engine/flutter/shell/common", 33 | "$ace_root/frameworks", 34 | "$ace_root", 35 | ] 36 | 37 | sources = [ 38 | "AceResourcePlugin.m", 39 | "AceResourceRegisterOC.mm", 40 | ] 41 | 42 | frameworks = [ 43 | "AVFoundation.framework", 44 | "UIKit.framework", 45 | "WebKit.framework", 46 | ] 47 | } 48 | -------------------------------------------------------------------------------- /entrance/resource/IAceOnCallResourceMethod.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2022 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 IAceOnCallResourceMethod_h 17 | #define IAceOnCallResourceMethod_h 18 | 19 | typedef NSString* (^IAceOnCallSyncResourceMethod)(NSDictionary * param); 20 | 21 | #endif /* IAceOnCallResourceMethod_h */ 22 | -------------------------------------------------------------------------------- /entrance/resource/IAceOnResourceEvent.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2022 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 IAceOnResourceEvent_h 17 | #define IAceOnResourceEvent_h 18 | 19 | typedef void (^IAceOnResourceEvent)(NSString* eventId, NSString* param); 20 | 21 | #endif /* IAceOnResourceEvent_h */ 22 | -------------------------------------------------------------------------------- /entrance/touch_event.cpp: -------------------------------------------------------------------------------- 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 | #include "core/event/touch_event.h" 16 | 17 | namespace OHOS::Ace::Platform { 18 | Offset GetTouchEventOriginOffset(const TouchEvent& event) 19 | { 20 | return event.GetOffset(); 21 | } 22 | 23 | TimeStamp GetTouchEventOriginTimeStamp(const TouchEvent& event) 24 | { 25 | return event.time; 26 | } 27 | 28 | void UpdatePressedKeyCodes(std::vector& pressedKeyCodes) {} 29 | } // namespace OHOS::Ace 30 | -------------------------------------------------------------------------------- /entrance/touch_event_convertor.cpp: -------------------------------------------------------------------------------- 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 | #include "frameworks/core/interfaces/native/node/touch_event_convertor.h" 17 | 18 | namespace OHOS::Ace::NG { 19 | TouchEvent ConvertToTouchEvent(const std::shared_ptr& srcPointerEvent) 20 | { 21 | return {}; 22 | } 23 | 24 | void ConvertToMouseEvent(MouseEvent& mouseEvent, const std::shared_ptr& srcPointerEvent) {} 25 | 26 | void ConvertToAxisEvent(AxisEvent& event, const std::shared_ptr& srcPointerEvent) {} 27 | 28 | void SetClonedPointerEvent(const MMI::PointerEvent* pointerEvent, ArkUITouchEvent* arkUITouchEventCloned) {} 29 | 30 | void SetPostPointerEvent(const MMI::PointerEvent* pointerEvent, TouchEvent& touchEvent) {} 31 | } -------------------------------------------------------------------------------- /entrance/ui_session/ui_session_manager_ios.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021-2022 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 | #include "ui_session_manager_ios.h" 17 | namespace OHOS::Ace { 18 | std::mutex UiSessionManager::mutex_; 19 | std::shared_mutex UiSessionManager::reportObjectMutex_; 20 | UiSessionManager* UiSessionManager::GetInstance() 21 | { 22 | static UiSessionManagerAndroid instance; 23 | return &instance; 24 | } 25 | 26 | } // namespace OHOS::Ace 27 | -------------------------------------------------------------------------------- /entrance/ui_session/ui_session_manager_ios.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021-2022 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 | #ifndef FOUNDATION_ACE_ADAPTER_OHOS_ENTRANCE_UI_SESSION_MANAGER_IOS_H 16 | #define FOUNDATION_ACE_ADAPTER_OHOS_ENTRANCE_UI_SESSION_MANAGER_IOS_H 17 | 18 | #include "interfaces/inner_api/ui_session/ui_session_manager.h" 19 | 20 | #include "base/memory/ace_type.h" 21 | 22 | namespace OHOS::Ace { 23 | class UiSessionManagerAndroid : public UiSessionManager {}; 24 | 25 | } // namespace OHOS::Ace 26 | 27 | #endif // FOUNDATION_ACE_ADAPTER_OHOS_ENTRANCE_UI_SESSION_MANAGER_IOS_H 28 | -------------------------------------------------------------------------------- /entrance/utils.cpp: -------------------------------------------------------------------------------- 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 | #include "adapter/ios/entrance/utils.h" 17 | 18 | #include 19 | #include 20 | #include 21 | #include 22 | 23 | #include "foundation/appframework/window_manager/interfaces/innerkits/wm/wm_common.h" 24 | 25 | namespace OHOS::Ace { 26 | 27 | NG::SafeAreaInsets ConvertAvoidArea(const OHOS::Rosen::AvoidArea& avoidArea) 28 | { 29 | return NG::SafeAreaInsets({ avoidArea.leftRect_.posX_, avoidArea.leftRect_.posX_ + avoidArea.leftRect_.width_ }, 30 | { avoidArea.topRect_.posY_, avoidArea.topRect_.posY_ + avoidArea.topRect_.height_ }, 31 | { avoidArea.rightRect_.posX_, avoidArea.rightRect_.posX_ + avoidArea.rightRect_.width_ }, 32 | { avoidArea.bottomRect_.posY_, avoidArea.bottomRect_.posY_ + avoidArea.bottomRect_.height_ }); 33 | } 34 | } // namespace OHOS::Ace -------------------------------------------------------------------------------- /entrance/utils.h: -------------------------------------------------------------------------------- 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 FOUNDATION_ACE_ACE_ENGINE_ADAPTER_OHOS_ENTRANCE_UTILS_H 17 | #define FOUNDATION_ACE_ACE_ENGINE_ADAPTER_OHOS_ENTRANCE_UTILS_H 18 | 19 | #include 20 | 21 | #include "base/log/log.h" 22 | #include "base/geometry/rect.h" 23 | #include "core/components_ng/property/safe_area_insets.h" 24 | 25 | namespace OHOS::Rosen { 26 | class AvoidArea; 27 | } 28 | namespace OHOS::Ace { 29 | NG::SafeAreaInsets ConvertAvoidArea(const OHOS::Rosen::AvoidArea& avoidArea); 30 | } // namespace OHOS::Ace 31 | 32 | #endif // FOUNDATION_ACE_ACE_ENGINE_ADAPTER_OHOS_ENTRANCE_UTILS_H -------------------------------------------------------------------------------- /entrance/vibrator/vibrator_utils.cpp: -------------------------------------------------------------------------------- 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 | #include "core/common/vibrator/vibrator_utils.h" 17 | 18 | namespace OHOS::Ace::NG { 19 | void VibratorUtils::StartVibraFeedback() 20 | { 21 | } 22 | 23 | void VibratorUtils::StartVibraFeedback(const std::string& vibratorType) 24 | { 25 | } 26 | 27 | void VibratorUtils::StartViratorDirectly(const std::string& vibratorType) 28 | { 29 | } 30 | } // namespace OHOS::Ace::NG 31 | -------------------------------------------------------------------------------- /entrance/xcollie/xcollieInterface_impl.cpp: -------------------------------------------------------------------------------- 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 | #include "xcollieInterface_impl.h" 17 | 18 | namespace OHOS::Ace { 19 | XcollieInterface& XcollieInterface::GetInstance() 20 | { 21 | static XcollieInterfaceImpl instance; 22 | return instance; 23 | } 24 | } //namespace OHOS::Ace 25 | -------------------------------------------------------------------------------- /entrance/xcollie/xcollieInterface_impl.h: -------------------------------------------------------------------------------- 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 FOUNDATION_ACE_ACE_ENGINE_ADAPTER_OHOS_CAPABILITY_XCOLLIEINTERFACE_IMPL_H 17 | #define FOUNDATION_ACE_ACE_ENGINE_ADAPTER_OHOS_CAPABILITY_XCOLLIEINTERFACE_IMPL_H 18 | 19 | #include "base/memory/ace_type.h" 20 | #include "base/utils/utils.h" 21 | #include "core/common/xcollie/xcollieInterface.h" 22 | 23 | namespace OHOS::Ace { 24 | class XcollieInterfaceImpl : public XcollieInterface { 25 | DECLARE_ACE_TYPE(XcollieInterfaceImpl, XcollieInterface); 26 | public: 27 | }; 28 | } // namespace OHOS::Ace 29 | #endif // FOUNDATION_ACE_ACE_ENGINE_ADAPTER_OHOS_CAPABILITY_XCOLLIEINTERFACE_IMPL_H 30 | -------------------------------------------------------------------------------- /osal/ace_engine_ext.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2022 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 | #include "core/common/ace_engine_ext.h" 17 | 18 | namespace OHOS::Ace { 19 | void CallDragExtFunc() {} 20 | } // namespace OHOS::Ace -------------------------------------------------------------------------------- /osal/ace_forward_compatibility.cpp: -------------------------------------------------------------------------------- 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 | #include "ace_forward_compatibility.h" 17 | 18 | namespace OHOS { 19 | namespace Ace { 20 | 21 | bool AceForwardCompatibility::IsUseNG() 22 | { 23 | return true; 24 | } 25 | 26 | } // namespace Ace 27 | } // namespace OHOS 28 | -------------------------------------------------------------------------------- /osal/advance/ai_write_adapter.cpp: -------------------------------------------------------------------------------- 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 | #include "core/common/ai/ai_write_adapter.h" 17 | 18 | namespace OHOS::Ace { 19 | bool AIWriteAdapter::IsSentenceBoundary(const char16_t value) { return false; } 20 | uint32_t AIWriteAdapter::GetSelectLengthOnlyText(const std::u16string& content) { return 0; } 21 | void AIWriteAdapter::CloseModalUIExtension() {} 22 | void AIWriteAdapter::ShowModalUIExtension(const AIWriteInfo& info, 23 | std::function&)> resultCallback) {} 24 | std::vector GetBufferParam(const std::string& key, const AAFwk::WantParams& wantParams) { return {}; } 25 | bool AIWriteAdapter::GetBoolParam(const std::string& key, const AAFwk::WantParams& wantParams) { return false; } 26 | } // namespace OHOS::Ace -------------------------------------------------------------------------------- /osal/advance/image_analyzer_adapter_impl.cpp: -------------------------------------------------------------------------------- 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 | #include "core/common/ai/image_analyzer_adapter_impl.h" 17 | 18 | namespace OHOS::Ace { 19 | void ImageAnalyzerAdapterImpl::SetImageAnalyzerConfig(void* config, bool isOptions) {}; 20 | 21 | void* ImageAnalyzerAdapterImpl::GetImageAnalyzerConfig() 22 | { 23 | return nullptr; 24 | } 25 | 26 | void* ImageAnalyzerAdapterImpl::ConvertPixmapNapi(const RefPtr& pixelMap) 27 | { 28 | return nullptr; 29 | } 30 | 31 | ImageAnalyzerAdapter* CreateImageAnalyzerAdapter() 32 | { 33 | return nullptr; 34 | } 35 | 36 | } // namespace OHOS::Ace -------------------------------------------------------------------------------- /osal/advance/image_analyzer_mgr.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 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 | #define NAPI_VERSION 8 17 | 18 | #include "core/common/ai/image_analyzer_mgr.h" 19 | #include "core/common/ai/image_analyzer_default.h" 20 | 21 | namespace OHOS::Ace { 22 | 23 | ImageAnalyzerMgr& ImageAnalyzerMgr::GetInstance() 24 | { 25 | static ImageAnalyzerMgr instance; 26 | return instance; 27 | } 28 | 29 | ImageAnalyzerMgr::ImageAnalyzerMgr() 30 | { 31 | } 32 | 33 | bool ImageAnalyzerMgr::IsImageAnalyzerSupported() 34 | { 35 | return false; 36 | } 37 | 38 | void ImageAnalyzerMgr::BuildNodeFunc( 39 | void* pixelMap, void* config, ImageAnalyzerInnerConfig* uiConfig, void** overlayData) 40 | { 41 | } 42 | 43 | void ImageAnalyzerMgr::UpdateImage( 44 | void** overlayData, void* pixelMap, void* config, ImageAnalyzerInnerConfig* uiConfig) 45 | { 46 | } 47 | 48 | void ImageAnalyzerMgr::UpdateConfig(void** overlayData, void* config) 49 | { 50 | } 51 | 52 | void ImageAnalyzerMgr::UpdateInnerConfig(void** overlayData, ImageAnalyzerInnerConfig* config) 53 | { 54 | } 55 | 56 | void ImageAnalyzerMgr::Release(void** overlayData) 57 | { 58 | } 59 | } -------------------------------------------------------------------------------- /osal/advance/text_share_adapter.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2025 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 | #include "core/common/share/text_share_adapter.h" 17 | 18 | namespace OHOS::Ace { 19 | 20 | void TextShareAdapter::StartTextShareTask( 21 | const int32_t containerId, const NG::RectF& contentRect, const std::string& shareText) {} 22 | 23 | uint64_t TextShareAdapter::GetMaxTextShareLength() 24 | { 25 | return 0; 26 | } 27 | 28 | } // namespace OHOS::Ace -------------------------------------------------------------------------------- /osal/advance/text_translation_adapter.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2025 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 | #include "core/common/ai/text_translation_adapter.h" 17 | 18 | namespace OHOS::Ace { 19 | 20 | void TextTranslationAdapter::StartAITextTranslationTask(const std::string& translateText, const std::string& rectStr) {} 21 | 22 | } // namespace OHOS::Ace 23 | -------------------------------------------------------------------------------- /osal/app_bar_helper_impl.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 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 | #include "core/common/app_bar_helper.h" 17 | 18 | #include "core/components_ng/pattern/ui_extension/ui_extension_model_ng.h" 19 | 20 | namespace OHOS::Ace { 21 | 22 | std::string AppBarHelper::QueryAppGalleryBundleName() 23 | { 24 | return ""; 25 | } 26 | 27 | } // namespace OHOS::Ace -------------------------------------------------------------------------------- /osal/display_info_utils.cpp: -------------------------------------------------------------------------------- 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 | #include "core/common/display_info_utils.h" 17 | 18 | #include "core/common/display_info.h" 19 | 20 | namespace OHOS::Ace { 21 | RefPtr DisplayInfoUtils::GetDisplayInfo(int32_t displayId) 22 | { 23 | return AceType::MakeRefPtr(); 24 | } 25 | 26 | void DisplayInfoUtils::InitIsFoldable() {} 27 | 28 | bool DisplayInfoUtils::GetIsFoldable() 29 | { 30 | hasInitIsFoldable_ = true; 31 | return false; 32 | } 33 | 34 | FoldStatus DisplayInfoUtils::GetCurrentFoldStatus() 35 | { 36 | return FoldStatus::UNKNOWN; 37 | } 38 | 39 | std::vector DisplayInfoUtils::GetCurrentFoldCreaseRegion() 40 | { 41 | hasInitFoldCreaseRegion_ = true; 42 | return {}; 43 | } 44 | } // namespace OHOS::Ace::DisplayInfoUtils 45 | -------------------------------------------------------------------------------- /osal/display_manager_ios.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2025 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 | #include "display_manager_ios.h" 17 | 18 | namespace OHOS::Ace { 19 | 20 | DisplayManager& DisplayManager::GetInstance() 21 | { 22 | static DisplayManagerIos instance; 23 | return instance; 24 | } 25 | 26 | bool DisplayManagerIos::ConvertScreenIdToRsScreenId(uint64_t screenId, uint64_t& rsScreenId) 27 | { 28 | rsScreenId = screenId; 29 | return true; 30 | } 31 | 32 | } // namespace OHOS::Ace 33 | -------------------------------------------------------------------------------- /osal/display_manager_ios.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2025 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 FOUNDATION_ACE_ADAPTER_IOS_OSAL_DISPLAY_MANAGER_IOS_H 17 | #define FOUNDATION_ACE_ADAPTER_IOS_OSAL_DISPLAY_MANAGER_IOS_H 18 | 19 | #include "base/display_manager/display_manager.h" 20 | 21 | namespace OHOS::Ace { 22 | 23 | class DisplayManagerIos : public DisplayManager { 24 | DECLARE_ACE_TYPE(DisplayManagerIos, DisplayManager); 25 | 26 | public: 27 | bool ConvertScreenIdToRsScreenId(uint64_t screenId, uint64_t& rsScreenId) override; 28 | }; 29 | 30 | } // namespace OHOS::Ace 31 | 32 | #endif // FOUNDATION_ACE_ADAPTER_IOS_OSAL_DISPLAY_MANAGER_IOS_H 33 | -------------------------------------------------------------------------------- /osal/drag_window.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2022 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 | #include "base/window/drag_window.h" 17 | 18 | namespace OHOS::Ace { 19 | 20 | RefPtr DragWindow::CreateDragWindow(const std::string& windowName, int32_t x, int32_t y, uint32_t width, uint32_t height) 21 | { 22 | return nullptr; 23 | } 24 | 25 | RefPtr DragWindow::CreateDragWindow(const DragWindowParams& params) 26 | { 27 | return nullptr; 28 | } 29 | 30 | RefPtr DragWindow::CreateTextDragWindow( 31 | const std::string& windowName, int32_t x, int32_t y, uint32_t width, uint32_t height) 32 | { 33 | return nullptr; 34 | } 35 | 36 | void DragWindow::MoveTo(int32_t x, int32_t y) const {} 37 | 38 | void DragWindow::Destroy() const {} 39 | 40 | void DragWindow::DrawPixelMap(const RefPtr& pixelmap) {} 41 | 42 | } // namespace OHOS::Ace -------------------------------------------------------------------------------- /osal/drawable_descriptor_ios.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2025 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 | #include "adapter/ios/osal/drawable_descriptor_ios.h" 17 | 18 | namespace OHOS::Ace { 19 | RefPtr DrawableDescriptor::CreateDrawable(void* sptrAddr) 20 | { 21 | return nullptr; 22 | } 23 | 24 | int32_t DrawableDescriptorIos::GetDrawableSrcType() 25 | { 26 | return -1; 27 | } 28 | 29 | void DrawableDescriptorIos::RegisterRedrawCallback(RedrawCallback&& callback) {} 30 | 31 | void DrawableDescriptorIos::Draw(RSCanvas& canvas, const NG::ImagePaintConfig& config) {} 32 | } // namespace OHOS::Ace 33 | -------------------------------------------------------------------------------- /osal/drawable_descriptor_ios.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2025 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 FOUNDATION_ACE_ADAPTER_IOS_OSAL_DRAWABLE_DESCRIPTOR_IOS_H 17 | #define FOUNDATION_ACE_ADAPTER_IOS_OSAL_DRAWABLE_DESCRIPTOR_IOS_H 18 | 19 | #include 20 | 21 | #include "base/image/drawable_descriptor.h" 22 | 23 | namespace OHOS::Ace { 24 | 25 | class DrawableDescriptorIos : public DrawableDescriptor { 26 | DECLARE_ACE_TYPE(DrawableDescriptorIos, DrawableDescriptor); 27 | 28 | public: 29 | DrawableDescriptorIos() = default; 30 | ~DrawableDescriptorIos() = default; 31 | 32 | void RegisterRedrawCallback(RedrawCallback&& callback) override; 33 | 34 | void Draw(RSCanvas& canvas, const NG::ImagePaintConfig& config) override; 35 | 36 | int32_t GetDrawableSrcType() override; 37 | }; 38 | 39 | } // namespace OHOS::Ace 40 | 41 | #endif // FOUNDATION_ACE_ADAPTER_IOS_OSAL_DRAWABLE_DESCRIPTOR_IOS_H 42 | -------------------------------------------------------------------------------- /osal/drawing_color_filter_ios.cpp: -------------------------------------------------------------------------------- 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 | #include "drawing_color_filter_ios.h" 17 | 18 | namespace OHOS::Ace { 19 | RefPtr DrawingColorFilter::CreateDrawingColorFilter(void* sptrAddr) 20 | { 21 | return nullptr; 22 | } 23 | 24 | RefPtr DrawingColorFilter::CreateDrawingColorFilter(const std::vector& matrix) 25 | { 26 | return nullptr; 27 | } 28 | 29 | RefPtr DrawingColorFilter::CreateDrawingColorFilterFromNative(void* sptrAddr) 30 | { 31 | return nullptr; 32 | } 33 | 34 | void* DrawingColorFilterIos::GetDrawingColorFilterSptrAddr() 35 | { 36 | return nullptr; 37 | } 38 | } // namespace OHOS::Ace 39 | -------------------------------------------------------------------------------- /osal/drawing_color_filter_ios.h: -------------------------------------------------------------------------------- 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 FOUNDATION_ACE_ADAPTER_OHOS_OSAL_DRAWING_COLOR_FILTER_IOS_H 17 | #define FOUNDATION_ACE_ADAPTER_OHOS_OSAL_DRAWING_COLOR_FILTER_IOS_H 18 | 19 | #include "base/image/drawing_color_filter.h" 20 | 21 | namespace OHOS::Ace { 22 | class DrawingColorFilterIos : public DrawingColorFilter { 23 | public: 24 | explicit DrawingColorFilterIos(std::shared_ptr colorFilter) 25 | : colorFilter_(std::move(colorFilter)) {} 26 | ~DrawingColorFilterIos() override = default; 27 | void* GetDrawingColorFilterSptrAddr() override; 28 | 29 | private: 30 | std::shared_ptr colorFilter_; 31 | }; 32 | 33 | } // namespace OHOS::Ace 34 | 35 | #endif // FOUNDATION_ACE_ADAPTER_OHOS_OSAL_DRAWING_COLOR_FILTER_IOS_H -------------------------------------------------------------------------------- /osal/drawing_lattice_ios.cpp: -------------------------------------------------------------------------------- 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 | #include "drawing_lattice_ios.h" 17 | 18 | namespace OHOS::Ace { 19 | RefPtr DrawingLattice::CreateDrawingLattice(void* sptrAddr) 20 | { 21 | return nullptr; 22 | } 23 | } // namespace OHOS::Ace 24 | -------------------------------------------------------------------------------- /osal/drawing_lattice_ios.h: -------------------------------------------------------------------------------- 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 FOUNDATION_ACE_ADAPTER_IOS_OSAL_DRAWING_LATTICE_IOS_H 17 | #define FOUNDATION_ACE_ADAPTER_IOS_OSAL_DRAWING_LATTICE_IOS_H 18 | 19 | #include "draw/core_canvas.h" 20 | 21 | #include "base/image/drawing_lattice.h" 22 | 23 | namespace OHOS::Ace { 24 | class DrawingLatticePreview : public DrawingLattice { 25 | public: 26 | explicit DrawingLatticePreview(std::shared_ptr lattice) 27 | : lattice_(std::move(lattice)) {} 28 | ~DrawingLatticePreview() override = default; 29 | void* GetDrawingLatticeSptrAddr() override; 30 | 31 | private: 32 | std::shared_ptr lattice_; 33 | }; 34 | 35 | } // namespace OHOS::Ace 36 | 37 | #endif // FOUNDATION_ACE_ADAPTER_IOS_OSAL_DRAWING_LATTICE_IOS_H 38 | -------------------------------------------------------------------------------- /osal/exception_handler.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2022 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 | #include "base/log/exception_handler.h" 17 | 18 | namespace OHOS::Ace { 19 | void ExceptionHandler::HandleJsException( 20 | const std::string& exceptionMsg, const JsErrorObject& errorInfo, bool isStageModel) 21 | {} 22 | } // namespace OHOS::Ace -------------------------------------------------------------------------------- /osal/fetch_manager.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2022 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 | #include "adapter/preview/osal/fetch_manager.h" 17 | 18 | #include 19 | #include 20 | 21 | #include "adapter/ios/osal/http_constant.h" 22 | #include "base/log/log.h" 23 | #include "base/utils/singleton.h" 24 | 25 | namespace OHOS::Ace { 26 | namespace { 27 | 28 | class FetchManagerImpl final : public FetchManager, public Singleton { 29 | DECLARE_SINGLETON(FetchManagerImpl); 30 | ACE_DISALLOW_MOVE(FetchManagerImpl); 31 | 32 | public: 33 | bool Fetch(const RequestData requestData, const int32_t callbackId, ResponseData& responseData) override 34 | { 35 | return true; 36 | } 37 | 38 | private: 39 | std::mutex mutex_; 40 | bool initialized_ = false; 41 | }; 42 | 43 | FetchManagerImpl::FetchManagerImpl() = default; 44 | 45 | FetchManagerImpl::~FetchManagerImpl() {} 46 | 47 | } // namespace 48 | 49 | FetchManager& FetchManager::GetInstance() 50 | { 51 | return Singleton::GetInstance(); 52 | } 53 | 54 | } // namespace OHOS::Ace 55 | -------------------------------------------------------------------------------- /osal/fetch_manager.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2022 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 FOUNDATION_ACE_ADAPTER_IOS_OSAL_FETCH_MANAGER_H 17 | #define FOUNDATION_ACE_ADAPTER_IOS_OSAL_FETCH_MANAGER_H 18 | 19 | #include 20 | #include 21 | 22 | #include "adapter/preview/osal/request_data.h" 23 | #include "adapter/preview/osal/response_data.h" 24 | 25 | namespace OHOS::Ace { 26 | 27 | class FetchManager { 28 | public: 29 | static FetchManager& GetInstance(); 30 | 31 | virtual ~FetchManager() = default; 32 | virtual bool Fetch(const RequestData requestData, const int32_t callbackId, ResponseData& responseData) = 0; 33 | }; 34 | 35 | } // namespace OHOS::Ace 36 | 37 | #endif // #ifndef FOUNDATION_ACE_ADAPTER_IOS_OSAL_FETCH_MANAGER_H 38 | -------------------------------------------------------------------------------- /osal/file_uri_helper_ios.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 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 | #include "base/image/file_uri_helper.h" 17 | 18 | namespace OHOS::Ace { 19 | std::string FileUriHelper::GetRealPath(std::string fileUriStr) 20 | { 21 | const std::string fileHead = "file://"; 22 | size_t pos = fileUriStr.find(fileHead); 23 | if (pos != std::string::npos) { 24 | return fileUriStr.substr(pos + fileHead.length()); 25 | } 26 | return {}; 27 | } 28 | } // namespace OHOS::Ace 29 | -------------------------------------------------------------------------------- /osal/frame_trace_adapter_impl.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2022 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 | #include "base/thread/frame_trace_adapter.h" 17 | 18 | namespace OHOS::Ace { 19 | FrameTraceAdapter* FrameTraceAdapter::GetInstance() 20 | { 21 | return nullptr; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /osal/frame_trace_adapter_impl.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2022 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 FOUNDATION_ACE_ADAPTER_IOS_OSAL_FRAME_TRACE_ADAPTER_IMPL_H 17 | #define FOUNDATION_ACE_ADAPTER_IOS_OSAL_FRAME_TRACE_ADAPTER_IMPL_H 18 | 19 | #include 20 | 21 | #include "base/thread/frame_trace_adapter.h" 22 | 23 | namespace OHOS::Ace { 24 | class FrameTraceAdapterImpl : public FrameTraceAdapter { 25 | public: 26 | FrameTraceAadpterImpl() = default; 27 | ~FrameTraceAdapterImpl() override = default; 28 | }; 29 | } // namespace OHOS::Ace 30 | #endif 31 | -------------------------------------------------------------------------------- /osal/image_packer_ios.cpp: -------------------------------------------------------------------------------- 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 | #include "image_packer_ios.h" 17 | 18 | namespace OHOS::Ace { 19 | RefPtr ImagePacker::Create() 20 | { 21 | return nullptr; 22 | } 23 | 24 | uint32_t ImagePackerIos::AddImage(PixelMap& pixelMap) 25 | { 26 | return 0; 27 | } 28 | 29 | uint32_t ImagePackerIos::StartPacking(uint8_t* data, uint32_t maxSize, const PackOption& option) 30 | { 31 | return 0; 32 | } 33 | 34 | uint32_t ImagePackerIos::FinalizePacking(int64_t& packedSize) 35 | { 36 | return 0; 37 | } 38 | } // namespace OHOS::Ace -------------------------------------------------------------------------------- /osal/image_packer_ios.h: -------------------------------------------------------------------------------- 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 FOUNDATION_ACE_ADAPTER_OHOS_OSAL_IMAGE_PACKER_IOS_H 17 | #define FOUNDATION_ACE_ADAPTER_OHOS_OSAL_IMAGE_PACKER_IOS_H 18 | 19 | #include "base/image/image_packer.h" 20 | 21 | namespace OHOS::Ace { 22 | class ImagePackerIos : public ImagePacker { 23 | DECLARE_ACE_TYPE(ImagePackerIos, ImagePacker) 24 | public: 25 | uint32_t StartPacking(uint8_t* data, uint32_t maxSize, const PackOption& option) override; 26 | uint32_t AddImage(PixelMap& pixelMap) override; 27 | uint32_t FinalizePacking(int64_t& packedSize) override; 28 | }; 29 | } // namespace OHOS::Ace 30 | 31 | #endif // FOUNDATION_ACE_ADAPTER_OHOS_OSAL_IMAGE_PACKER_IOS_H -------------------------------------------------------------------------------- /osal/input_manager.cpp: -------------------------------------------------------------------------------- 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 | #include "base/input_manager/input_manager.h" 17 | 18 | namespace OHOS::Ace { 19 | 20 | bool InputManager::GetSystemHotkeys(std::vector& hotkeys) 21 | { 22 | return true; 23 | } 24 | 25 | std::shared_ptr InputManager::CreatePointerEvent( 26 | const std::shared_ptr& pointerEvent) 27 | { 28 | return nullptr; 29 | } 30 | 31 | } // namespace OHOS::Ace 32 | -------------------------------------------------------------------------------- /osal/layout_inspector.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2022 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 | #include "core/common/layout_inspector.h" 17 | 18 | namespace OHOS::Ace { 19 | void LayoutInspector::SupportInspector() {} 20 | } // namespace OHOS::Ace 21 | -------------------------------------------------------------------------------- /osal/mock/accessibility_constants.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2025 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 | #include "accessibility_constants.h" 17 | 18 | namespace OHOS { 19 | namespace Accessibility { 20 | 21 | const std::string ACTION_ARGU_INVALID = "invalid"; 22 | const std::string ACTION_ARGU_SELECT_TEXT_START = "selectTextBegin"; 23 | const std::string ACTION_ARGU_SELECT_TEXT_END = "selectTextEnd"; 24 | const std::string ACTION_ARGU_SELECT_TEXT_INFORWARD = "selectTextInForWard"; 25 | const std::string ACTION_ARGU_SET_OFFSET = "offset"; 26 | const std::string ACTION_ARGU_HTML_ELEMENT = "htmlItem"; 27 | const std::string ACTION_ARGU_SET_TEXT = "setText"; 28 | const std::string ACTION_ARGU_MOVE_UNIT = "textMoveUnit"; 29 | 30 | } // namespace Accessibility 31 | } // namespace OHOS 32 | -------------------------------------------------------------------------------- /osal/mock/accessibility_constants.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2025 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 ACCESSIBILITY_CONSTANTS_H 17 | #define ACCESSIBILITY_CONSTANTS_H 18 | 19 | #include 20 | #include 21 | 22 | namespace OHOS { 23 | namespace Accessibility { 24 | 25 | extern const std::string ACTION_ARGU_INVALID; 26 | extern const std::string ACTION_ARGU_SELECT_TEXT_START; 27 | extern const std::string ACTION_ARGU_SELECT_TEXT_END; 28 | extern const std::string ACTION_ARGU_SELECT_TEXT_INFORWARD; 29 | extern const std::string ACTION_ARGU_SET_OFFSET; 30 | extern const std::string ACTION_ARGU_HTML_ELEMENT; 31 | extern const std::string ACTION_ARGU_SET_TEXT; 32 | extern const std::string ACTION_ARGU_MOVE_UNIT; 33 | 34 | } // namespace Accessibility 35 | } // namespace OHOS 36 | #endif // ACCESSIBILITY_CONSTANTS_H 37 | -------------------------------------------------------------------------------- /osal/modal_ui_extension_impl.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 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 | #include "core/common/modal_ui_extension.h" 17 | 18 | namespace OHOS::Ace { 19 | 20 | RefPtr ModalUIExtension::Create(const AAFwk::Want& want, const ModalUIExtensionCallbacks& callbacks, 21 | const NG::InnerModalUIExtensionConfig& config) 22 | { 23 | return nullptr; 24 | } 25 | 26 | int32_t ModalUIExtension::GetSessionId(const RefPtr& uiExtNode) 27 | { 28 | return 0; 29 | } 30 | 31 | void ModalUIExtension::SetBindModalCallback(const RefPtr& uiExtNode, 32 | std::function&& bindModalCallback) 33 | { 34 | } 35 | 36 | bool ModalUIExtension::SendOverlayMaskInfoToUEA(const RefPtr& uiExtNode, const UECHostMaskInfo& info, 37 | NG::UIContentBusinessCode code, NG::BusinessDataSendType type) 38 | { 39 | return false; 40 | } 41 | } // namespace OHOS::Ace 42 | -------------------------------------------------------------------------------- /osal/mouse_style_ios.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2022 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 | #include "adapter/ios/osal/mouse_style_ios.h" 17 | 18 | namespace OHOS::Ace { 19 | 20 | RefPtr MouseStyle::CreateMouseStyle() 21 | { 22 | return AceType::MakeRefPtr(); 23 | } 24 | 25 | bool MouseStyleIOS::SetPointerStyle(int32_t windowId, MouseFormat pointerStyle) const 26 | { 27 | return false; 28 | } 29 | 30 | int32_t MouseStyleIOS::GetPointerStyle(int32_t windowId, int32_t& pointerStyle) const 31 | { 32 | return -1; 33 | } 34 | 35 | } // namespace OHOS::Ace -------------------------------------------------------------------------------- /osal/mouse_style_ios.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2022 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 FOUNDATION_ACE_ADAPTER_OHOS_OSAL_MOUSE_STYLE_IOS_H 17 | #define FOUNDATION_ACE_ADAPTER_OHOS_OSAL_MOUSE_STYLE_IOS_H 18 | 19 | #include "base/mousestyle/mouse_style.h" 20 | 21 | namespace OHOS::Ace { 22 | 23 | class MouseStyleIOS : public MouseStyle { 24 | DECLARE_ACE_TYPE(MouseStyleIOS, MouseStyle) 25 | 26 | public: 27 | MouseStyleIOS() = default; 28 | ~MouseStyleIOS() = default; 29 | bool SetPointerStyle(int32_t windowId, MouseFormat pointerStyle) const override; 30 | int32_t GetPointerStyle(int32_t windowId, int32_t& pointerStyle) const override; 31 | }; 32 | 33 | } // namespace OHOS::Ace 34 | 35 | #endif // FOUNDATION_ACE_ADAPTER_OHOS_OSAL_MOUSE_STYLE_IOS_H -------------------------------------------------------------------------------- /osal/package_event_proxy_ios.cpp: -------------------------------------------------------------------------------- 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 | #include "core/event/package/package_event_proxy.h" 16 | 17 | namespace OHOS::Ace { 18 | std::unique_ptr PackageEventProxy::instance_; 19 | std::mutex PackageEventProxy::mutex_; 20 | 21 | PackageEventProxy* PackageEventProxy::GetInstance() 22 | { 23 | return nullptr; 24 | } 25 | } // namespace OHOS::Ace 26 | -------------------------------------------------------------------------------- /osal/page_url_checker_ios.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 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 | #include "page_url_checker_ios.h" 17 | 18 | #include 19 | 20 | namespace OHOS::Ace { 21 | const char BUNDLE_TAG[] = "@bundle:"; 22 | 23 | void PageUrlCheckerIos::LoadPageUrl(const std::string& url, const std::function& callback, 24 | const std::function& silentInstallErrorCallBack) 25 | { 26 | if (url.substr(0, strlen(BUNDLE_TAG)) != BUNDLE_TAG) { 27 | return; 28 | } 29 | callback(); 30 | } 31 | } // namespace OHOS::Ace -------------------------------------------------------------------------------- /osal/page_url_checker_ios.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 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 FOUNDATION_ACE_ADAPTER_IOS_STAGE_PAGE_URL_CHECKER_IOS_H 17 | #define FOUNDATION_ACE_ADAPTER_IOS_STAGE_PAGE_URL_CHECKER_IOS_H 18 | 19 | #include "interfaces/inner_api/ace/ui_content.h" 20 | 21 | #include "frameworks/core/common/page_url_checker.h" 22 | 23 | namespace OHOS::Ace { 24 | class PageUrlCheckerIos : public PageUrlChecker { 25 | DECLARE_ACE_TYPE(PageUrlCheckerIos, PageUrlChecker) 26 | 27 | public: 28 | explicit PageUrlCheckerIos() = default; 29 | ~PageUrlCheckerIos() = default; 30 | void LoadPageUrl(const std::string& url, const std::function& callback, 31 | const std::function& silentInstallErrorCallBack) override; 32 | }; 33 | } // namespace OHOS::Ace 34 | 35 | #endif // FOUNDATION_ACE_ADAPTER_IOS_STAGE_PAGE_URL_CHECKER_IOS_H -------------------------------------------------------------------------------- /osal/perf_interfaces.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2025 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 | #include "base/perfmonitor/perf_interfaces.h" 17 | 18 | namespace OHOS::Ace { 19 | 20 | void PerfInterfaces::SetScrollState(bool state) 21 | { 22 | } 23 | 24 | } // namespace OHOS::Ace 25 | -------------------------------------------------------------------------------- /osal/resource_convertor.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021-2022 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 FOUNDATION_ACE_ADAPTER_IOS_OSAL_RESOURCE_CONVERTOR_H 17 | #define FOUNDATION_ACE_ADAPTER_IOS_OSAL_RESOURCE_CONVERTOR_H 18 | 19 | #include "resource_manager.h" 20 | #include "base/utils/utils.h" 21 | #include "base/utils/resource_configuration.h" 22 | #include "core/common/ace_application_info.h" 23 | 24 | namespace OHOS::Ace { 25 | Global::Resource::DeviceType ConvertDeviceTypeToGlobal(DeviceType type); 26 | Global::Resource::Direction ConvertDirectionToGlobal(DeviceOrientation orientation); 27 | Global::Resource::ScreenDensity ConvertDensityToGlobal(double density); 28 | std::shared_ptr ConvertConfigToGlobal(const ResourceConfiguration& config); 29 | 30 | DeviceType ConvertDeviceTypeToAce(Global::Resource::DeviceType type); 31 | DeviceOrientation ConvertDirectionToAce(Global::Resource::Direction orientation); 32 | double ConvertDensityToAce(Global::Resource::ScreenDensity density); 33 | } // namespace OHOS::Ace 34 | #endif // FOUNDATION_ACE_ADAPTER_IOS_OSAL_RESOURCE_CONVERTOR_H 35 | -------------------------------------------------------------------------------- /osal/resource_path_util.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 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 FOUNDATION_ACE_ADAPTER_IOS_OSAL_RESOURCE_PATH_UTIL_H 17 | #define FOUNDATION_ACE_ADAPTER_IOS_OSAL_RESOURCE_PATH_UTIL_H 18 | #include 19 | namespace OHOS::Ace { 20 | class ResourcePathUtil { 21 | public: 22 | static std::string GetBundlePath(); 23 | static std::string GetSandboxPath(); 24 | }; 25 | } // namespace OHOS::Ace 26 | #endif // FOUNDATION_ACE_ADAPTER_IOS_OSAL_RESOURCE_PATH_UTIL_H -------------------------------------------------------------------------------- /osal/resource_path_util.mm: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 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 | #import 17 | 18 | #include "resource_path_util.h" 19 | namespace OHOS::Ace { 20 | std::string ResourcePathUtil::GetBundlePath() 21 | { 22 | NSString* bundlePath = [NSString stringWithFormat:@"%@/%@", [NSBundle mainBundle].bundlePath, @"arkui-x"]; 23 | return [bundlePath UTF8String]; 24 | } 25 | 26 | std::string ResourcePathUtil::GetSandboxPath() 27 | { 28 | NSArray* paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); 29 | NSString* documentsDirectory = [paths objectAtIndex:0]; 30 | NSString* bundlePath = [NSString stringWithFormat:@"%@/%@/%@", documentsDirectory, @"files", @"arkui-x"]; 31 | return [bundlePath UTF8String]; 32 | } 33 | } // namespace OHOS::Ace -------------------------------------------------------------------------------- /osal/ressched_report.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2022 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 | #include "base/ressched/ressched_report.h" 17 | 18 | namespace OHOS::Ace { 19 | 20 | ReportDataFunc LoadReportDataFunc() 21 | { 22 | return nullptr; 23 | } 24 | 25 | ReportSyncEventFunc LoadReportSyncEventFunc() 26 | { 27 | return nullptr; 28 | } 29 | 30 | } // namespace OHOS::Ace -------------------------------------------------------------------------------- /osal/socperf_client_impl.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 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 | #include "adapter/preview/osal/socperf_client_impl.h" 17 | 18 | namespace OHOS::Ace { 19 | SocPerfClient& SocPerfClient::GetInstance() 20 | { 21 | static SocPerfClient instace; 22 | return instace; 23 | } 24 | } // namespace OHOS::Ace 25 | -------------------------------------------------------------------------------- /osal/socperf_client_impl.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 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 FOUNDATION_ACE_ADAPTER_PREVIEW_OSAL_SOCPERF_CLIENT_IMPL_H 17 | #define FOUNDATION_ACE_ADAPTER_PREVIEW_OSAL_SOCPERF_CLIENT_IMPL_H 18 | 19 | #include "base/perf/socperf_client.h" 20 | 21 | namespace OHOS::Ace { 22 | class SocPerfClientImpl : public SocPerfClient { 23 | public: 24 | SocPerfClientImpl() = default; 25 | ~SocPerfClientImpl() override = default; 26 | }; 27 | } // namespace OHOS::Ace 28 | 29 | #endif // FOUNDATION_ACE_ADAPTER_PREVIEW_OSAL_SOCPERF_CLIENT_IMPL_H 30 | -------------------------------------------------------------------------------- /osal/statusbar_event_proxy_ios.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2025 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 | #include "core/event/statusbar/statusbar_event_proxy.h" 16 | 17 | namespace OHOS::Ace { 18 | std::unique_ptr StatusBarEventProxy::instance_; 19 | std::mutex StatusBarEventProxy::mutex_; 20 | 21 | StatusBarEventProxy* StatusBarEventProxy::GetInstance() 22 | { 23 | return nullptr; 24 | } 25 | } // namespace OHOS::Ace 26 | -------------------------------------------------------------------------------- /osal/stylus_detector_default.cpp: -------------------------------------------------------------------------------- 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 | #include "core/common/stylus/stylus_detector_default.h" 17 | 18 | #include "frameworks/base/log/log_wrapper.h" 19 | namespace OHOS::Ace { 20 | StylusDetectorDefault* StylusDetectorDefault::GetInstance() 21 | { 22 | static StylusDetectorDefault instance; 23 | return &instance; 24 | } 25 | 26 | bool StylusDetectorDefault::IsEnable() 27 | { 28 | return isEnable_; 29 | } 30 | 31 | bool StylusDetectorDefault::RegisterStylusInteractionListener( 32 | const std::string& bundleName, const std::shared_ptr& callback) 33 | { 34 | return false; 35 | } 36 | 37 | void StylusDetectorDefault::UnRegisterStylusInteractionListener(const std::string& bundleName) {} 38 | 39 | bool StylusDetectorDefault::Notify(const NotifyInfo& notifyInfo) 40 | { 41 | defaultNodeId_ = 0; 42 | return false; 43 | } 44 | 45 | void StylusDetectorDefault::ExecuteCommand(const std::vector& params) {} 46 | } // namespace OHOS::Ace -------------------------------------------------------------------------------- /osal/system_bar_style_ohos.cpp: -------------------------------------------------------------------------------- 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 | #include "adapter/ios/osal/system_bar_style_ohos.h" 17 | #include "base/log/log.h" 18 | 19 | namespace OHOS::Ace { 20 | RefPtr SystemBarStyle::CreateStyleFromJsObj(void* env, void* value) 21 | { 22 | LOGI("Not supported in previewer"); 23 | return nullptr; 24 | } 25 | 26 | RefPtr SystemBarStyle::CreateStyleFromColor(const uint32_t colorValue) 27 | { 28 | LOGI("Not supported in previewer"); 29 | return nullptr; 30 | } 31 | } // namespace OHOS::Ace -------------------------------------------------------------------------------- /osal/system_bar_style_ohos.h: -------------------------------------------------------------------------------- 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 FOUNDATION_ACE_ADAPTER_OHOS_OSAL_SYSTEM_BAR_STYLE_OHOS_H 17 | #define FOUNDATION_ACE_ADAPTER_OHOS_OSAL_SYSTEM_BAR_STYLE_OHOS_H 18 | 19 | #include "base/system_bar/system_bar_style.h" 20 | 21 | namespace OHOS::Ace { 22 | class SystemBarStyleOhos : public SystemBarStyle { 23 | DECLARE_ACE_TYPE(SystemBarStyleOhos, SystemBarStyle) 24 | public: 25 | SystemBarStyleOhos() = default; 26 | ~SystemBarStyleOhos() = default; 27 | }; 28 | } // namespace OHOS::Ace 29 | #endif // FOUNDATION_ACE_ADAPTER_OHOS_OSAL_SYSTEM_BAR_STYLE_OHOS_H 30 | -------------------------------------------------------------------------------- /osal/thread_priority.cpp: -------------------------------------------------------------------------------- 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 | #include 17 | #include 18 | #include 19 | 20 | #include "base/thread/thread_priority.h" 21 | 22 | namespace OHOS::Ace { 23 | namespace { 24 | constexpr int32_t BACKGROUND_THREAD_PRIORITY = 15; 25 | } // namespace 26 | 27 | void ThreadPriority::SetThreadPriority(OHOS::Ace::TaskExecutor::TaskType taskType) 28 | { 29 | if (taskType == OHOS::Ace::TaskExecutor::TaskType::BACKGROUND) { 30 | SetBackGroundThreadPriority(); 31 | } 32 | } 33 | 34 | void ThreadPriority::SetBackGroundThreadPriority() 35 | { 36 | uint64_t tid; 37 | pthread_threadid_np(NULL, &tid); 38 | if (setpriority(PRIO_PROCESS, tid, BACKGROUND_THREAD_PRIORITY) < 0) { 39 | LOGW("Failed to set thread priority using setpriority: %s", strerror(errno)); 40 | } 41 | } 42 | } // namespace OHOS::Ace 43 | -------------------------------------------------------------------------------- /osal/time_event_proxy_ios.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 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 | #include "core/event/time/time_event_proxy.h" 16 | 17 | namespace OHOS::Ace { 18 | std::unique_ptr TimeEventProxy::instance_; 19 | std::mutex TimeEventProxy::mutex_; 20 | 21 | TimeEventProxy* TimeEventProxy::GetInstance() 22 | { 23 | return nullptr; 24 | } 25 | } // namespace OHOS::Ace 26 | -------------------------------------------------------------------------------- /osal/view_data_wrap_impl.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 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 | #include "base/view_data/view_data_wrap.h" 17 | 18 | namespace OHOS::Ace { 19 | RefPtr PageNodeInfoWrap::CreatePageNodeInfoWrap() 20 | { 21 | return nullptr; 22 | } 23 | 24 | RefPtr ViewDataWrap::CreateViewDataWrap() 25 | { 26 | return nullptr; 27 | } 28 | 29 | RefPtr ViewDataWrap::CreateViewDataWrap(const AbilityBase::ViewData& viewData) 30 | { 31 | return nullptr; 32 | } 33 | } // namespace OHOS::Ace 34 | -------------------------------------------------------------------------------- /osal/want_wrap_ios.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2022 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 | #include "base/want/want_wrap.h" 17 | 18 | namespace OHOS::Ace { 19 | RefPtr WantWrap::CreateWantWrap(const std::string& bundleName, const std::string& abilityName) 20 | { 21 | return nullptr; 22 | } 23 | } // namespace OHOS::Ace -------------------------------------------------------------------------------- /stage/ability/InstanceIdGenerator.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 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 FOUNDATION_ACE_ADAPTER_IOS_STAGE_ABILITY_INSTANCE_ID_GENERATOR_H 17 | #define FOUNDATION_ACE_ADAPTER_IOS_STAGE_ABILITY_INSTANCE_ID_GENERATOR_H 18 | 19 | #import 20 | 21 | NS_ASSUME_NONNULL_BEGIN 22 | 23 | @interface InstanceIdGenerator : NSObject 24 | /** 25 | * get and increment id 26 | * @return id 27 | */ 28 | + (NSInteger)getAndIncrement; 29 | 30 | /** 31 | * get id 32 | * @return id 33 | */ 34 | + (NSInteger)get; 35 | @end 36 | 37 | NS_ASSUME_NONNULL_END 38 | 39 | #endif // FOUNDATION_ACE_ADAPTER_IOS_STAGE_ABILITY_INSTANCE_ID_GENERATOR_H 40 | -------------------------------------------------------------------------------- /stage/ability/InstanceIdGenerator.mm: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 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 | #import "InstanceIdGenerator.h" 17 | static NSInteger INSTANCE_ID_GENERATOR = 0; 18 | @implementation InstanceIdGenerator 19 | + (NSInteger)getAndIncrement { 20 | @synchronized(self) { 21 | NSInteger instanceId = INSTANCE_ID_GENERATOR; 22 | INSTANCE_ID_GENERATOR++; 23 | return instanceId; 24 | } 25 | } 26 | 27 | + (NSInteger)get { 28 | @synchronized(self) { 29 | return INSTANCE_ID_GENERATOR; 30 | } 31 | } 32 | @end 33 | -------------------------------------------------------------------------------- /stage/ability/Stage.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 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 | #import "StageViewController.h" 17 | #import "StageApplication.h" 18 | -------------------------------------------------------------------------------- /stage/ability/StageConfigurationManager.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023-2025 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 FOUNDATION_ACE_ADAPTER_IOS_STAGE_ABILITY_CONFIGURATION_MANAGER_H 17 | #define FOUNDATION_ACE_ADAPTER_IOS_STAGE_ABILITY_CONFIGURATION_MANAGER_H 18 | 19 | #import 20 | #import 21 | #import 22 | #import 23 | 24 | NS_ASSUME_NONNULL_BEGIN 25 | 26 | @interface StageConfigurationManager : NSObject 27 | 28 | + (instancetype)configurationManager; 29 | 30 | - (void)setDirection:(UIInterfaceOrientation)direction; 31 | 32 | - (void)directionUpdate:(UIInterfaceOrientation)direction; 33 | 34 | - (void)setColorMode:(UIUserInterfaceStyle)colorMode; 35 | 36 | - (void)colorModeUpdate:(UIUserInterfaceStyle)colorMode; 37 | 38 | - (void)setDeviceType:(UIUserInterfaceIdiom)deviceType; 39 | 40 | - (void)registConfiguration; 41 | @end 42 | 43 | NS_ASSUME_NONNULL_END 44 | #endif // FOUNDATION_ACE_ADAPTER_IOS_STAGE_ABILITY_CONFIGURATION_MANAGER_H -------------------------------------------------------------------------------- /stage/ability/StageSecureContainerView.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2025-2025 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 FOUNDATION_ACE_ADAPTER_IOS_STAGE_ABILITY_STAGE_SECURE_CONTAINER_VIEW_H 17 | #define FOUNDATION_ACE_ADAPTER_IOS_STAGE_ABILITY_STAGE_SECURE_CONTAINER_VIEW_H 18 | 19 | #import 20 | 21 | NS_ASSUME_NONNULL_BEGIN 22 | 23 | @interface StageSecureContainerView : UITextField 24 | // please user this function instead of addSubview 25 | - (void)addView:(UIView *)window; 26 | @end 27 | 28 | NS_ASSUME_NONNULL_END 29 | #endif // FOUNDATION_ACE_ADAPTER_IOS_STAGE_ABILITY_STAGE_SECURE_CONTAINER_VIEW_H 30 | -------------------------------------------------------------------------------- /stage/ability/StageSecureContainerView.mm: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2025 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 | #import "StageSecureContainerView.h" 17 | #import 18 | 19 | @implementation StageSecureContainerView 20 | /* 21 | // Only override drawRect: if you perform custom drawing. 22 | // An empty implementation adversely affects performance during animation. 23 | - (void)drawRect:(CGRect)rect { 24 | // Drawing code 25 | } 26 | */ 27 | - (instancetype)initWithFrame:(CGRect)frame { 28 | if (self = [super initWithFrame: frame]) { 29 | UIView*view = self.subviews[0]; 30 | view.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; 31 | view.frame = self.bounds; 32 | view.backgroundColor = [UIColor clearColor]; 33 | } 34 | return self; 35 | } 36 | 37 | - (BOOL)canBecomeFirstResponder { 38 | return NO; 39 | } 40 | 41 | - (void)addView:(UIView *)window { 42 | UIView*view = self.subviews[0]; 43 | [view addSubview:window]; 44 | } 45 | @end 46 | -------------------------------------------------------------------------------- /stage/ability/application_context_adapter.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 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 FOUNDATION_ACE_ADAPTER_IOS_STAGE_ABILITY_APPLICATION_CONTEXT_ADAPTER_H 17 | #define FOUNDATION_ACE_ADAPTER_IOS_STAGE_ABILITY_APPLICATION_CONTEXT_ADAPTER_H 18 | 19 | #include 20 | #include 21 | 22 | #include "running_process_info.h" 23 | 24 | namespace OHOS { 25 | namespace AbilityRuntime { 26 | namespace Platform { 27 | class ApplicationContextAdapter { 28 | public: 29 | ApplicationContextAdapter() = default; 30 | ~ApplicationContextAdapter() = default; 31 | 32 | static std::shared_ptr GetInstance(); 33 | std::vector GetRunningProcessInformation(); 34 | 35 | private: 36 | static std::shared_ptr instance_; 37 | static std::mutex mutex_; 38 | }; 39 | } // namespace Platform 40 | } // namespace AbilityRuntime 41 | } // namespace OHOS 42 | #endif // FOUNDATION_ACE_ADAPTER_IOS_STAGE_ABILITY_APPLICATION_CONTEXT_ADAPTER_H 43 | -------------------------------------------------------------------------------- /stage/ability/window_view_adapter.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 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 FOUNDATION_ACE_ADAPTER_IOS_STAGE_WINDOW_VIEW_ADAPTER_H 17 | #define FOUNDATION_ACE_ADAPTER_IOS_STAGE_WINDOW_VIEW_ADAPTER_H 18 | 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | 25 | 26 | namespace OHOS { 27 | namespace AbilityRuntime { 28 | namespace Platform { 29 | class WindowViewAdapter { 30 | public: 31 | WindowViewAdapter(); 32 | ~WindowViewAdapter(); 33 | 34 | static std::shared_ptr GetInstance(); 35 | void AddWindowView(const std::string& instanceName, void* windowView); 36 | void* GetWindowView(const std::string& instanceName); 37 | void RemoveWindowView(const std::string& instanceName); 38 | 39 | std::string GetWindowName(void* windowView); 40 | 41 | private: 42 | std::mutex mutex_; 43 | std::unordered_map windowViewObjects_; 44 | }; 45 | } // namespace Platform 46 | } // namespace AbilityRuntime 47 | } // namespace OHOS 48 | #endif // FOUNDATION_ACE_ADAPTER_IOS_STAGE_WINDOW_VIEW_ADAPTER_H 49 | -------------------------------------------------------------------------------- /stage/uicontent/platform_event_callback.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 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 FOUNDATION_ACE_ADAPTER_IOS_STAGE_PLATFORM_EVENT_CALLBACK_H 17 | #define FOUNDATION_ACE_ADAPTER_IOS_STAGE_PLATFORM_EVENT_CALLBACK_H 18 | 19 | #include "base/utils/noncopyable.h" 20 | 21 | namespace OHOS::Ace::Platform { 22 | class PlatformEventCallback { 23 | public: 24 | PlatformEventCallback() = default; 25 | virtual ~PlatformEventCallback() = default; 26 | virtual void OnFinish() const = 0; 27 | virtual void OnStartAbility(const std::string& address) {}; 28 | virtual void OnStatusBarBgColorChanged(uint32_t color) = 0; 29 | 30 | private: 31 | ACE_DISALLOW_COPY_AND_MOVE(PlatformEventCallback); 32 | }; 33 | } // namespace OHOS::Ace::Platform 34 | 35 | #endif // FOUNDATION_ACE_ADAPTER_IOS_STAGE_PLATFORM_EVENT_CALLBACK_H 36 | -------------------------------------------------------------------------------- /stage/uicontent/uicontent.gni: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2023 Huawei Device Co., Ltd. 2 | # Licensed under the Apache License, Version 2.0 (the "License"); 3 | # you may not use this file except in compliance with the License. 4 | # You may obtain a copy of the License at 5 | # 6 | # http://www.apache.org/licenses/LICENSE-2.0 7 | # 8 | # Unless required by applicable law or agreed to in writing, software 9 | # distributed under the License is distributed on an "AS IS" BASIS, 10 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | # See the License for the specific language governing permissions and 12 | # limitations under the License. 13 | 14 | ability_runtime_cross_platform_path = 15 | "//foundation/appframework/ability/ability_runtime/cross_platform" 16 | --------------------------------------------------------------------------------