cd62f49962124eb4ba63605edbf63f2b9c38d86c
[platform/core/uifw/dali-core.git] / capi / dali / public-api / actors / custom-actor.h
1 #ifndef __DALI_CUSTOM_ACTOR_H__
2 #define __DALI_CUSTOM_ACTOR_H__
3
4 /*
5  * Copyright (c) 2014 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 /**
22  * @addtogroup CAPI_DALI_ACTORS_MODULE
23  * @{
24  */
25
26 // INTERNAL INCLUDES
27 #include <dali/public-api/actors/actor.h>
28 #include <dali/public-api/actors/custom-actor-impl.h>
29
30 namespace Dali DALI_IMPORT_API
31 {
32
33 namespace Internal DALI_INTERNAL
34 {
35 class CustomActor;
36 }
37
38 /**
39  * @brief CustomActor is a base class for custom UI controls.
40  *
41  * The implementation of the control must be supplied; see CustomActorImpl for more details.
42  */
43 class DALI_IMPORT_API CustomActor : public Actor
44 {
45 public:
46
47   /**
48    * @brief Create an uninitialized CustomActor handle.
49    *
50    * Only derived versions can be instantiated.
51    * Calling member functions with an uninitialized Dali::Object is not allowed.
52    */
53   CustomActor();
54
55   /**
56    * @brief Downcast an Object handle to CustomActor.
57    *
58    * If handle points to a CustomActor the downcast produces valid
59    * handle. If not the returned handle is left uninitialized.
60    *
61    * @param[in] handle to An object
62    * @return handle to a CustomActor or an uninitialized handle
63    */
64   static CustomActor DownCast( BaseHandle handle );
65
66   /**
67    * @brief Destructor
68    *
69    * This is non-virtual since derived Handle types must not contain data or virtual methods.
70    */
71   ~CustomActor();
72
73   /**
74    * @brief Retrieve the custom actor implementation.
75    *
76    * @return The implementation.
77    */
78   CustomActorImpl& GetImplementation();
79
80   /**
81    * @brief Retrieve the custom actor implementation.
82    *
83    * @return The implementation.
84    */
85   const CustomActorImpl& GetImplementation() const;
86
87   /**
88    * @brief Create an initialised CustomActor.
89    *
90    * @param[in] implementation The implementation for this custom actor.
91    * @return A handle to a newly allocated Dali resource.
92    */
93   CustomActor(CustomActorImpl& implementation);
94
95   /**
96    * @copydoc Dali::BaseHandle::operator=
97    */
98   using BaseHandle::operator=;
99
100 public: // Not intended for application developers
101
102   /**
103    * @brief This constructor is used internally to create additional CustomActor handles.
104    *
105    * @param [in] actor A pointer to a newly allocated Dali resource
106    */
107   CustomActor(Internal::CustomActor* actor);
108 };
109
110 } // namespace Dali
111
112 /**
113  * @}
114  */
115 #endif // __DALI_CUSTOM_ACTOR_H__