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 "ohos_nweb/bridge/ark_web_select_popup_menu_param_impl.h" 17 18 #include "ohos_nweb/bridge/ark_web_select_menu_bound_impl.h" 19 #include "ohos_nweb/cpptoc/ark_web_select_popup_menu_item_vector_cpptoc.h" 20 21 #include "base/bridge/ark_web_bridge_macros.h" 22 23 namespace OHOS::ArkWeb { 24 ArkWebSelectPopupMenuParamImpl(std::shared_ptr<OHOS::NWeb::NWebSelectPopupMenuParam> nweb_select_popup_menu_param)25ArkWebSelectPopupMenuParamImpl::ArkWebSelectPopupMenuParamImpl( 26 std::shared_ptr<OHOS::NWeb::NWebSelectPopupMenuParam> nweb_select_popup_menu_param) 27 : nweb_select_popup_menu_param_(nweb_select_popup_menu_param) 28 {} 29 GetMenuItems()30ArkWebSelectPopupMenuItemVector ArkWebSelectPopupMenuParamImpl::GetMenuItems() 31 { 32 return ArkWebSelectPopupMenuItemVectorClassToStruct(nweb_select_popup_menu_param_->GetMenuItems()); 33 } 34 GetItemHeight()35int ArkWebSelectPopupMenuParamImpl::GetItemHeight() 36 { 37 return nweb_select_popup_menu_param_->GetItemHeight(); 38 } 39 GetSelectedItem()40int ArkWebSelectPopupMenuParamImpl::GetSelectedItem() 41 { 42 return nweb_select_popup_menu_param_->GetSelectedItem(); 43 } 44 GetItemFontSize()45double ArkWebSelectPopupMenuParamImpl::GetItemFontSize() 46 { 47 return nweb_select_popup_menu_param_->GetItemFontSize(); 48 } 49 GetIsRightAligned()50bool ArkWebSelectPopupMenuParamImpl::GetIsRightAligned() 51 { 52 return nweb_select_popup_menu_param_->GetIsRightAligned(); 53 } 54 GetSelectMenuBound()55ArkWebRefPtr<ArkWebSelectMenuBound> ArkWebSelectPopupMenuParamImpl::GetSelectMenuBound() 56 { 57 std::shared_ptr<OHOS::NWeb::NWebSelectMenuBound> nweb_select_menu_bound = 58 nweb_select_popup_menu_param_->GetSelectMenuBound(); 59 if (CHECK_SHARED_PTR_IS_NULL(nweb_select_menu_bound)) { 60 return nullptr; 61 } 62 63 return new ArkWebSelectMenuBoundImpl(nweb_select_menu_bound); 64 } 65 GetIsAllowMultipleSelection()66bool ArkWebSelectPopupMenuParamImpl::GetIsAllowMultipleSelection() 67 { 68 return nweb_select_popup_menu_param_->GetIsAllowMultipleSelection(); 69 } 70 71 } // namespace OHOS::ArkWeb 72