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 "bridge/declarative_frontend/engine/jsi/nativeModule/arkts_native_tabcontent_bridge.h" 16 #include "frameworks/bridge/declarative_frontend/jsview/js_tab_content.h" 17 18 namespace OHOS::Ace::NG { SetTabBar(ArkUIRuntimeCallInfo * runtimeCallInfo)19ArkUINativeModuleValue TabContentBridge::SetTabBar(ArkUIRuntimeCallInfo* runtimeCallInfo) 20 { 21 Framework::JSTabContent::SetTabBar(Framework::JsiCallbackInfo(runtimeCallInfo)); 22 return panda::JSValueRef::Undefined(runtimeCallInfo->GetVM()); 23 } 24 ResetTabBar(ArkUIRuntimeCallInfo * runtimeCallInfo)25ArkUINativeModuleValue TabContentBridge::ResetTabBar(ArkUIRuntimeCallInfo* runtimeCallInfo) 26 { 27 EcmaVM* vm = runtimeCallInfo->GetVM(); 28 CHECK_NULL_RETURN(vm, panda::NativePointerRef::New(vm, nullptr)); 29 Local<JSValueRef> firstArg = runtimeCallInfo->GetCallArgRef(0); 30 CHECK_NULL_RETURN(firstArg->IsNativePointer(vm), panda::JSValueRef::Undefined(vm)); 31 auto nativeNode = nodePtr(firstArg->ToNativePointer(vm)->Value()); 32 GetArkUINodeModifiers()->getTabContentModifier()->setTabContentLabel(nativeNode, ""); 33 return panda::JSValueRef::Undefined(vm); 34 } 35 SetTabContentWidth(ArkUIRuntimeCallInfo * runtimeCallInfo)36ArkUINativeModuleValue TabContentBridge::SetTabContentWidth(ArkUIRuntimeCallInfo* runtimeCallInfo) 37 { 38 LOGW("TabContent does not support width and height settings"); 39 EcmaVM* vm = runtimeCallInfo->GetVM(); 40 return panda::JSValueRef::Undefined(vm); 41 } 42 SetTabContentHeight(ArkUIRuntimeCallInfo * runtimeCallInfo)43ArkUINativeModuleValue TabContentBridge::SetTabContentHeight(ArkUIRuntimeCallInfo* runtimeCallInfo) 44 { 45 LOGW("TabContent does not support width and height settings"); 46 EcmaVM* vm = runtimeCallInfo->GetVM(); 47 return panda::JSValueRef::Undefined(vm); 48 } 49 SetTabContentSize(ArkUIRuntimeCallInfo * runtimeCallInfo)50ArkUINativeModuleValue TabContentBridge::SetTabContentSize(ArkUIRuntimeCallInfo* runtimeCallInfo) 51 { 52 LOGW("TabContent does not support width and height settings"); 53 EcmaVM* vm = runtimeCallInfo->GetVM(); 54 return panda::JSValueRef::Undefined(vm); 55 } ResetTabContentWidth(ArkUIRuntimeCallInfo * runtimeCallInfo)56ArkUINativeModuleValue TabContentBridge::ResetTabContentWidth(ArkUIRuntimeCallInfo* runtimeCallInfo) 57 { 58 LOGW("TabContent does not support width and height settings"); 59 EcmaVM* vm = runtimeCallInfo->GetVM(); 60 return panda::JSValueRef::Undefined(vm); 61 } 62 ResetTabContentHeight(ArkUIRuntimeCallInfo * runtimeCallInfo)63ArkUINativeModuleValue TabContentBridge::ResetTabContentHeight(ArkUIRuntimeCallInfo* runtimeCallInfo) 64 { 65 LOGW("TabContent does not support width and height settings"); 66 EcmaVM* vm = runtimeCallInfo->GetVM(); 67 return panda::JSValueRef::Undefined(vm); 68 } 69 ResetTabContentSize(ArkUIRuntimeCallInfo * runtimeCallInfo)70ArkUINativeModuleValue TabContentBridge::ResetTabContentSize(ArkUIRuntimeCallInfo* runtimeCallInfo) 71 { 72 LOGW("TabContent does not support width and height settings"); 73 EcmaVM* vm = runtimeCallInfo->GetVM(); 74 return panda::JSValueRef::Undefined(vm); 75 } 76 } // namespace OHOS::Ace::NG 77