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