[dali_2.3.21] Merge branch 'devel/master'
[platform/core/uifw/dali-toolkit.git] / dali-scene3d / public-api / model-motion / motion-index / motion-index.h
1 #ifndef DALI_SCENE3D_MODEL_MOTION_MOTION_INDEX_H
2 #define DALI_SCENE3D_MODEL_MOTION_MOTION_INDEX_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
21 // EXTERNAL INCLUDES
22 #include <dali/public-api/object/property-key.h>
23 #include <dali/public-api/object/property.h>
24 #include <string>
25
26 // INTERNAL INCLUDES
27 #include <dali-scene3d/public-api/model-components/model-node.h>
28
29 namespace Dali
30 {
31 namespace Scene3D
32 {
33 //Forward declarations.
34 namespace Internal
35 {
36 class MotionIndex;
37 } // namespace Internal
38
39 /**
40  * @addtogroup dali_scene3d_model_motion_motion_index
41  * @{
42  */
43
44 /**
45  * @brief Key of motion data to specify what ModelNode's property will be moved.
46  * MotionIndex itself is abstract classes. We need to create New from one of below classes.
47  * - BlendShapeIndex : To control blendshape.
48  * - MotionPropertyIndex : To control the property by Dali::Property.
49  * - MotionTransfromIndex : To control the transform property. Usually be used on CSharp binded API who cannot use Dali::Property directly.
50  * @todo Need to implement ModelNodeId as IndexKey. Currently, StringKey only works well.
51  *
52  * @SINCE_2_2.34
53  */
54 class DALI_SCENE3D_API MotionIndex : public Dali::BaseHandle
55 {
56 public: // Creation & Destruction
57   /**
58    * @brief Creates an uninitialized MotionIndex.
59    *
60    * Only derived versions can be instantiated. Calling member
61    * functions with an uninitialized Dali::Object is not allowed.
62    *
63    * @SINCE_2_2.34
64    */
65   MotionIndex();
66
67   /**
68    * @brief Destructor.
69    *
70    * This is non-virtual since derived Handle types must not contain data or virtual methods.
71    *
72    * @SINCE_2_2.34
73    */
74   ~MotionIndex();
75
76   /**
77    * @brief Copy constructor.
78    *
79    * @SINCE_2_2.34
80    * @param[in] motionIndex Handle to an object
81    */
82   MotionIndex(const MotionIndex& motionIndex);
83
84   /**
85    * @brief Move constructor
86    *
87    * @SINCE_2_2.34
88    * @param[in] rhs A reference to the moved handle
89    */
90   MotionIndex(MotionIndex&& rhs) noexcept;
91
92   /**
93    * @brief Assignment operator.
94    *
95    * @SINCE_2_2.34
96    * @param[in] motionIndex Handle to an object
97    * @return reference to this
98    */
99   MotionIndex& operator=(const MotionIndex& motionIndex);
100
101   /**
102    * @brief Move assignment
103    *
104    * @SINCE_2_2.34
105    * @param[in] rhs A reference to the moved handle
106    * @return A reference to this
107    */
108   MotionIndex& operator=(MotionIndex&& rhs) noexcept;
109
110   /**
111    * @brief Downcasts an Object handle to MotionIndex.
112    *
113    * If handle points to a MotionIndex, the downcast produces valid handle.
114    * If not, the returned handle is left uninitialized.
115    *
116    * @SINCE_2_2.34
117    * @param[in] handle Handle to an object
118    * @return Handle to a MotionIndex or an uninitialized handle
119    */
120   static MotionIndex DownCast(BaseHandle handle);
121
122 public: // Public Method
123   /**
124    * @brief Set the id of ModelNode what this motion index looks.
125    *
126    * @SINCE_2_2.34
127    * @param[in] modelNodeId The model node id.
128    */
129   void SetModelNodeId(Property::Key modelNodeId);
130
131   /**
132    * @brief Get the id of ModelNode what this motion index looks.
133    *
134    * @SINCE_2_2.34
135    * @return The model node id.
136    */
137   Property::Key GetModelNodeId() const;
138
139   /**
140    * @brief Get the property name of this MotionIndex from given ModelNode.
141    *
142    * @SINCE_2_2.34
143    * @param[in] node The model node to get the property name.
144    * @return The name of current property.
145    */
146   std::string GetPropertyName(ModelNode node = ModelNode());
147
148   /**
149    * @brief Get the property index of this MotionIndex from given ModelNode.
150    *
151    * @SINCE_2_2.34
152    * @param[in] node The model node to get the property index.
153    * @return The index of current property.
154    */
155   Property::Index GetPropertyIndex(ModelNode node = ModelNode());
156
157 public: // Not intended for application developers
158   /// @cond internal
159   /**
160    * @brief Creates a handle using the Scene3D::Internal implementation.
161    *
162    * @param[in] implementation The MotionIndex implementation
163    */
164   DALI_INTERNAL MotionIndex(Dali::Scene3D::Internal::MotionIndex* implementation);
165   /// @endcond
166 };
167
168 /**
169  * @}
170  */
171
172 } // namespace Scene3D
173
174 } // namespace Dali
175
176 #endif // DALI_SCENE3D_MODEL_MOTION_MOTION_INDEX_H