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 JSTIZENEXCEPTION_H_
19 #define JSTIZENEXCEPTION_H_
21 #include <JavaScriptCore/JavaScript.h>
22 #include <CommonsJavaScript/PrivateObject.h>
24 #include "TizenExceptionData.h"
31 * TizenException is deprecated. use JSWebAPIError instead.
33 class JSTizenException {
35 typedef WrtDeviceApis::CommonsJavaScript::PrivateObjectT<TizenExceptionDataPtr>::Type PrivateObject;
38 static const std::string UNKNOWN_ERROR;
39 static const std::string TYPE_MISMATCH_ERROR;
40 static const std::string INVALID_VALUES_ERROR;
41 static const std::string TIMEOUT_ERROR;
42 static const std::string IO_ERROR;
43 static const std::string NOT_SUPPORTED_ERROR;
44 static const std::string PERMISSION_DENIED_ERROR;
45 static const std::string NOT_FOUND_ERROR;
46 static const std::string SERVICE_NOT_AVAILABLE;
47 static const std::string NETWORK_ERROR;
48 static const std::string INVALID_ACCESS_ERROR;
50 static JSClassRef getClassRef();
52 static const JSClassDefinition* getClassInfo();
56 * The callback invoked when an object is first created.
58 static void initialize(JSContextRef context, JSObjectRef object);
61 * The callback invoked when an object is finalized.
63 static void finalize(JSObjectRef object);
66 * The callback invoked when getting a property's value.
68 static bool hasProperty(JSContextRef context, JSObjectRef object, JSStringRef propertyName);
71 * The callback invoked when getting a property's value.
73 static JSValueRef getStaticProperty(JSContextRef context, JSObjectRef object, JSStringRef propertyName, JSValueRef* exception);
76 * The callback invoked when an object is used as the target of an 'instanceof' expression.
78 static bool hasInstance(JSContextRef context, JSObjectRef constructor, JSValueRef possibleInstance, JSValueRef* exception);
81 * This structure contains properties and callbacks that define a type of object.
83 static JSClassDefinition m_classInfo;
86 * This structure describes a statically declared value property.
88 static JSStaticValue m_properties[];
90 static JSClassRef m_classRef;
96 #endif /* JSTIZENEXCEPTION_H_ */