[dali_1.1.4] Merge branch '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) 2015 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  */
42 class DALI_IMPORT_API CustomActor : public Actor
43 {
44 public:
45
46   /**
47    * @brief Create an uninitialized CustomActor handle.
48    *
49    * Only derived versions can be instantiated.
50    * Calling member functions with an uninitialized Dali::Object is not allowed.
51    */
52   CustomActor();
53
54   /**
55    * @brief Downcast an Object handle to CustomActor.
56    *
57    * If handle points to a CustomActor the downcast produces valid
58    * handle. If not the returned handle is left uninitialized.
59    *
60    * @param[in] handle to An object
61    * @return handle to a CustomActor or an uninitialized handle
62    */
63   static CustomActor DownCast( BaseHandle handle );
64
65   /**
66    * @brief Destructor
67    *
68    * This is non-virtual since derived Handle types must not contain data or virtual methods.
69    */
70   ~CustomActor();
71
72   /**
73    * @brief Retrieve the custom actor implementation.
74    *
75    * @return The implementation.
76    */
77   CustomActorImpl& GetImplementation();
78
79   /**
80    * @brief Retrieve the custom actor implementation.
81    *
82    * @return The implementation.
83    */
84   const CustomActorImpl& GetImplementation() const;
85
86   /**
87    * @brief Create an initialised CustomActor.
88    *
89    * @param[in] implementation The implementation for this custom actor.
90    * @return A handle to a newly allocated Dali resource.
91    */
92   CustomActor(CustomActorImpl& implementation);
93
94   /**
95    * @brief Copy constructor
96    *
97    * @param [in] copy The actor to copy.
98    */
99   CustomActor(const CustomActor& copy);
100
101   /**
102    * @brief Assignment operator
103    *
104    * @param [in] rhs The actor to copy.
105    */
106   CustomActor& operator=(const CustomActor& rhs);
107
108 public: // Not intended for application developers
109
110   /**
111    * @brief This constructor is used internally to create additional CustomActor handles.
112    *
113    * @param [in] actor A pointer to a newly allocated Dali resource
114    */
115   CustomActor(Internal::CustomActor* actor);
116 };
117
118 /**
119  * @}
120  */
121 } // namespace Dali
122
123 #endif // __DALI_CUSTOM_ACTOR_H__