Merge branch 'devel/master' into tizen
[platform/core/uifw/dali-core.git] / dali / internal / update / common / resetter-manager.h
1 #ifndef DALI_INTERNAL_SCENEGRAPH_RESETTER_MANAGER_H
2 #define DALI_INTERNAL_SCENEGRAPH_RESETTER_MANAGER_H
3
4 /*
5  * Copyright (c) 2023 Samsung Electronics Co., Ltd.
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  */
19
20 // INTERNAL INCLDUES
21 #include <dali/internal/common/owner-pointer.h>
22 #include <dali/internal/update/common/property-resetter.h>
23
24 namespace Dali::Internal::SceneGraph
25 {
26 class Node;
27 class Renderer;
28
29 /**
30  * Abstract interface for passing a Resetter object add.
31  */
32 class ResetterManager
33 {
34 public:
35   /**
36    * Add a property resetter. ResetterManager takes ownership of the object.
37    * It will be killed by ResetterManager when the associated animator or
38    * constraint has finished; or the property owner of the property is destroyed.
39    */
40   virtual void AddPropertyResetter(OwnerPointer<PropertyResetterBase>& propertyResetter) = 0;
41
42   /**
43    * Add a node resetter. ResetterManager takes ownership of the object.
44    * It will be killed by ResetterManager when the node is disconnected from the scene graph;
45    * or when the node is destroyed.
46    */
47   virtual void AddNodeResetter(const Node& node) = 0;
48
49   /**
50    * Add a renderer resetter. ResetterManager takes ownership of the object.
51    * It will be killed by ResetterManager when the renderer is destroyed
52    */
53   virtual void AddRendererResetter(const Renderer& renderer) = 0;
54
55 protected:
56   /**
57    * Destructor. Protected as no derived class should ever be deleted
58    * through a reference to this pure abstract interface.
59    */
60   virtual ~ResetterManager() = default;
61 };
62
63 } // namespace Dali::Internal::SceneGraph
64
65 #endif //DALI_INTERNAL_SCENEGRAPH_RESETTER_MANAGER_H