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 isDensityFollowHost = false; 39 bool prohibitedRemoveByNavigation = true; 40 }; 41 42 struct ModalUIExtensionAllowedUpdateConfig { 43 bool prohibitedRemoveByRouter = false; 44 bool prohibitedRemoveByNavigation = true; 45 }; 46 47 struct ModalUIExtensionCallbacks { 48 std::function<void(int32_t)> onRelease; 49 std::function<void(int32_t, const AAFwk::Want&)> onResult; 50 std::function<void(const AAFwk::WantParams&)> onReceive; 51 std::function<void(int32_t, const std::string&, const std::string&)> onError; 52 std::function<void(const std::shared_ptr<ModalUIExtensionProxy>&)> onRemoteReady; 53 std::function<void()> onDestroy; 54 }; 55 } // namespace OHOS::Ace 56 #endif // FOUNDATION_ACE_INTERFACE_INNERKITS_ACE_MODAL_CONFIG_H 57