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 #ifndef SCENE_INTERFACE_INODEHIERARCHY_CONTROLLER_H 17 #define SCENE_INTERFACE_INODEHIERARCHY_CONTROLLER_H 18 19 #include <scene_plugin/interface/intf_node.h> 20 21 #include <meta/base/interface_macros.h> 22 #include <meta/interface/intf_startable.h> 23 #include <meta/interface/interface_macros.h> 24 25 SCENE_BEGIN_NAMESPACE() 26 27 REGISTER_INTERFACE(INodeHierarchyController, "839c9854-c13f-4c57-a59d-0b712d80ae84") 28 29 /** 30 * @brief The INodeHierarchyController interface is implemented by controller objects for nodes. 31 * @note The default implementation is SCENE_NS::ClassId::NodeHierarchyController. 32 */ 33 class INodeHierarchyController : public CORE_NS::IInterface { 34 META_INTERFACE(CORE_NS::IInterface, INodeHierarchyController) 35 public: 36 /** 37 * @brief Attach all nodes which are part of the target hierarchy. 38 * @return True if successful, false otherwise. 39 */ 40 virtual bool AttachAll() = 0; 41 /** 42 * @brief Detaches all nodes which are part of the target hierarchy. 43 * @return True if successful, false otherwise. 44 */ 45 virtual bool DetachAll() = 0; 46 /** 47 * @brief Returns all nodes currently being controlled. 48 */ 49 virtual BASE_NS::vector<INode::Ptr> GetAllNodes() const = 0; 50 }; 51 52 SCENE_END_NAMESPACE() 53 54 #endif 55