123b3eb3cSopenharmony_ci/* 223b3eb3cSopenharmony_ci * Copyright (c) 2024 Huawei Device Co., Ltd. 323b3eb3cSopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 423b3eb3cSopenharmony_ci * you may not use this file except in compliance with the License. 523b3eb3cSopenharmony_ci * You may obtain a copy of the License at 623b3eb3cSopenharmony_ci * 723b3eb3cSopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 823b3eb3cSopenharmony_ci * 923b3eb3cSopenharmony_ci * Unless required by applicable law or agreed to in writing, software 1023b3eb3cSopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 1123b3eb3cSopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1223b3eb3cSopenharmony_ci * See the License for the specific language governing permissions and 1323b3eb3cSopenharmony_ci * limitations under the License. 1423b3eb3cSopenharmony_ci */ 1523b3eb3cSopenharmony_ci 1623b3eb3cSopenharmony_ci#include "native_interface_accessibility.h" 1723b3eb3cSopenharmony_ci 1823b3eb3cSopenharmony_ci#include <cmath> 1923b3eb3cSopenharmony_ci#include <map> 2023b3eb3cSopenharmony_ci 2123b3eb3cSopenharmony_ci#include "base/utils/utils.h" 2223b3eb3cSopenharmony_ci#include "frameworks/core/accessibility/native_interface_accessibility_impl.h" 2323b3eb3cSopenharmony_ci#include "frameworks/core/accessibility/native_interface_accessibility_provider.h" 2423b3eb3cSopenharmony_ci#include "native_type.h" 2523b3eb3cSopenharmony_ci 2623b3eb3cSopenharmony_ci#ifdef __cplusplus 2723b3eb3cSopenharmony_ciextern "C" { 2823b3eb3cSopenharmony_ci#endif 2923b3eb3cSopenharmony_ci 3023b3eb3cSopenharmony_ciusing ::ArkUI_AccessibilityElementInfo; 3123b3eb3cSopenharmony_ciusing ::ArkUI_AccessibilityEventInfo; 3223b3eb3cSopenharmony_ciusing ::ArkUI_AccessibilityActionArguments; 3323b3eb3cSopenharmony_ciusing ::ArkUI_AccessibilityElementInfoList; 3423b3eb3cSopenharmony_ci 3523b3eb3cSopenharmony_ciint32_t OH_ArkUI_AccessibilityProviderRegisterCallback( 3623b3eb3cSopenharmony_ci ArkUI_AccessibilityProvider* provider, ArkUI_AccessibilityProviderCallbacks* callbacks) 3723b3eb3cSopenharmony_ci{ 3823b3eb3cSopenharmony_ci if ((provider == nullptr) || (callbacks == nullptr)) { 3923b3eb3cSopenharmony_ci return ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER; 4023b3eb3cSopenharmony_ci } 4123b3eb3cSopenharmony_ci return provider->AccessibilityProviderRegisterCallback(callbacks); 4223b3eb3cSopenharmony_ci} 4323b3eb3cSopenharmony_ci 4423b3eb3cSopenharmony_civoid OH_ArkUI_SendAccessibilityAsyncEvent( 4523b3eb3cSopenharmony_ci ArkUI_AccessibilityProvider* provider, ArkUI_AccessibilityEventInfo* eventInfo, 4623b3eb3cSopenharmony_ci void (*callback)(int32_t errorCode)) 4723b3eb3cSopenharmony_ci{ 4823b3eb3cSopenharmony_ci if ((provider == nullptr) || (callback == nullptr)) { 4923b3eb3cSopenharmony_ci return; 5023b3eb3cSopenharmony_ci } 5123b3eb3cSopenharmony_ci provider->SendAccessibilityAsyncEvent(eventInfo, callback); 5223b3eb3cSopenharmony_ci} 5323b3eb3cSopenharmony_ci 5423b3eb3cSopenharmony_ciArkUI_AccessibilityElementInfo* OH_ArkUI_AddAndGetAccessibilityElementInfo( 5523b3eb3cSopenharmony_ci ArkUI_AccessibilityElementInfoList* list) 5623b3eb3cSopenharmony_ci{ 5723b3eb3cSopenharmony_ci auto elementInfo = list->AddAndGetElementInfo(); 5823b3eb3cSopenharmony_ci return elementInfo; 5923b3eb3cSopenharmony_ci} 6023b3eb3cSopenharmony_ci 6123b3eb3cSopenharmony_ciArkUI_AccessibilityElementInfo* OH_ArkUI_CreateAccessibilityElementInfo(void) 6223b3eb3cSopenharmony_ci{ 6323b3eb3cSopenharmony_ci auto elementInfo = new (std::nothrow) ArkUI_AccessibilityElementInfo(); 6423b3eb3cSopenharmony_ci if (elementInfo == nullptr) { 6523b3eb3cSopenharmony_ci return nullptr; 6623b3eb3cSopenharmony_ci } 6723b3eb3cSopenharmony_ci return elementInfo; 6823b3eb3cSopenharmony_ci} 6923b3eb3cSopenharmony_ci 7023b3eb3cSopenharmony_civoid OH_ArkUI_DestoryAccessibilityElementInfo( 7123b3eb3cSopenharmony_ci ArkUI_AccessibilityElementInfo* elementInfo) 7223b3eb3cSopenharmony_ci{ 7323b3eb3cSopenharmony_ci if (elementInfo == nullptr) { 7423b3eb3cSopenharmony_ci return; 7523b3eb3cSopenharmony_ci } 7623b3eb3cSopenharmony_ci delete elementInfo; 7723b3eb3cSopenharmony_ci} 7823b3eb3cSopenharmony_ci 7923b3eb3cSopenharmony_ciArkUI_AccessibilityEventInfo* OH_ArkUI_CreateAccessibilityEventInfo(void) 8023b3eb3cSopenharmony_ci{ 8123b3eb3cSopenharmony_ci auto eventInfo = new (std::nothrow) ArkUI_AccessibilityEventInfo(); 8223b3eb3cSopenharmony_ci if (eventInfo == nullptr) { 8323b3eb3cSopenharmony_ci return nullptr; 8423b3eb3cSopenharmony_ci } 8523b3eb3cSopenharmony_ci return eventInfo; 8623b3eb3cSopenharmony_ci} 8723b3eb3cSopenharmony_ci 8823b3eb3cSopenharmony_civoid OH_ArkUI_DestoryAccessibilityEventInfo(ArkUI_AccessibilityEventInfo* eventInfo) 8923b3eb3cSopenharmony_ci{ 9023b3eb3cSopenharmony_ci if (eventInfo == nullptr) { 9123b3eb3cSopenharmony_ci return; 9223b3eb3cSopenharmony_ci } 9323b3eb3cSopenharmony_ci delete eventInfo; 9423b3eb3cSopenharmony_ci} 9523b3eb3cSopenharmony_ci 9623b3eb3cSopenharmony_ciint32_t OH_ArkUI_AccessibilityElementInfoSetElementId( 9723b3eb3cSopenharmony_ci ArkUI_AccessibilityElementInfo* elementInfo, int32_t elementId) 9823b3eb3cSopenharmony_ci{ 9923b3eb3cSopenharmony_ci CHECK_NULL_RETURN(elementInfo, ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER); 10023b3eb3cSopenharmony_ci elementInfo->SetElementId(elementId); 10123b3eb3cSopenharmony_ci return ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL; 10223b3eb3cSopenharmony_ci} 10323b3eb3cSopenharmony_ci 10423b3eb3cSopenharmony_ciint32_t OH_ArkUI_AccessibilityElementInfoSetParentId( 10523b3eb3cSopenharmony_ci ArkUI_AccessibilityElementInfo* elementInfo, int32_t parentId) 10623b3eb3cSopenharmony_ci{ 10723b3eb3cSopenharmony_ci CHECK_NULL_RETURN(elementInfo, ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER); 10823b3eb3cSopenharmony_ci elementInfo->SetParentId(parentId); 10923b3eb3cSopenharmony_ci return ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL; 11023b3eb3cSopenharmony_ci} 11123b3eb3cSopenharmony_ci 11223b3eb3cSopenharmony_ciint32_t OH_ArkUI_AccessibilityElementInfoSetComponentType( 11323b3eb3cSopenharmony_ci ArkUI_AccessibilityElementInfo* elementInfo, const char* componentType) 11423b3eb3cSopenharmony_ci{ 11523b3eb3cSopenharmony_ci CHECK_NULL_RETURN(elementInfo, ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER); 11623b3eb3cSopenharmony_ci CHECK_NULL_RETURN(componentType, ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER); 11723b3eb3cSopenharmony_ci elementInfo->SetComponentType(componentType); 11823b3eb3cSopenharmony_ci return ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL; 11923b3eb3cSopenharmony_ci} 12023b3eb3cSopenharmony_ci 12123b3eb3cSopenharmony_ciint32_t OH_ArkUI_AccessibilityElementInfoSetContents( 12223b3eb3cSopenharmony_ci ArkUI_AccessibilityElementInfo* elementInfo, const char* contents) 12323b3eb3cSopenharmony_ci{ 12423b3eb3cSopenharmony_ci CHECK_NULL_RETURN(elementInfo, ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER); 12523b3eb3cSopenharmony_ci CHECK_NULL_RETURN(contents, ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER); 12623b3eb3cSopenharmony_ci elementInfo->SetContents(contents); 12723b3eb3cSopenharmony_ci return ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL; 12823b3eb3cSopenharmony_ci} 12923b3eb3cSopenharmony_ci 13023b3eb3cSopenharmony_ciint32_t OH_ArkUI_AccessibilityElementInfoSetHintText( 13123b3eb3cSopenharmony_ci ArkUI_AccessibilityElementInfo* elementInfo, const char* hintText) 13223b3eb3cSopenharmony_ci{ 13323b3eb3cSopenharmony_ci CHECK_NULL_RETURN(elementInfo, ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER); 13423b3eb3cSopenharmony_ci CHECK_NULL_RETURN(hintText, ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER); 13523b3eb3cSopenharmony_ci elementInfo->SetHintText(hintText); 13623b3eb3cSopenharmony_ci return ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL; 13723b3eb3cSopenharmony_ci} 13823b3eb3cSopenharmony_ci 13923b3eb3cSopenharmony_ciint32_t OH_ArkUI_AccessibilityElementInfoSetAccessibilityText( 14023b3eb3cSopenharmony_ci ArkUI_AccessibilityElementInfo* elementInfo, const char* accessibilityText) 14123b3eb3cSopenharmony_ci{ 14223b3eb3cSopenharmony_ci CHECK_NULL_RETURN(elementInfo, ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER); 14323b3eb3cSopenharmony_ci CHECK_NULL_RETURN(accessibilityText, ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER); 14423b3eb3cSopenharmony_ci elementInfo->SetAccessibilityText(accessibilityText); 14523b3eb3cSopenharmony_ci return ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL; 14623b3eb3cSopenharmony_ci} 14723b3eb3cSopenharmony_ci 14823b3eb3cSopenharmony_ciint32_t OH_ArkUI_AccessibilityElementInfoSetAccessibilityDescription( 14923b3eb3cSopenharmony_ci ArkUI_AccessibilityElementInfo* elementInfo, const char* accessibilityDescription) 15023b3eb3cSopenharmony_ci{ 15123b3eb3cSopenharmony_ci CHECK_NULL_RETURN(elementInfo, ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER); 15223b3eb3cSopenharmony_ci CHECK_NULL_RETURN(accessibilityDescription, ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER); 15323b3eb3cSopenharmony_ci elementInfo->SetAccessibilityDescription(accessibilityDescription); 15423b3eb3cSopenharmony_ci return ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL; 15523b3eb3cSopenharmony_ci} 15623b3eb3cSopenharmony_ci 15723b3eb3cSopenharmony_ciint32_t OH_ArkUI_AccessibilityElementInfoSetChildNodeIds( 15823b3eb3cSopenharmony_ci ArkUI_AccessibilityElementInfo* elementInfo, int32_t childCount, int64_t* childNodeIds) 15923b3eb3cSopenharmony_ci{ 16023b3eb3cSopenharmony_ci CHECK_NULL_RETURN(elementInfo, ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER); 16123b3eb3cSopenharmony_ci CHECK_NULL_RETURN(childNodeIds, ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER); 16223b3eb3cSopenharmony_ci if (childCount <= 0) { 16323b3eb3cSopenharmony_ci return ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER; 16423b3eb3cSopenharmony_ci } 16523b3eb3cSopenharmony_ci elementInfo->ClearChildNodeIds(); 16623b3eb3cSopenharmony_ci for (int32_t i = 0; i < childCount; i++) { 16723b3eb3cSopenharmony_ci elementInfo->AddChildNodeId(childNodeIds[i]); 16823b3eb3cSopenharmony_ci } 16923b3eb3cSopenharmony_ci return ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL; 17023b3eb3cSopenharmony_ci} 17123b3eb3cSopenharmony_ci 17223b3eb3cSopenharmony_ciint32_t OH_ArkUI_AccessibilityElementInfoSetOperationActions( 17323b3eb3cSopenharmony_ci ArkUI_AccessibilityElementInfo* elementInfo, int32_t operationCount, 17423b3eb3cSopenharmony_ci ArkUI_AccessibleAction* operationActions) 17523b3eb3cSopenharmony_ci{ 17623b3eb3cSopenharmony_ci CHECK_NULL_RETURN(elementInfo, ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER); 17723b3eb3cSopenharmony_ci CHECK_NULL_RETURN(operationActions, ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER); 17823b3eb3cSopenharmony_ci if (operationCount <= 0) { 17923b3eb3cSopenharmony_ci return ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER; 18023b3eb3cSopenharmony_ci } 18123b3eb3cSopenharmony_ci elementInfo->ClearOperationActions(); 18223b3eb3cSopenharmony_ci for (int32_t i = 0; i < operationCount; i++) { 18323b3eb3cSopenharmony_ci elementInfo->AddOperationAction(operationActions[i]); 18423b3eb3cSopenharmony_ci } 18523b3eb3cSopenharmony_ci return ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL; 18623b3eb3cSopenharmony_ci} 18723b3eb3cSopenharmony_ci 18823b3eb3cSopenharmony_ciint32_t OH_ArkUI_AccessibilityElementInfoSetScreenRect( 18923b3eb3cSopenharmony_ci ArkUI_AccessibilityElementInfo* elementInfo, ArkUI_AccessibleRect* screenRect) 19023b3eb3cSopenharmony_ci{ 19123b3eb3cSopenharmony_ci CHECK_NULL_RETURN(elementInfo, ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER); 19223b3eb3cSopenharmony_ci CHECK_NULL_RETURN(screenRect, ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER); 19323b3eb3cSopenharmony_ci elementInfo->SetRect(*screenRect); 19423b3eb3cSopenharmony_ci return ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL; 19523b3eb3cSopenharmony_ci} 19623b3eb3cSopenharmony_ci 19723b3eb3cSopenharmony_ciint32_t OH_ArkUI_AccessibilityElementInfoSetCheckable( 19823b3eb3cSopenharmony_ci ArkUI_AccessibilityElementInfo* elementInfo, bool checkable) 19923b3eb3cSopenharmony_ci{ 20023b3eb3cSopenharmony_ci CHECK_NULL_RETURN(elementInfo, ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER); 20123b3eb3cSopenharmony_ci elementInfo->SetCheckable(checkable); 20223b3eb3cSopenharmony_ci return ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL; 20323b3eb3cSopenharmony_ci} 20423b3eb3cSopenharmony_ci 20523b3eb3cSopenharmony_ciint32_t OH_ArkUI_AccessibilityElementInfoSetChecked( 20623b3eb3cSopenharmony_ci ArkUI_AccessibilityElementInfo* elementInfo, bool checked) 20723b3eb3cSopenharmony_ci{ 20823b3eb3cSopenharmony_ci CHECK_NULL_RETURN(elementInfo, ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER); 20923b3eb3cSopenharmony_ci elementInfo->SetChecked(checked); 21023b3eb3cSopenharmony_ci return ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL; 21123b3eb3cSopenharmony_ci} 21223b3eb3cSopenharmony_ci 21323b3eb3cSopenharmony_ciint32_t OH_ArkUI_AccessibilityElementInfoSetFocusable( 21423b3eb3cSopenharmony_ci ArkUI_AccessibilityElementInfo* elementInfo, bool focusable) 21523b3eb3cSopenharmony_ci{ 21623b3eb3cSopenharmony_ci CHECK_NULL_RETURN(elementInfo, ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER); 21723b3eb3cSopenharmony_ci elementInfo->SetFocusable(focusable); 21823b3eb3cSopenharmony_ci return ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL; 21923b3eb3cSopenharmony_ci} 22023b3eb3cSopenharmony_ci 22123b3eb3cSopenharmony_ciint32_t OH_ArkUI_AccessibilityElementInfoSetFocused( 22223b3eb3cSopenharmony_ci ArkUI_AccessibilityElementInfo* elementInfo, bool isFocused) 22323b3eb3cSopenharmony_ci{ 22423b3eb3cSopenharmony_ci CHECK_NULL_RETURN(elementInfo, ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER); 22523b3eb3cSopenharmony_ci elementInfo->SetFocused(isFocused); 22623b3eb3cSopenharmony_ci return ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL; 22723b3eb3cSopenharmony_ci} 22823b3eb3cSopenharmony_ci 22923b3eb3cSopenharmony_ciint32_t OH_ArkUI_AccessibilityElementInfoSetVisible( 23023b3eb3cSopenharmony_ci ArkUI_AccessibilityElementInfo* elementInfo, bool isVisible) 23123b3eb3cSopenharmony_ci{ 23223b3eb3cSopenharmony_ci CHECK_NULL_RETURN(elementInfo, ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER); 23323b3eb3cSopenharmony_ci elementInfo->SetVisible(isVisible); 23423b3eb3cSopenharmony_ci return ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL; 23523b3eb3cSopenharmony_ci} 23623b3eb3cSopenharmony_ci 23723b3eb3cSopenharmony_ciint32_t OH_ArkUI_AccessibilityElementInfoSetAccessibilityFocused( 23823b3eb3cSopenharmony_ci ArkUI_AccessibilityElementInfo* elementInfo, bool accessibilityFocused) 23923b3eb3cSopenharmony_ci{ 24023b3eb3cSopenharmony_ci CHECK_NULL_RETURN(elementInfo, ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER); 24123b3eb3cSopenharmony_ci elementInfo->SetAccessibilityFocused(accessibilityFocused); 24223b3eb3cSopenharmony_ci return ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL; 24323b3eb3cSopenharmony_ci} 24423b3eb3cSopenharmony_ci 24523b3eb3cSopenharmony_ciint32_t OH_ArkUI_AccessibilityElementInfoSetSelected( 24623b3eb3cSopenharmony_ci ArkUI_AccessibilityElementInfo* elementInfo, bool selected) 24723b3eb3cSopenharmony_ci{ 24823b3eb3cSopenharmony_ci CHECK_NULL_RETURN(elementInfo, ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER); 24923b3eb3cSopenharmony_ci elementInfo->SetSelected(selected); 25023b3eb3cSopenharmony_ci return ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL; 25123b3eb3cSopenharmony_ci} 25223b3eb3cSopenharmony_ci 25323b3eb3cSopenharmony_ciint32_t OH_ArkUI_AccessibilityElementInfoSetClickable( 25423b3eb3cSopenharmony_ci ArkUI_AccessibilityElementInfo* elementInfo, bool clickable) 25523b3eb3cSopenharmony_ci{ 25623b3eb3cSopenharmony_ci CHECK_NULL_RETURN(elementInfo, ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER); 25723b3eb3cSopenharmony_ci elementInfo->SetClickable(clickable); 25823b3eb3cSopenharmony_ci return ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL; 25923b3eb3cSopenharmony_ci} 26023b3eb3cSopenharmony_ci 26123b3eb3cSopenharmony_ciint32_t OH_ArkUI_AccessibilityElementInfoSetLongClickable( 26223b3eb3cSopenharmony_ci ArkUI_AccessibilityElementInfo* elementInfo, bool longClickable) 26323b3eb3cSopenharmony_ci{ 26423b3eb3cSopenharmony_ci CHECK_NULL_RETURN(elementInfo, ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER); 26523b3eb3cSopenharmony_ci elementInfo->SetLongClickable(longClickable); 26623b3eb3cSopenharmony_ci return ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL; 26723b3eb3cSopenharmony_ci} 26823b3eb3cSopenharmony_ci 26923b3eb3cSopenharmony_ciint32_t OH_ArkUI_AccessibilityElementInfoSetEnabled( 27023b3eb3cSopenharmony_ci ArkUI_AccessibilityElementInfo* elementInfo, bool isEnabled) 27123b3eb3cSopenharmony_ci{ 27223b3eb3cSopenharmony_ci CHECK_NULL_RETURN(elementInfo, ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER); 27323b3eb3cSopenharmony_ci elementInfo->SetEnabled(isEnabled); 27423b3eb3cSopenharmony_ci return ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL; 27523b3eb3cSopenharmony_ci} 27623b3eb3cSopenharmony_ci 27723b3eb3cSopenharmony_ciint32_t OH_ArkUI_AccessibilityElementInfoSetIsPassword( 27823b3eb3cSopenharmony_ci ArkUI_AccessibilityElementInfo* elementInfo, bool isPassword) 27923b3eb3cSopenharmony_ci{ 28023b3eb3cSopenharmony_ci CHECK_NULL_RETURN(elementInfo, ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER); 28123b3eb3cSopenharmony_ci elementInfo->SetPassword(isPassword); 28223b3eb3cSopenharmony_ci return ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL; 28323b3eb3cSopenharmony_ci} 28423b3eb3cSopenharmony_ci 28523b3eb3cSopenharmony_ciint32_t OH_ArkUI_AccessibilityElementInfoSetScrollable( 28623b3eb3cSopenharmony_ci ArkUI_AccessibilityElementInfo* elementInfo, bool scrollable) 28723b3eb3cSopenharmony_ci{ 28823b3eb3cSopenharmony_ci CHECK_NULL_RETURN(elementInfo, ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER); 28923b3eb3cSopenharmony_ci elementInfo->SetScrollable(scrollable); 29023b3eb3cSopenharmony_ci return ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL; 29123b3eb3cSopenharmony_ci} 29223b3eb3cSopenharmony_ci 29323b3eb3cSopenharmony_ciint32_t OH_ArkUI_AccessibilityElementInfoSetEditable( 29423b3eb3cSopenharmony_ci ArkUI_AccessibilityElementInfo* elementInfo, bool editable) 29523b3eb3cSopenharmony_ci{ 29623b3eb3cSopenharmony_ci CHECK_NULL_RETURN(elementInfo, ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER); 29723b3eb3cSopenharmony_ci elementInfo->SetEditable(editable); 29823b3eb3cSopenharmony_ci return ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL; 29923b3eb3cSopenharmony_ci} 30023b3eb3cSopenharmony_ci 30123b3eb3cSopenharmony_ciint32_t OH_ArkUI_AccessibilityElementInfoSetIsHint( 30223b3eb3cSopenharmony_ci ArkUI_AccessibilityElementInfo* elementInfo, bool isHint) 30323b3eb3cSopenharmony_ci{ 30423b3eb3cSopenharmony_ci CHECK_NULL_RETURN(elementInfo, ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER); 30523b3eb3cSopenharmony_ci elementInfo->SetHint(isHint); 30623b3eb3cSopenharmony_ci return ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL; 30723b3eb3cSopenharmony_ci} 30823b3eb3cSopenharmony_ci 30923b3eb3cSopenharmony_ciint32_t OH_ArkUI_AccessibilityElementInfoSetRangeInfo( 31023b3eb3cSopenharmony_ci ArkUI_AccessibilityElementInfo* elementInfo, ArkUI_AccessibleRangeInfo* rangeInfo) 31123b3eb3cSopenharmony_ci{ 31223b3eb3cSopenharmony_ci CHECK_NULL_RETURN(elementInfo, ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER); 31323b3eb3cSopenharmony_ci CHECK_NULL_RETURN(rangeInfo, ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER); 31423b3eb3cSopenharmony_ci elementInfo->SetRangeInfo(*rangeInfo); 31523b3eb3cSopenharmony_ci return ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL; 31623b3eb3cSopenharmony_ci} 31723b3eb3cSopenharmony_ci 31823b3eb3cSopenharmony_ciint32_t OH_ArkUI_AccessibilityElementInfoSetGridInfo( 31923b3eb3cSopenharmony_ci ArkUI_AccessibilityElementInfo* elementInfo, ArkUI_AccessibleGridInfo* gridInfo) 32023b3eb3cSopenharmony_ci{ 32123b3eb3cSopenharmony_ci CHECK_NULL_RETURN(elementInfo, ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER); 32223b3eb3cSopenharmony_ci CHECK_NULL_RETURN(gridInfo, ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER); 32323b3eb3cSopenharmony_ci elementInfo->SetGridInfo(*gridInfo); 32423b3eb3cSopenharmony_ci return ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL; 32523b3eb3cSopenharmony_ci} 32623b3eb3cSopenharmony_ci 32723b3eb3cSopenharmony_ciint32_t OH_ArkUI_AccessibilityElementInfoSetGridItemInfo( 32823b3eb3cSopenharmony_ci ArkUI_AccessibilityElementInfo* elementInfo, ArkUI_AccessibleGridItemInfo* gridItem) 32923b3eb3cSopenharmony_ci{ 33023b3eb3cSopenharmony_ci CHECK_NULL_RETURN(elementInfo, ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER); 33123b3eb3cSopenharmony_ci CHECK_NULL_RETURN(gridItem, ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER); 33223b3eb3cSopenharmony_ci elementInfo->SetGridItemInfo(*gridItem); 33323b3eb3cSopenharmony_ci return ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL; 33423b3eb3cSopenharmony_ci} 33523b3eb3cSopenharmony_ci 33623b3eb3cSopenharmony_ciint32_t OH_ArkUI_AccessibilityElementInfoSetSelectedTextStart( 33723b3eb3cSopenharmony_ci ArkUI_AccessibilityElementInfo* elementInfo, int32_t selectedTextStart) 33823b3eb3cSopenharmony_ci{ 33923b3eb3cSopenharmony_ci CHECK_NULL_RETURN(elementInfo, ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER); 34023b3eb3cSopenharmony_ci elementInfo->SetTextBeginSelected(selectedTextStart); 34123b3eb3cSopenharmony_ci return ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL; 34223b3eb3cSopenharmony_ci} 34323b3eb3cSopenharmony_ci 34423b3eb3cSopenharmony_ciint32_t OH_ArkUI_AccessibilityElementInfoSetSelectedTextEnd( 34523b3eb3cSopenharmony_ci ArkUI_AccessibilityElementInfo* elementInfo, int32_t selectedTextEnd) 34623b3eb3cSopenharmony_ci{ 34723b3eb3cSopenharmony_ci CHECK_NULL_RETURN(elementInfo, ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER); 34823b3eb3cSopenharmony_ci elementInfo->SetTextEndSelected(selectedTextEnd); 34923b3eb3cSopenharmony_ci return ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL; 35023b3eb3cSopenharmony_ci} 35123b3eb3cSopenharmony_ci 35223b3eb3cSopenharmony_ciint32_t OH_ArkUI_AccessibilityElementInfoSetCurrentItemIndex( 35323b3eb3cSopenharmony_ci ArkUI_AccessibilityElementInfo* elementInfo, int32_t currentItemIndex) 35423b3eb3cSopenharmony_ci{ 35523b3eb3cSopenharmony_ci CHECK_NULL_RETURN(elementInfo, ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER); 35623b3eb3cSopenharmony_ci elementInfo->SetCurrentIndex(currentItemIndex); 35723b3eb3cSopenharmony_ci return ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL; 35823b3eb3cSopenharmony_ci} 35923b3eb3cSopenharmony_ci 36023b3eb3cSopenharmony_ciint32_t OH_ArkUI_AccessibilityElementInfoSetStartItemIndex( 36123b3eb3cSopenharmony_ci ArkUI_AccessibilityElementInfo* elementInfo, int32_t startItemIndex) 36223b3eb3cSopenharmony_ci{ 36323b3eb3cSopenharmony_ci CHECK_NULL_RETURN(elementInfo, ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER); 36423b3eb3cSopenharmony_ci elementInfo->SetBeginIndex(startItemIndex); 36523b3eb3cSopenharmony_ci return ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL; 36623b3eb3cSopenharmony_ci} 36723b3eb3cSopenharmony_ci 36823b3eb3cSopenharmony_ciint32_t OH_ArkUI_AccessibilityElementInfoSetEndItemIndex( 36923b3eb3cSopenharmony_ci ArkUI_AccessibilityElementInfo* elementInfo, int32_t endItemIndex) 37023b3eb3cSopenharmony_ci{ 37123b3eb3cSopenharmony_ci CHECK_NULL_RETURN(elementInfo, ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER); 37223b3eb3cSopenharmony_ci elementInfo->SetEndIndex(endItemIndex); 37323b3eb3cSopenharmony_ci return ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL; 37423b3eb3cSopenharmony_ci} 37523b3eb3cSopenharmony_ci 37623b3eb3cSopenharmony_ciint32_t OH_ArkUI_AccessibilityElementInfoSetItemCount( 37723b3eb3cSopenharmony_ci ArkUI_AccessibilityElementInfo* elementInfo, int32_t itemCount) 37823b3eb3cSopenharmony_ci{ 37923b3eb3cSopenharmony_ci CHECK_NULL_RETURN(elementInfo, ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER); 38023b3eb3cSopenharmony_ci elementInfo->SetItemCount(itemCount); 38123b3eb3cSopenharmony_ci return ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL; 38223b3eb3cSopenharmony_ci} 38323b3eb3cSopenharmony_ci 38423b3eb3cSopenharmony_ciint32_t OH_ArkUI_AccessibilityElementInfoSetAccessibilityOffset( 38523b3eb3cSopenharmony_ci ArkUI_AccessibilityElementInfo* elementInfo, int32_t offset) 38623b3eb3cSopenharmony_ci{ 38723b3eb3cSopenharmony_ci CHECK_NULL_RETURN(elementInfo, ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER); 38823b3eb3cSopenharmony_ci elementInfo->SetOffset(offset); 38923b3eb3cSopenharmony_ci return ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL; 39023b3eb3cSopenharmony_ci} 39123b3eb3cSopenharmony_ci 39223b3eb3cSopenharmony_ciint32_t OH_ArkUI_AccessibilityElementInfoSetAccessibilityGroup( 39323b3eb3cSopenharmony_ci ArkUI_AccessibilityElementInfo* elementInfo, bool accessibilityGroup) 39423b3eb3cSopenharmony_ci{ 39523b3eb3cSopenharmony_ci CHECK_NULL_RETURN(elementInfo, ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER); 39623b3eb3cSopenharmony_ci elementInfo->SetAccessibilityGroup(accessibilityGroup); 39723b3eb3cSopenharmony_ci return ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL; 39823b3eb3cSopenharmony_ci} 39923b3eb3cSopenharmony_ci 40023b3eb3cSopenharmony_ciint32_t OH_ArkUI_AccessibilityElementInfoSetAccessibilityLevel( 40123b3eb3cSopenharmony_ci ArkUI_AccessibilityElementInfo* elementInfo, const char* accessibilityLevel) 40223b3eb3cSopenharmony_ci{ 40323b3eb3cSopenharmony_ci CHECK_NULL_RETURN(elementInfo, ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER); 40423b3eb3cSopenharmony_ci CHECK_NULL_RETURN(accessibilityLevel, ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER); 40523b3eb3cSopenharmony_ci elementInfo->SetAccessibilityLevel(accessibilityLevel); 40623b3eb3cSopenharmony_ci return ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL; 40723b3eb3cSopenharmony_ci} 40823b3eb3cSopenharmony_ci 40923b3eb3cSopenharmony_ciint32_t OH_ArkUI_AccessibilityElementInfoSetZIndex( 41023b3eb3cSopenharmony_ci ArkUI_AccessibilityElementInfo* elementInfo, int32_t zIndex) 41123b3eb3cSopenharmony_ci{ 41223b3eb3cSopenharmony_ci CHECK_NULL_RETURN(elementInfo, ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER); 41323b3eb3cSopenharmony_ci elementInfo->SetZIndex(zIndex); 41423b3eb3cSopenharmony_ci return ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL; 41523b3eb3cSopenharmony_ci} 41623b3eb3cSopenharmony_ci 41723b3eb3cSopenharmony_ciint32_t OH_ArkUI_AccessibilityElementInfoSetAccessibilityOpacity( 41823b3eb3cSopenharmony_ci ArkUI_AccessibilityElementInfo* elementInfo, float opacity) 41923b3eb3cSopenharmony_ci{ 42023b3eb3cSopenharmony_ci CHECK_NULL_RETURN(elementInfo, ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER); 42123b3eb3cSopenharmony_ci if (std::isnan(opacity)) { 42223b3eb3cSopenharmony_ci return ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER; 42323b3eb3cSopenharmony_ci } 42423b3eb3cSopenharmony_ci elementInfo->SetOpacity(opacity); 42523b3eb3cSopenharmony_ci return ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL; 42623b3eb3cSopenharmony_ci} 42723b3eb3cSopenharmony_ci 42823b3eb3cSopenharmony_ciint32_t OH_ArkUI_AccessibilityElementInfoSetBackgroundColor( 42923b3eb3cSopenharmony_ci ArkUI_AccessibilityElementInfo* elementInfo, const char* backgroundColor) 43023b3eb3cSopenharmony_ci{ 43123b3eb3cSopenharmony_ci CHECK_NULL_RETURN(elementInfo, ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER); 43223b3eb3cSopenharmony_ci CHECK_NULL_RETURN(backgroundColor, ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER); 43323b3eb3cSopenharmony_ci elementInfo->SetBackgroundColor(backgroundColor); 43423b3eb3cSopenharmony_ci return ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL; 43523b3eb3cSopenharmony_ci} 43623b3eb3cSopenharmony_ci 43723b3eb3cSopenharmony_ciint32_t OH_ArkUI_AccessibilityElementInfoSetBackgroundImage( 43823b3eb3cSopenharmony_ci ArkUI_AccessibilityElementInfo* elementInfo, const char* backgroundImage) 43923b3eb3cSopenharmony_ci{ 44023b3eb3cSopenharmony_ci CHECK_NULL_RETURN(elementInfo, ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER); 44123b3eb3cSopenharmony_ci CHECK_NULL_RETURN(backgroundImage, ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER); 44223b3eb3cSopenharmony_ci elementInfo->SetBackgroundImage(backgroundImage); 44323b3eb3cSopenharmony_ci return ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL; 44423b3eb3cSopenharmony_ci} 44523b3eb3cSopenharmony_ci 44623b3eb3cSopenharmony_ciint32_t OH_ArkUI_AccessibilityElementInfoSetBlur( 44723b3eb3cSopenharmony_ci ArkUI_AccessibilityElementInfo* elementInfo, const char* blur) 44823b3eb3cSopenharmony_ci{ 44923b3eb3cSopenharmony_ci CHECK_NULL_RETURN(elementInfo, ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER); 45023b3eb3cSopenharmony_ci CHECK_NULL_RETURN(blur, ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER); 45123b3eb3cSopenharmony_ci elementInfo->SetBlur(blur); 45223b3eb3cSopenharmony_ci return ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL; 45323b3eb3cSopenharmony_ci} 45423b3eb3cSopenharmony_ci 45523b3eb3cSopenharmony_ciint32_t OH_ArkUI_AccessibilityElementInfoSetHitTestBehavior( 45623b3eb3cSopenharmony_ci ArkUI_AccessibilityElementInfo* elementInfo, const char* hitTestBehavior) 45723b3eb3cSopenharmony_ci{ 45823b3eb3cSopenharmony_ci CHECK_NULL_RETURN(elementInfo, ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER); 45923b3eb3cSopenharmony_ci CHECK_NULL_RETURN(hitTestBehavior, ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER); 46023b3eb3cSopenharmony_ci elementInfo->SetHitTestBehavior(hitTestBehavior); 46123b3eb3cSopenharmony_ci return ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL; 46223b3eb3cSopenharmony_ci} 46323b3eb3cSopenharmony_ci 46423b3eb3cSopenharmony_ciint32_t OH_ArkUI_AccessibilityEventSetEventType( 46523b3eb3cSopenharmony_ci ArkUI_AccessibilityEventInfo* eventInfo, ArkUI_AccessibilityEventType eventType) 46623b3eb3cSopenharmony_ci{ 46723b3eb3cSopenharmony_ci CHECK_NULL_RETURN(eventInfo, ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER); 46823b3eb3cSopenharmony_ci eventInfo->SetEventType(eventType); 46923b3eb3cSopenharmony_ci return ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL; 47023b3eb3cSopenharmony_ci} 47123b3eb3cSopenharmony_ci 47223b3eb3cSopenharmony_ciint32_t OH_ArkUI_AccessibilityEventSetTextAnnouncedForAccessibility( 47323b3eb3cSopenharmony_ci ArkUI_AccessibilityEventInfo* eventInfo, const char* textAnnouncedForAccessibility) 47423b3eb3cSopenharmony_ci{ 47523b3eb3cSopenharmony_ci CHECK_NULL_RETURN(eventInfo, ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER); 47623b3eb3cSopenharmony_ci eventInfo->SetTextAnnouncedForAccessibility(textAnnouncedForAccessibility); 47723b3eb3cSopenharmony_ci return ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL; 47823b3eb3cSopenharmony_ci} 47923b3eb3cSopenharmony_ci 48023b3eb3cSopenharmony_ciint32_t OH_ArkUI_AccessibilityEventSetRequestFocusId( 48123b3eb3cSopenharmony_ci ArkUI_AccessibilityEventInfo* eventInfo, int32_t requestFocusId) 48223b3eb3cSopenharmony_ci{ 48323b3eb3cSopenharmony_ci CHECK_NULL_RETURN(eventInfo, ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER); 48423b3eb3cSopenharmony_ci eventInfo->SetRequestFocusId(requestFocusId); 48523b3eb3cSopenharmony_ci return ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL; 48623b3eb3cSopenharmony_ci} 48723b3eb3cSopenharmony_ci 48823b3eb3cSopenharmony_ciint32_t OH_ArkUI_AccessibilityEventSetElementInfo( 48923b3eb3cSopenharmony_ci ArkUI_AccessibilityEventInfo* eventInfo, ArkUI_AccessibilityElementInfo* elementInfo) 49023b3eb3cSopenharmony_ci{ 49123b3eb3cSopenharmony_ci CHECK_NULL_RETURN(eventInfo, ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER); 49223b3eb3cSopenharmony_ci CHECK_NULL_RETURN(elementInfo, ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER); 49323b3eb3cSopenharmony_ci eventInfo->SetElementInfo(elementInfo); 49423b3eb3cSopenharmony_ci return ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL; 49523b3eb3cSopenharmony_ci} 49623b3eb3cSopenharmony_ci 49723b3eb3cSopenharmony_ciint32_t OH_ArkUI_FindAccessibilityActionArgumentByKey( 49823b3eb3cSopenharmony_ci ArkUI_AccessibilityActionArguments* arguments, const char* key, char** value) 49923b3eb3cSopenharmony_ci{ 50023b3eb3cSopenharmony_ci CHECK_NULL_RETURN(arguments, ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER); 50123b3eb3cSopenharmony_ci CHECK_NULL_RETURN(key, ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER); 50223b3eb3cSopenharmony_ci *value = const_cast<char*>(arguments->FindValueByKey(key)); 50323b3eb3cSopenharmony_ci return ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL; 50423b3eb3cSopenharmony_ci} 50523b3eb3cSopenharmony_ci 50623b3eb3cSopenharmony_ci#ifdef __cplusplus 50723b3eb3cSopenharmony_ci}; 50823b3eb3cSopenharmony_ci#endif 50923b3eb3cSopenharmony_ci 510