2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 * @file plugin_logic.h
18 * @author Piotr Fatyga (p.fatyga@samsung.com)
19 * @author Grzegorz Krawczyk (g.krawczyk@samsung.com)
20 * @author Przemyslaw Dobrowolski (p.dobrowolsk@samsung.com)
22 * @brief This file is the implementation file of plugin and feature
24 * @brief This code is intended to work behind view controller
26 #ifndef PLUGIN_LOGIC_H
27 #define PLUGIN_LOGIC_H
32 #include <dpl/singleton.h>
33 #include <dpl/noncopyable.h>
34 #include <dpl/wrt-dao-ro/plugin_dao_read_only.h>
35 #include <js_overlay_types.h>
37 #include <dpl/availability.h>
38 #include <dpl/wrt-dao-ro/wrt_db_types.h>
40 using namespace WrtPlugins::W3C;
42 class PluginLogic : DPL::Noncopyable
46 void initSession(WidgetHandle widgetHandle);
47 void startSession(WidgetHandle widgetHandle,
48 JSGlobalContextRef view,
50 const char* encodedBundle,
53 void stopSession(JSGlobalContextRef context);
55 //TODO im not sure if it is needed. I think it should be hidden
56 void performLibrariesUnload();
57 bool loadPluginOnDemand(const WrtDB::DbPluginHandle &pluginHandle,
58 JavaScriptObject& parentObject,
59 JSGlobalContextRef context);
61 DPL_DEPRECATED void loadPluginsIntoIframes(JSGlobalContextRef context);
63 void loadFrame(JSGlobalContextRef context);
64 void unloadFrame(JSGlobalContextRef context);
66 // reset custom window properties. (Tizen requirements)
67 DPL_DEPRECATED void setCustomProperties(double scaleFactor,
68 const char* encodedBundle,
71 void setCustomProperties(JSGlobalContextRef ctx,
73 const char* encodedBundle,
76 DPL_DEPRECATED void dispatchJavaScriptEvent(CustomEventType eventType);
78 void dispatchJavaScriptEvent(JSGlobalContextRef ctx,
79 CustomEventType eventType,
82 unsigned int windowHandle() const;
83 void setWindowHandle(unsigned int handle);
90 std::unique_ptr<Impl> m_impl;
92 friend class DPL::Singleton<PluginLogic>;
95 typedef DPL::Singleton<PluginLogic> PluginLogicSingleton;
97 #endif // PLUGIN_LOGIC_H