[Tizen] Implement WebViewLite interface
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / devel-api / controls / web-view-lite / web-view-lite.h
1 #ifndef __DALI_TOOLKIT_WEB_VIEW_LITE_H__
2 #define __DALI_TOOLKIT_WEB_VIEW_LITE_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 // INTERNAL INCLUDES
22 #include <dali-toolkit/public-api/controls/control.h>
23
24 namespace Dali
25 {
26
27 namespace Toolkit
28 {
29
30 namespace Internal DALI_INTERNAL
31 {
32   class WebViewLite;
33 } // namespace Internal
34
35 class DALI_IMPORT_API WebViewLite: public Control
36 {
37 public:
38
39   typedef Signal< void (WebViewLite&) > WebViewLiteSignalType;
40
41 public:
42
43   /**
44    * @brief Creates an initialized WebViewLite.
45    *
46    * @return A handle to a newly allocated Dali WebViewLite
47    *
48    * @note WebViewLite will not display anything
49    */
50   static WebViewLite New();
51
52   /**
53    * @brief Creates an uninitialized WebViewLite.
54    */
55   WebViewLite();
56
57   /**
58    * @brief Destructor.
59    *
60    * This is non-virtual since derived Handel types must not contain data or virtual methods.
61    */
62   ~WebViewLite();
63
64   /*
65    * @brief Copy constructor.
66    *
67    * @param[in] webViewLite WebViewLite to copy. The copied WebViewLite will point at the same implementation
68    */
69   WebViewLite( const WebViewLite& webViewLite );
70
71   /**
72    * @brief Assignment operator.
73    *
74    * @param[in] webViewLite The WebViewLite to assign from
75    * @return The updated WebViewLite
76    */
77   WebViewLite& operator=( const WebViewLite& webViewLite );
78
79   /**
80    * @brief Downcasts a handle to WebViewLite handle.
81    *
82    * If handle points to a WebViewLite, the downcast produces valid handle.
83    * If not, the returned handle is left uninitialized.
84    *
85    * @param[in] handle Handle to an object
86    * @return Handle to a WebViewLite or an uninitialized handle
87    */
88   static WebViewLite DownCast( BaseHandle handle );
89
90   /**
91    * @brief Creates an internal web view instance (e.g. minimized web engine instance)
92    *
93    * @param [in] width The width of Web
94    * @param [in] height The height of Web
95    * @param [in] windowX The x position of window
96    * @param [in] windowY The y position of window
97    * @param [in] locale The locale of Web
98    * @param [in] timezoneID The timezoneID of Web
99    */
100   void CreateInstance(int width, int height, int windowX, int windowY, const std::string& locale, const std::string& timezoneID);
101
102   /**
103    * @brief Destroys an internal web view instance (e.g. minimized web engine instance)
104    */
105   void DestroyInstance();
106
107   /**
108    * @brief Loads a html file
109    *
110    * @param [in] path The path of Web
111    */
112   void LoadHtml(const std::string& path);
113
114   /**
115    * @brief Connects to this signal to be notified when a web view is finished.
116    *
117    * @return A signal object to connect with
118    */
119   WebViewLiteSignalType& FinishedSignal();
120
121 public: // Not intended for application developers
122
123   /// @cond internal
124   /**
125    * @brief Creates a handle using the Toolkit::Internal implementation.
126    *
127    * @param[in] implementation The WebViewLite implementation
128    */
129   DALI_INTERNAL WebViewLite( Internal::WebViewLite& implementation );
130
131   /**
132    * @brief Allows the creation of this WebViewLite from an Internal::CustomActor pointer.
133    *
134    * @param[in] internal A pointer to the internal CustomActor
135    */
136   DALI_INTERNAL WebViewLite( Dali::Internal::CustomActor* internal );
137   /// @endcond
138
139 };
140
141 /**
142  * @}
143  */
144
145 } // namespace Toolkit
146
147 } // namespace Dali
148
149 #endif // __DALI_TOOLKIT_WEB_VIEW_LITE_H__