(ImageSize) Add natural image size handling
[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 Flora License, Version 1.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://floralicense.org/license/
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  * @addtogroup CAPI_DALI_FRAMEWORK
22  * @{
23  */
24
25 // INTERNAL INCLUDES
26 #include <dali/public-api/actors/actor.h>
27 #include <dali/public-api/actors/custom-actor-impl.h>
28
29 namespace Dali DALI_IMPORT_API
30 {
31
32 namespace Internal DALI_INTERNAL
33 {
34 class CustomActor;
35 }
36
37 /**
38  * CustomActor is a base class for custom UI controls.
39  * The implementation of the control must be supplied; see CustomActorImpl for more details.
40  */
41 class DALI_IMPORT_API CustomActor : public Actor
42 {
43 public:
44
45   /**
46    * Create an uninitialized CustomActor handle. Only derived versions can be instantiated.
47    * Calling member functions with an uninitialized Dali::Object is not allowed.
48    */
49   CustomActor();
50
51   /**
52    * Downcast an Object handle to CustomActor. If handle points to a CustomActor the
53    * downcast produces valid handle. If not the returned handle is left uninitialized.
54    * @param[in] handle to An object
55    * @return handle to a CustomActor or an uninitialized handle
56    */
57   static CustomActor DownCast( BaseHandle handle );
58
59   /**
60    * Virtual destructor.
61    * Dali::Object derived classes do not contain member data.
62    */
63   virtual ~CustomActor();
64
65   /**
66    * Retrieve the custom actor implementation.
67    * @return The implementation.
68    */
69   CustomActorImpl& GetImplementation();
70
71   /**
72    * Retrieve the custom actor implementation.
73    * @return The implementation.
74    */
75   const CustomActorImpl& GetImplementation() const;
76
77   /**
78    * Create an initialised CustomActor.
79    * @param[in] implementation The implementation for this custom actor.
80    * @return A handle to a newly allocated Dali resource.
81    */
82   CustomActor(CustomActorImpl& implementation);
83
84   /**
85    * @copydoc Dali::BaseHandle::operator=
86    */
87   using BaseHandle::operator=;
88
89 public: // Not intended for application developers
90
91   /**
92    * This constructor is used internally to create additional CustomActor handles.
93    * @param [in] actor A pointer to a newly allocated Dali resource
94    */
95   CustomActor(Internal::CustomActor* actor);
96 };
97
98 } // namespace Dali
99
100 /**
101  * @}
102  */
103 #endif // __DALI_CUSTOM_ACTOR_H__