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 #ifndef FRAMEWORKS_BRIDGE_DECLARATIVE_FRONTEND_JS_VIEW_JS_POPUPS_H 16 #define FRAMEWORKS_BRIDGE_DECLARATIVE_FRONTEND_JS_VIEW_JS_POPUPS_H 17 #include "base/utils/utils.h" 18 #include "bridge/declarative_frontend/jsview/js_view_abstract.h" 19 namespace OHOS::Ace::Framework { 20 class JSViewPopups { 21 public: 22 using DoubleBindCallback = std::function<void(const std::string&)>; 23 #ifndef WEARABLE_PRODUCT 24 static DoubleBindCallback ParseDoubleBindCallback( 25 const JSCallbackInfo& info, const JSRef<JSObject>& callbackObj, const char* arrowFuncName); 26 #endif 27 static std::vector<NG::OptionParam> ParseBindOptionParam(const JSCallbackInfo& info, size_t optionIndex); 28 static void GetMenuShowInSubwindow(NG::MenuParam& menuParam); 29 static void ParseMenuArrowParam(const JSRef<JSObject>& menuOptions, NG::MenuParam& menuParam); 30 static void ParseLayoutRegionMargin(const JSRef<JSVal>& jsValue, std::optional<CalcDimension>& calcDimension); 31 static void ParseMenuLayoutRegionMarginParam(const JSRef<JSObject>& menuOptions, NG::MenuParam& menuParam); 32 static void ParseMenuBlurStyleOption(const JSRef<JSObject>& menuOptions, NG::MenuParam& menuParam); 33 static void ParseMenuBorderRadius(const JSRef<JSObject>& menuOptions, NG::MenuParam& menuParam); 34 static void ParseMenuEffectOption(const JSRef<JSObject>& menuOptions, NG::MenuParam& menuParam); 35 static void ParseMenuParam( 36 const JSCallbackInfo& info, const JSRef<JSObject>& menuOptions, NG::MenuParam& menuParam); 37 static void ParseBindOptionParam(const JSCallbackInfo& info, NG::MenuParam& menuParam, size_t optionIndex); 38 static void ParseMenuHapticFeedbackMode(const JSRef<JSObject>& menuOptions, NG::MenuParam& menuParam); 39 }; 40 } // namespace OHOS::Ace::Framework 41 42 #endif // FRAMEWORKS_BRIDGE_DECLARATIVE_FRONTEND_JS_VIEW_JS_POPUPS_H