Revert "[Tizen] Support custom fonts registration"
[platform/core/uifw/dali-adaptor.git] / dali / internal / web-engine-lite / common / web-engine-lite-impl.h
1 #ifndef __DALI_WEBENGINELITE_IMPL_H__
2 #define __DALI_WEBENGINELITE_IMPL_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-object.h>
23
24 // INTERNAL INCLUDES
25 #include <dali/devel-api/adaptor-framework/web-engine-lite.h>
26 #include <dali/devel-api/adaptor-framework/web-engine-lite-plugin.h>
27
28 namespace Dali
29 {
30 class Any;
31
32 namespace Internal
33 {
34
35 namespace Adaptor
36 {
37
38 class WebEngineLite;
39
40 typedef IntrusivePtr< WebEngineLite > WebEngineLitePtr;
41
42 /**
43  * @brief WebEngineLite class is used for Web.
44  */
45 class WebEngineLite: public Dali::BaseObject
46 {
47 public:
48
49   /**
50    * @brief Creates a new WebEngineLite handle
51    *
52    * @return WebEngineLite pointer
53    */
54   static WebEngineLitePtr New();
55
56   /**
57    * @copydoc Dali::WebEngineLite::CreateInstance()
58    */
59   void CreateInstance(int width, int height, int windowX, int windowY, const std::string& locale, const std::string& timezoneID);
60
61   /**
62    * @copydoc Dali::WebEngineLite::DestroyInstance()
63    */
64   void DestroyInstance();
65
66   /**
67    * @copydoc Dali::WebEngineLite::LoadHtml()
68    */
69   void LoadHtml(const std::string& path);
70
71   /**
72    * @copydoc Dali::WebEngineLite::FinishedSignal()
73    */
74   Dali::WebEngineLitePlugin::WebEngineLiteSignalType& FinishedSignal();
75
76   /**
77    * @brief Initializes member data.
78    */
79   void Initialize();
80
81 private:
82
83   /**
84    * @brief Constructor.
85    */
86   WebEngineLite();
87
88   /**
89    * @brief Destructor.
90    */
91   virtual ~WebEngineLite();
92
93   // Undefined copy constructor
94   WebEngineLite( const WebEngineLite& webEngineLite );
95
96   // Undefined assignment operator
97   WebEngineLite& operator=( const WebEngineLite& webEngineLite );
98
99 private:
100
101   Dali::WebEngineLitePlugin* mPlugin; ///< WebEngineLite plugin handle
102   void* mHandle; ///< Handle for the loaded library
103
104   typedef Dali::WebEngineLitePlugin* (*CreateWebEngineLiteFunction)();
105   typedef void (*DestroyWebEngineLiteFunction)( Dali::WebEngineLitePlugin* plugin );
106
107   CreateWebEngineLiteFunction mCreateWebEngineLitePtr;
108   DestroyWebEngineLiteFunction mDestroyWebEngineLitePtr;
109
110   Dali::WebEngineLitePlugin::WebEngineLiteSignalType mFinishedSignal;
111 };
112
113 } // namespace Adaptor
114 } // namespace Internal
115
116 inline static Internal::Adaptor::WebEngineLite& GetImplementation( Dali::WebEngineLite& webEngineLite )
117 {
118   DALI_ASSERT_ALWAYS( webEngineLite && "WebEngineLite handle is empty." );
119
120   BaseObject& handle = webEngineLite.GetBaseObject();
121
122   return static_cast< Internal::Adaptor::WebEngineLite& >( handle );
123 }
124
125 inline static const Internal::Adaptor::WebEngineLite& GetImplementation( const Dali::WebEngineLite& webEngineLite )
126 {
127   DALI_ASSERT_ALWAYS( webEngineLite && "WebEngineLite handle is empty." );
128
129   const BaseObject& handle = webEngineLite.GetBaseObject();
130
131   return static_cast< const Internal::Adaptor::WebEngineLite& >( handle );
132 }
133
134 } // namespace Dali;
135
136 #endif
137