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 <Commons/Deprecated.h>
39 using namespace WrtPlugins::W3C;
41 class PluginLogic : DPL::Noncopyable
45 void initSession(int widgetHandle);
46 void startSession(int widgetHandle,
47 JSGlobalContextRef view,
49 const char* encodedBundle,
52 void stopSession(JSGlobalContextRef context);
54 //TODO im not sure if it is needed. I think it should be hidden
55 void performLibrariesUnload();
56 bool loadPluginOnDemand(const WrtDB::DbPluginHandle &pluginHandle,
57 JavaScriptObject& parentObject,
58 JSGlobalContextRef context);
60 WRT_PLUGINS_DEPRECATED void loadPluginsIntoIframes(
61 JSGlobalContextRef context);
63 void loadFrame(JSGlobalContextRef context);
64 void unloadFrame(JSGlobalContextRef context);
66 // reset custom window properties. (Tizen requirements)
67 WRT_PLUGINS_DEPRECATED void setCustomProperties(double scaleFactor,
68 const char* encodedBundle,
71 void setCustomProperties(JSGlobalContextRef ctx,
73 const char* encodedBundle,
76 WRT_PLUGINS_DEPRECATED void dispatchJavaScriptEvent(
77 CustomEventType eventType);
79 void dispatchJavaScriptEvent(JSGlobalContextRef ctx,
80 CustomEventType eventType,
88 std::unique_ptr<Impl> m_impl;
90 friend class DPL::Singleton<PluginLogic>;
93 typedef DPL::Singleton<PluginLogic> PluginLogicSingleton;
95 #endif // PLUGIN_LOGIC_H