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_item_wrapper.h" 17 18 #include "base/bridge/ark_web_bridge_macros.h" 19 20 namespace OHOS::ArkWeb { 21 ArkWebSelectPopupMenuItemWrapper(ArkWebRefPtr<ArkWebSelectPopupMenuItem> ark_web_select_popup_menu_item)22ArkWebSelectPopupMenuItemWrapper::ArkWebSelectPopupMenuItemWrapper( 23 ArkWebRefPtr<ArkWebSelectPopupMenuItem> ark_web_select_popup_menu_item) 24 : ark_web_select_popup_menu_item_(ark_web_select_popup_menu_item) 25 {} 26 GetType()27NWebSelectPopupMenuItemType ArkWebSelectPopupMenuItemWrapper::GetType() 28 { 29 return static_cast<NWebSelectPopupMenuItemType>(ark_web_select_popup_menu_item_->GetType()); 30 } 31 GetLabel()32std::string ArkWebSelectPopupMenuItemWrapper::GetLabel() 33 { 34 ArkWebString stLabel = ark_web_select_popup_menu_item_->GetLabel(); 35 36 std::string objLabel = ArkWebStringStructToClass(stLabel); 37 ArkWebStringStructRelease(stLabel); 38 return objLabel; 39 } 40 GetAction()41uint32_t ArkWebSelectPopupMenuItemWrapper::GetAction() 42 { 43 return ark_web_select_popup_menu_item_->GetAction(); 44 } 45 GetToolTip()46std::string ArkWebSelectPopupMenuItemWrapper::GetToolTip() 47 { 48 ArkWebString stToolTip = ark_web_select_popup_menu_item_->GetToolTip(); 49 50 std::string objToolTip = ArkWebStringStructToClass(stToolTip); 51 ArkWebStringStructRelease(stToolTip); 52 return objToolTip; 53 } 54 GetIsChecked()55bool ArkWebSelectPopupMenuItemWrapper::GetIsChecked() 56 { 57 return ark_web_select_popup_menu_item_->GetIsChecked(); 58 } 59 GetIsEnabled()60bool ArkWebSelectPopupMenuItemWrapper::GetIsEnabled() 61 { 62 return ark_web_select_popup_menu_item_->GetIsEnabled(); 63 } 64 GetTextDirection()65NWebTextDirection ArkWebSelectPopupMenuItemWrapper::GetTextDirection() 66 { 67 return static_cast<NWebTextDirection>(ark_web_select_popup_menu_item_->GetTextDirection()); 68 } 69 GetHasTextDirectionOverride()70bool ArkWebSelectPopupMenuItemWrapper::GetHasTextDirectionOverride() 71 { 72 return ark_web_select_popup_menu_item_->GetHasTextDirectionOverride(); 73 } 74 75 } // namespace OHOS::ArkWeb 76