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