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 16 #ifndef FOUNDATION_ACE_INTERFACE_INNERKITS_ACE_MODAL_CONFIG_H 17 #define FOUNDATION_ACE_INTERFACE_INNERKITS_ACE_MODAL_CONFIG_H 18 19 #include <cstdint> 20 #include <functional> 21 #include <memory> 22 #include <string> 23 24 #include "modal_ui_extension_proxy.h" 25 26 namespace OHOS::AAFwk { 27 class Want; 28 class WantParams; 29 } // namespace OHOS::AAFwk 30 31 namespace OHOS::Ace { 32 struct ModalUIExtensionConfig { 33 bool isProhibitBack = false; 34 bool isAsyncModalBinding = false; 35 bool isAllowedBeCovered = false; 36 std::function<void()> doAfterAsyncModalBinding = nullptr; 37 bool prohibitedRemoveByRouter = false; 38 bool isAllowAddChildBelowModalUec = false; 39 bool isDensityFollowHost = false; 40 bool prohibitedRemoveByNavigation = true; 41 bool isWindowModeFollowHost = false; 42 bool isModalRequestFocus = true; 43 }; 44 45 struct ModalUIExtensionAllowedUpdateConfig { 46 bool prohibitedRemoveByRouter = false; 47 bool prohibitedRemoveByNavigation = true; 48 }; 49 50 struct ModalUIExtensionCallbacks { 51 std::function<void(int32_t)> onRelease; 52 std::function<void(int32_t, const AAFwk::Want&)> onResult; 53 std::function<void(const AAFwk::WantParams&)> onReceive; 54 std::function<void(int32_t, const std::string&, const std::string&)> onError; 55 std::function<void(const std::shared_ptr<ModalUIExtensionProxy>&)> onRemoteReady; 56 std::function<void()> onDestroy; 57 std::function<void()> onDrawReady; 58 }; 59 } // namespace OHOS::Ace 60 #endif // FOUNDATION_ACE_INTERFACE_INNERKITS_ACE_MODAL_CONFIG_H 61