Merge "Changed const variables to constexpr where possible." into devel/master
[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   /**
48    * @brief Creates an uninitialized CustomActor handle.
49    *
50    * Only derived versions can be instantiated.
51    * Calling member functions with an uninitialized CustomActor handle is not allowed.
52    * @SINCE_1_0.0
53    */
54   CustomActor();
55
56   /**
57    * @brief Downcasts a handle to CustomActor handle.
58    *
59    * If the handle points to a CustomActor, the downcast produces valid handle.
60    * If not, the returned handle is left uninitialized.
61    *
62    * @SINCE_1_0.0
63    * @param[in] handle Handle to an object
64    * @return Handle to a CustomActor or an uninitialized handle
65    */
66   static CustomActor DownCast( BaseHandle handle );
67
68   /**
69    * @brief Destructor.
70    *
71    * This is non-virtual since derived Handle types must not contain data or virtual methods.
72    * @SINCE_1_0.0
73    */
74   ~CustomActor();
75
76   /**
77    * @brief Retrieves the custom actor implementation.
78    *
79    * @SINCE_1_0.0
80    * @return The implementation
81    */
82   CustomActorImpl& GetImplementation();
83
84   /**
85    * @brief Retrieves the custom actor implementation.
86    *
87    * @SINCE_1_0.0
88    * @return The implementation
89    */
90   const CustomActorImpl& GetImplementation() const;
91
92   /**
93    * @brief Creates an initialized CustomActor.
94    *
95    * @SINCE_1_0.0
96    * @param[in] implementation The implementation for this custom actor
97    * @return A handle to a newly allocated Dali resource
98    */
99   CustomActor(CustomActorImpl& implementation);
100
101   /**
102    * @brief Copy constructor.
103    *
104    * @SINCE_1_0.0
105    * @param[in] copy The actor to copy
106    */
107   CustomActor(const CustomActor& copy);
108
109   /**
110    * @brief Assignment operator.
111    *
112    * @SINCE_1_0.0
113    * @param[in] rhs The actor to copy
114    * @return A reference to this
115    */
116   CustomActor& operator=(const CustomActor& rhs);
117
118   /**
119    * @brief Move constructor.
120    *
121    * @SINCE_1_9.22
122    * @param[in] rhs The actor to move
123    */
124   CustomActor( CustomActor&& rhs );
125
126   /**
127    * @brief Move assignment operator.
128    *
129    * @SINCE_1_9.22
130    * @param[in] rhs The actor to move
131    * @return A reference to this
132    */
133   CustomActor& operator=( CustomActor&& rhs );
134
135 public: // Not intended for application developers
136
137   /**
138    * @brief This constructor is used internally to create additional CustomActor handles.
139    *
140    * @SINCE_1_0.0
141    * @param[in] actor A pointer to a newly allocated Dali resource
142    */
143   CustomActor(Internal::CustomActor* actor);
144 };
145
146 /**
147  * @}
148  */
149 } // namespace Dali
150
151 #endif // DALI_CUSTOM_ACTOR_H