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.
18 * @author Grzegorz Krawczyk (g.krawczyk@samgsung.com)
23 #ifndef WRT_SRC_PLUGIN_SERVICE_EXPLORER_H_
24 #define WRT_SRC_PLUGIN_SERVICE_EXPLORER_H_
28 #include <dpl/noncopyable.h>
29 #include <dpl/exception.h>
30 #include <dpl/shared_ptr.h>
32 #include <Commons/JSObject.h>
33 #include <Commons/JSObjectDeclaration.h>
35 #include "javascript_interface.h"
36 #include "plugin_iframe_support.h"
37 #include "plugin_property_support.h"
40 #include <js_overlay_types.h>
42 using namespace PluginModule;
43 using namespace WrtPlugins::W3C;
45 class Explorer : private DPL::Noncopyable
48 explicit Explorer(JSGlobalContextRef context);
51 //register to global frame
52 bool registerObject(const JSObjectDeclarationPtr& declaration,
53 JSGlobalContextRef context);
55 bool registerObject (const JSObjectDeclarationPtr& declaration,
56 const std::string& parentObjectName,
57 JSObjectPtr parentObject,
58 JSGlobalContextRef context);
60 void deregisterObject(const JSObjectDeclarationPtr& declaration);
62 // new load/unload frame API
63 void loadFrame(JSGlobalContextRef context);
64 void unloadFrame(JSGlobalContextRef context);
66 void removePluginsFromIframes();
67 void cleanIframesData();
68 void callEventListeners(CustomEventType eventType, void* data);
70 WindowPropertySupport* getWindowPropertySupport();
74 IframesSupport m_iframeSupport;
77 JSGlobalContextRef m_context;
79 //global object of main frame
80 JSObjectPtr m_globalObject;
82 std::unique_ptr<WindowPropertySupport> m_propertySupport;
85 void registerObjectIntoIframe(const JSObjectDeclarationPtr& declaration,
86 JSObjectPtr parentObject,
87 JSGlobalContextRef context);
89 bool register_(const JSObjectDeclarationPtr& declaration,
91 JSGlobalContextRef context);
94 JSObjectPtr getJSObjectProperty(const std::string& propertyName,
97 JSObjectPtr getProperty(
98 const std::string& requestedProperty,
99 JSObjectPtr providedObject);
102 typedef DPL::SharedPtr<Explorer> ExplorerPtr;