c00a914b35ac0de960e70a7b780be53197e3469a
[platform/core/uifw/dali-adaptor.git] / dali / public-api / adaptor-framework / widget.h
1 #ifndef DALI_WIDGET_H
2 #define DALI_WIDGET_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 // EXTERNAL INCLUDES
22 #include <dali/public-api/object/base-handle.h>
23
24 // INTERNAL INCLUDES
25 #include <dali/public-api/dali-adaptor-common.h>
26
27 namespace Dali
28 {
29
30   /**
31  * @addtogroup dali_adaptor_framework
32  * @{
33  */
34
35 namespace Internal
36 {
37
38 namespace Adaptor
39 {
40 class Widget;
41 }
42
43 }
44
45
46 /**
47  * @brief Widget class is the base class for custom widget.
48  *
49  * To make own Widget, user should inherit this class and its impl class.
50  *
51  * @SINCE_1_3_5
52  */
53 class DALI_ADAPTOR_API Widget : public BaseHandle
54 {
55 public:
56
57   /**
58    * @brief Enumeration class for termination type of widget instance.
59    * @SINCE_1_3_5
60    */
61   enum class Termination
62   {
63     PERMANENT, //< User deleted this widget from the viewer @SINCE_1_3_5
64     TEMPORARY, //< Widget is deleted because of other reasons (e.g. widget process is terminated temporarily by the system) @SINCE_1_3_5
65   };
66
67 public:
68
69   /**
70    * @brief This is the constructor for Widget.
71    * @SINCE_1_3_5
72    * @return A handle to the Widget
73    */
74   static Widget New();
75
76   /**
77    * @brief The default constructor.
78    * @SINCE_1_3_5
79    */
80   Widget();
81
82   /**
83    * @brief Copy Constructor.
84    * @SINCE_1_3_5
85    * @param[in] widget Handle to an object
86    */
87   Widget( const Widget& widget );
88
89   /**
90    * @brief Assignment operator.
91    * @SINCE_1_3_5
92    * @param[in] widget Handle to an object
93    * @return A reference to this
94    */
95   Widget& operator=( const Widget& widget );
96
97   /**
98    * @brief Move constructor.
99    *
100    * @SINCE_1_9.24
101    * @param[in] rhs A reference to the moved handle
102    */
103   Widget( Widget&& rhs );
104
105   /**
106    * @brief Move assignment operator.
107    *
108    * @SINCE_1_9.24
109    * @param[in] rhs A reference to the moved handle
110    * @return A reference to this handle
111    */
112   Widget& operator=( Widget&& rhs );
113
114   /**
115    * @brief Destructor
116    * @SINCE_1_3_5
117    */
118   ~Widget();
119
120 public: // Not intended for application developers
121   explicit Widget(Internal::Adaptor::Widget* widget);
122 };
123
124 /**
125  * @}
126  */
127 } // namespace Dali
128
129 #endif // DALI_WIDGET_H