tizen 2.4 release
[framework/web/wrt-plugins-common.git] / src / xwalk-module / js_utils.h
1 // Copyright 2015 Samsung Electronics Co, Ltd. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef WRT_XWALK_JS_UTILS_H_
6 #define WRT_XWALK_JS_UTILS_H_
7
8 #include <string>
9 #include <EWebKit.h>
10 #include <EWebKit_internal.h>
11 #include <JavaScriptCore/JavaScript.h>
12
13
14 namespace wrt {
15 namespace JsUtils {
16
17 JSValueRef ToJSValueRef(JSContextRef ctx, const std::string& str);
18 void SetProperty(JSContextRef ctx , JSObjectRef object, const char *name, JSValueRef value, JSPropertyAttributes attributes, JSValueRef *exception);
19 void DeleteProperty(JSContextRef ctx , JSObjectRef object, const char *name, JSValueRef *exception);
20 JSValueRef GetProperty(JSContextRef ctx , JSObjectRef object, const char *name, JSValueRef *exception);
21 std::string JSValueToString(JSContextRef ctx, JSValueRef value);
22 std::string ExceptionToString(JSContextRef ctx, JSValueRef exception);
23 JSValueRef RunString(JSContextRef ctx, const std::string& code,std::string* exception);
24
25
26 }
27 }
28
29
30 #endif