2 // Tizen Web Device API
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
9 // http://www.apache.org/licenses/LICENSE-2.0
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
18 #ifndef _JS_WEBAPI_ERROR_H_
19 #define _JS_WEBAPI_ERROR_H_
21 #include <JavaScriptCore/JavaScript.h>
22 #include "JSWebAPIErrorFactory.h"
24 #include "WebAPIError.h"
29 class JSWebAPIErrorFactory;
33 static JSClassRef getClassRef();
35 static const JSClassDefinition* getClassInfo();
37 static bool isObjectOfClass(JSContextRef context, JSValueRef value);
39 static JSObjectRef constructor(JSContextRef context,
40 JSObjectRef constructor,
42 const JSValueRef arguments[],
43 JSValueRef* exception);
46 static JSObjectRef createJSObject(JSContextRef context,
47 WebAPIError* webapiError);
49 static WebAPIError* getPriv(JSContextRef context, JSObjectRef object);
51 static void initialize(JSContextRef context, JSObjectRef object);
53 static void finalize(JSObjectRef object);
55 static JSValueRef getProperty(JSContextRef context,
57 JSStringRef propertyName,
58 JSValueRef* exception);
60 static JSValueRef toString(JSContextRef context,
62 JSObjectRef thisObject,
64 const JSValueRef arguments[],
65 JSValueRef* exception);
67 static JSClassDefinition m_classInfo;
69 static JSStaticValue m_properties[];
71 static JSClassRef m_classRef;
73 static JSStaticFunction m_function[];
75 friend class JSWebAPIErrorFactory;
81 #endif // _JS_WEBAPI_ERROR_H_