Beta merge 2
[profile/ivi/wrt-plugins-tizen.git] / src / standards / Tizen / Log / JSTizenLog.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 /**
19  * @file        JSTizenLog.h
20  * @author      Sang-tai Kim(sangtai.kim@samsung.com)
21  * @version     0.1
22  */
23
24
25 #ifndef _JS_TIZEN_LOG_H_
26 #define _JS_TIZEN_LOG_H_
27
28 #include <JavaScriptCore/JavaScript.h>
29
30 namespace TizenApis {
31 namespace Tizen1_0 {
32
33 class DeviceController;
34
35 /**
36  * @class JSTizenLog
37  * @brief This class is javascript extenstion
38  *
39  */
40 class JSTizenLog
41 {
42 public:
43     static const JSClassDefinition* getClassInfo();
44
45     /**
46      * Gets class definition reference.
47      * @remarks New instance of JSClassRef is created (only once) if none was
48      * @remarks set before.
49      * @return Class reference.
50      */
51     static const JSClassRef getClassRef();
52
53 private:
54     /**
55      * The callback invoked when an object is first created.
56      */
57     static void initialize(JSContextRef context, JSObjectRef object);
58
59     /**
60      * The callback invoked when an object is finalized.
61      */
62     static void finalize(JSObjectRef object);
63
64     /**
65      * This structure describes a statically declared function.
66      */
67     static JSStaticFunction m_function[];
68
69     /**
70      * This structure contains properties and callbacks that define a type of object.
71      */
72     static JSClassDefinition m_classInfo;
73
74     /**
75      * Class definition reference.
76      */
77
78     static JSClassRef m_jsClassRef;
79
80     static JSValueRef logDebug(JSContextRef context,
81                              JSObjectRef object,
82                              JSObjectRef thisObject,
83                              size_t argc,
84                              const JSValueRef argv[],
85                              JSValueRef* exception);
86
87     static JSValueRef logInfo(JSContextRef context,
88                                  JSObjectRef object,
89                                  JSObjectRef thisObject,
90                                  size_t argc,
91                                  const JSValueRef argv[],
92                                  JSValueRef* exception);
93
94     static JSValueRef logWarning(JSContextRef context,
95                                  JSObjectRef object,
96                                  JSObjectRef thisObject,
97                                  size_t argc,
98                                  const JSValueRef argv[],
99                                  JSValueRef* exception);
100
101     static JSValueRef logError(JSContextRef context,
102                                  JSObjectRef object,
103                                  JSObjectRef thisObject,
104                                  size_t argc,
105                                  const JSValueRef argv[],
106                                  JSValueRef* exception);
107
108 };
109
110 }
111
112 }
113
114 #endif //  _JS_TIZEN_LOG_H_