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_CONTROLLER_H 17#define FOUNDATION_ACE_INTERFACE_INNERKITS_ACE_CONTROLLER_H 18 19#include <memory> 20 21namespace OHOS { 22namespace Ace { 23#ifndef ACE_EXPORT 24#define ACE_EXPORT __attribute__((visibility("default"))) 25#endif 26class UIContent; 27/** 28 * @class NavigationController 29 */ 30class ACE_EXPORT NavigationController { 31public: 32 /** 33 * @brief Get NavigationController by containId and navigationId. 34 * @param uiContent The uiContent. 35 * @param navigationId The navigation id. 36 * @return Returns the NavigationController. 37 */ 38 static NavigationController* GetNavigationController( 39 UIContent* uiContent, const std::string& navigationId); 40 41 NavigationController() = default; 42 virtual ~NavigationController() = default; 43 44 /** 45 * @brief The stack top is NavDestination or not. 46 * @return Returns the result of this interface. 47 */ 48 virtual bool IsNavDestinationInTopStack() { return false; }; 49 /** 50 * @brief Get top navDestination handle in the stack top. 51 * @return Returns handle of this interface 52 */ 53 virtual int32_t GetTopHandle() { return 0; }; 54 /** 55 * @brief Set PIPMode by handle. 56 * @param handle The node handle. 57 */ 58 virtual void SetInPIPMode(int32_t handle) {}; 59 /** 60 * @brief Pop top stack by handle. 61 * @param destroy The true will delete PIPMode. 62 */ 63 virtual void PopInPIP(bool destroy = false) {}; 64 /** 65 * @brief Push stack by handle. 66 * @param handle The node handle. 67 */ 68 virtual void PushInPIP(int32_t handle) {}; 69 /** 70 * @brief Delete PIPMode by handle. 71 * @param handle The node handle. 72 */ 73 virtual void DeletePIPMode(int32_t handle) {}; 74}; 75} // namespace Ace 76} // namespace OHOS 77#endif // FOUNDATION_ACE_INTERFACE_INNERKITS_ACE_CONTROLLER_H 78