Merge "[ATSPI] Fix for SCREEN coordinate type in GetExtents" into devel/master
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / devel-api / controls / control-wrapper.h
1 #ifndef DALI_TOOLKIT_CONTROL_WRAPPER_H
2 #define DALI_TOOLKIT_CONTROL_WRAPPER_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-toolkit/public-api/controls/control.h>
23
24 namespace Dali
25 {
26 namespace Toolkit
27 {
28 namespace Internal DALI_INTERNAL
29 {
30 class ControlWrapper;
31 }
32
33 /**
34  * @brief ControlWrapper is a base class for custom UI controls developed in managed code (i.e. C#.NET).
35  *
36  * The implementation of the ControlWrapper must be supplied; see Internal::ControlWrapper for more details.
37  */
38 class DALI_TOOLKIT_API ControlWrapper : public Control
39 {
40 public:
41   /**
42    * @brief Create a new instance of a ControlWrapper.
43    *
44    * @param[in] typeName The name of the type that is registered with this control
45    * @param[in] implementation The implementation of this control
46    *
47    * @return A handle to a new ControlWrapper.
48    */
49   static ControlWrapper New(const std::string& typeName, Internal::ControlWrapper& implementation);
50
51   /**
52    * @brief Creates an empty ControlWrapper handle.
53    */
54   ControlWrapper();
55
56   /**
57    * @brief Destructor
58    *
59    * This is non-virtual since derived Handle types must not contain data or virtual methods.
60    */
61   ~ControlWrapper();
62
63   /**
64    * @brief Copy constructor.
65    *
66    * Creates another handle that points to the same real object
67    * @param[in] handle Handle to the copied object
68    */
69   ControlWrapper(const ControlWrapper& handle);
70
71   /**
72    * @brief Assignment operator.
73    *
74    * Changes this handle to point to another real object
75    * @param[in] handle Handle to the object
76    * @return A reference to this
77    */
78   ControlWrapper& operator=(const ControlWrapper& handle);
79
80   /**
81    * @brief Downcast an Object handle to ControlWrapper.
82    *
83    * If handle points to a ControlWrapper the
84    * downcast produces valid handle. If not the returned handle is left uninitialized.
85    * @param[in] handle Handle to an object
86    * @return handle to a ControlWrapper or an uninitialized handle
87    */
88   static ControlWrapper DownCast(BaseHandle handle);
89
90 public: // Not intended for application developers
91   /**
92    * @brief Creates a handle using the Toolkit::Internal implementation.
93    *
94    * @param[in]  implementation  The Control implementation.
95    */
96   ControlWrapper(Internal::ControlWrapper& implementation);
97
98   /**
99    * @brief Allows the creation of this Control from an Internal::CustomActor pointer.
100    *
101    * @param[in]  internal  A pointer to the internal CustomActor.
102    */
103   explicit ControlWrapper(Dali::Internal::CustomActor* internal);
104 };
105
106 } // namespace Toolkit
107
108 } // namespace Dali
109
110 #endif // DALI_TOOLKIT_CONTROL_WRAPPER_H