d353d6c15c443109e5ec5f7373c1f078d7825e52
[platform/core/uifw/dali-core.git] / dali / public-api / actors / custom-actor.h
1 #ifndef DALI_CUSTOM_ACTOR_H
2 #define DALI_CUSTOM_ACTOR_H
3
4 /*
5  * Copyright (c) 2020 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 // INTERNAL INCLUDES
22 #include <dali/public-api/actors/actor.h>
23 #include <dali/public-api/actors/custom-actor-impl.h>
24
25 namespace Dali
26 {
27 /**
28  * @addtogroup dali_core_actors
29  * @{
30  */
31
32 namespace Internal DALI_INTERNAL
33 {
34 class CustomActor;
35 }
36
37 /**
38  * @brief CustomActor is a base class for custom UI controls.
39  *
40  * The implementation of the control must be supplied; see CustomActorImpl for more details.
41  * @SINCE_1_0.0
42  */
43 class DALI_CORE_API CustomActor : public Actor
44 {
45 public:
46   /**
47    * @brief Creates an uninitialized CustomActor handle.
48    *
49    * Only derived versions can be instantiated.
50    * Calling member functions with an uninitialized CustomActor handle is not allowed.
51    * @SINCE_1_0.0
52    */
53   CustomActor();
54
55   /**
56    * @brief Downcasts a handle to CustomActor handle.
57    *
58    * If the handle points to a CustomActor, the downcast produces valid handle.
59    * If not, the returned handle is left uninitialized.
60    *
61    * @SINCE_1_0.0
62    * @param[in] handle Handle to an object
63    * @return Handle to a CustomActor or an uninitialized handle
64    */
65   static CustomActor DownCast(BaseHandle handle);
66
67   /**
68    * @brief Destructor.
69    *
70    * This is non-virtual since derived Handle types must not contain data or virtual methods.
71    * @SINCE_1_0.0
72    */
73   ~CustomActor();
74
75   /**
76    * @brief Retrieves the custom actor implementation.
77    *
78    * @SINCE_1_0.0
79    * @return The implementation
80    */
81   CustomActorImpl& GetImplementation();
82
83   /**
84    * @brief Retrieves the custom actor implementation.
85    *
86    * @SINCE_1_0.0
87    * @return The implementation
88    */
89   const CustomActorImpl& GetImplementation() const;
90
91   /**
92    * @brief Creates an initialized CustomActor.
93    *
94    * @SINCE_1_0.0
95    * @param[in] implementation The implementation for this custom actor
96    */
97   CustomActor(CustomActorImpl& implementation);
98
99   /**
100    * @brief Copy constructor.
101    *
102    * @SINCE_1_0.0
103    * @param[in] copy The actor to copy
104    */
105   CustomActor(const CustomActor& copy);
106
107   /**
108    * @brief Assignment operator.
109    *
110    * @SINCE_1_0.0
111    * @param[in] rhs The actor to copy
112    * @return A reference to this
113    */
114   CustomActor& operator=(const CustomActor& rhs);
115
116   /**
117    * @brief Move constructor.
118    *
119    * @SINCE_1_9.22
120    * @param[in] rhs The actor to move
121    */
122   CustomActor(CustomActor&& rhs);
123
124   /**
125    * @brief Move assignment operator.
126    *
127    * @SINCE_1_9.22
128    * @param[in] rhs The actor to move
129    * @return A reference to this
130    */
131   CustomActor& operator=(CustomActor&& rhs);
132
133 public: // Not intended for application developers
134   /**
135    * @brief This constructor is used internally to create additional CustomActor handles.
136    *
137    * @SINCE_1_0.0
138    * @param[in] actor A pointer to a newly allocated Dali resource
139    */
140   CustomActor(Internal::CustomActor* actor);
141 };
142
143 /**
144  * @}
145  */
146 } // namespace Dali
147
148 #endif // DALI_CUSTOM_ACTOR_H