[dali_2.3.21] Merge branch 'devel/master'
[platform/core/uifw/dali-toolkit.git] / dali-scene3d / public-api / model-motion / motion-index / motion-property-index.h
1 #ifndef DALI_SCENE3D_MODEL_MOTION_MOTION_PROPERTY_INDEX_H
2 #define DALI_SCENE3D_MODEL_MOTION_MOTION_PROPERTY_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
23 // INTERNAL INCLUDES
24 #include <dali-scene3d/public-api/model-motion/motion-index/motion-index.h>
25
26 namespace Dali
27 {
28 namespace Scene3D
29 {
30 //Forward declarations.
31 namespace Internal
32 {
33 class MotionPropertyIndex;
34 } // namespace Internal
35
36 /**
37  * @addtogroup dali_scene3d_model_motion_motion_property_index
38  * @{
39  */
40
41 /**
42  * @brief Basic MotionIndex to control Dali::Property.
43  * It can control more general case.
44  *
45  * @code
46  *
47  * MotionPropertyIndex color = MotionPropertyIndex::New("nodeName", Dali::Actor::Property::COLOR);
48  *
49  * // We can change the property later.
50  * MotionPropertyIndex custom = MotionPropertyIndex::New();
51  * orientation.SetModelNodeId("nodeName");
52  * orientation.SetPropertyId("some_custom_property");
53  *
54  * // Note that all cases of MotionTransformIndex can be controled by MotionPropertyIndex
55  * // Both position0 and position1 can control the node's Position.
56  * MotionTransformIndex position0 = MotionTransformIndex::New("nodeName", MotionTransformIndex::TransformType::POSITION);
57  * MotionPropertyIndex  position1 = MotionPropertyIndex::New("nodeName", Dali::Actor::Property::POSITION);
58  *
59  * @endcode
60  *
61  * @SINCE_2_2.34
62  */
63 class DALI_SCENE3D_API MotionPropertyIndex : public MotionIndex
64 {
65 public: // Creation & Destruction
66   /**
67    * @brief Create an initialized MotionPropertyIndex.
68    *
69    * @SINCE_2_2.34
70    * @return A handle to a newly allocated Dali resource
71    */
72   static MotionPropertyIndex New();
73
74   /**
75    * @brief Create an initialized MotionPropertyIndex with values.
76    *
77    * @SINCE_2_2.34
78    * @param[in] modelNodeId The id of model node what this motion index looks.
79    * @param[in] propertyId The id of property what this motion index looks.
80    * @return A handle to a newly allocated Dali resource
81    */
82   static MotionPropertyIndex New(Property::Key modelNodeId, Property::Key propertyId);
83
84   /**
85    * @brief Creates an uninitialized MotionPropertyIndex.
86    *
87    * Only derived versions can be instantiated. Calling member
88    * functions with an uninitialized Dali::Object is not allowed.
89    *
90    * @SINCE_2_2.34
91    */
92   MotionPropertyIndex();
93
94   /**
95    * @brief Destructor.
96    *
97    * This is non-virtual since derived Handle types must not contain data or virtual methods.
98    *
99    * @SINCE_2_2.34
100    */
101   ~MotionPropertyIndex();
102
103   /**
104    * @brief Copy constructor.
105    *
106    * @SINCE_2_2.34
107    * @param[in] motionPropertyIndex Handle to an object
108    */
109   MotionPropertyIndex(const MotionPropertyIndex& motionPropertyIndex);
110
111   /**
112    * @brief Move constructor
113    *
114    * @SINCE_2_2.34
115    * @param[in] rhs A reference to the moved handle
116    */
117   MotionPropertyIndex(MotionPropertyIndex&& rhs) noexcept;
118
119   /**
120    * @brief Assignment operator.
121    *
122    * @SINCE_2_2.34
123    * @param[in] motionPropertyIndex Handle to an object
124    * @return reference to this
125    */
126   MotionPropertyIndex& operator=(const MotionPropertyIndex& motionPropertyIndex);
127
128   /**
129    * @brief Move assignment
130    *
131    * @SINCE_2_2.34
132    * @param[in] rhs A reference to the moved handle
133    * @return A reference to this
134    */
135   MotionPropertyIndex& operator=(MotionPropertyIndex&& rhs) noexcept;
136
137   /**
138    * @brief Downcasts an Object handle to MotionPropertyIndex.
139    *
140    * If handle points to a MotionPropertyIndex, the downcast produces valid handle.
141    * If not, the returned handle is left uninitialized.
142    *
143    * @SINCE_2_2.34
144    * @param[in] handle Handle to an object
145    * @return Handle to a MotionPropertyIndex or an uninitialized handle
146    */
147   static MotionPropertyIndex DownCast(BaseHandle handle);
148
149 public: // Public Method
150   /**
151    * @brief Set the id of property what this motion index looks.
152    *
153    * @SINCE_2_2.34
154    * @param[in] propertyId The property id.
155    */
156   void SetPropertyId(Property::Key propertyId);
157
158   /**
159    * @brief Get the id of property what this motion index looks.
160    *
161    * @SINCE_2_2.34
162    * @return The blend shape id.
163    */
164   Property::Key GetPropertyId() const;
165
166 public: // Not intended for application developers
167   /// @cond internal
168   /**
169    * @brief Creates a handle using the Scene3D::Internal implementation.
170    *
171    * @param[in] implementation The MotionPropertyIndex implementation
172    */
173   DALI_INTERNAL MotionPropertyIndex(Dali::Scene3D::Internal::MotionPropertyIndex* implementation);
174   /// @endcond
175 };
176
177 /**
178  * @}
179  */
180
181 } // namespace Scene3D
182
183 } // namespace Dali
184
185 #endif // DALI_SCENE3D_MODEL_MOTION_MOTION_PROPERTY_INDEX_H