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_iframe_support.h
22 #ifndef _WRTENGINE_SRC_PLUGINSERVICE_IFRAME_SUPPORT_H_
23 #define _WRTENGINE_SRC_PLUGINSERVICE_IFRAME_SUPPORT_H_
27 #include <Commons/JSObjectDeclaration.h>
28 #include <Commons/JSObject.h>
29 #include "javascript_interface.h"
34 typedef std::list<JSObjectDeclarationPtr> DeclarationsList;
37 void registerDeclaration(const JSObjectDeclarationPtr& declaration);
39 void registerIframe(const JSObjectPtr& iframe);
41 void unregisterIframe(const JSObjectPtr& iframe);
43 DeclarationsList getIframeObjects() const;
45 bool hasIframes() const;
50 std::list<JSObjectDeclarationPtr> m_iframesObjects;
51 std::set<JSObjectPtr> m_loadedIframes;
53 // used to find matching object from m_loadedIframes
54 struct EqualToJSObjectPtr
56 typedef JSObjectPtr first_argument_type;
57 typedef JSObjectPtr second_argument_type;
58 typedef bool result_type;
60 result_type operator()(const first_argument_type &s1,
61 const second_argument_type &s2) const
63 return (s1->getObject() == s2->getObject());