upload tizen1.0 source
[framework/web/wrt-plugins-common.git] / src / standards / W3C / Widget / JSTest.h
1 /*
2  * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
3  *
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
7  *
8  *        http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */
16 /**
17  *
18  * @file       JSTest.h
19  * @author     Zbigniew Kostrzewa (z.kostrzewa@samsung.com)
20  * @version    0.1
21  * @brief
22  */
23
24 #ifndef WRT_PLUGIN_JS_WIDGET_TEST_H_
25 #define WRT_PLUGIN_JS_WIDGET_TEST_H_
26
27 #include <JavaScriptCore/JavaScript.h>
28
29 namespace WrtPlugins {
30 namespace W3C {
31
32 class Test;
33
34 class JSTest {
35   public:
36     static const JSClassRef getClassRef();
37
38     static const JSClassDefinition* getClassInfo();
39
40   private:
41     static void initialize(JSContextRef context, JSObjectRef object);
42
43     static void finalize(JSObjectRef object);
44
45     static JSClassDefinition m_classInfo;
46
47     static JSStaticFunction m_functions[];
48
49     static JSClassRef m_jsClassRef;
50
51     static JSValueRef setEvaluator(JSContextRef context,
52                                    JSObjectRef object,
53                                    JSObjectRef thisObject,
54                                    size_t argumentCount,
55                                    const JSValueRef arguments[],
56                                    JSValueRef* exception);
57
58     static JSValueRef run(JSContextRef context,
59                           JSObjectRef object,
60                           JSObjectRef thisObject,
61                           size_t argumentCount,
62                           const JSValueRef arguments[],
63                           JSValueRef* exception);
64
65     static Test* getPrivateObject(JSObjectRef thisObject);
66 };
67
68 }
69 }
70
71 #endif