2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 #ifndef JSTIZENEXCEPTION_H_
18 #define JSTIZENEXCEPTION_H_
20 #include <JavaScriptCore/JavaScript.h>
21 #include <CommonsJavaScript/PrivateObject.h>
23 #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;
49 static JSClassRef getClassRef();
51 static const JSClassDefinition* getClassInfo();
55 * The callback invoked when an object is first created.
57 static void initialize(JSContextRef context, JSObjectRef object);
60 * The callback invoked when an object is finalized.
62 static void finalize(JSObjectRef object);
65 * The callback invoked when getting a property's value.
67 static bool hasProperty(JSContextRef context, JSObjectRef object, JSStringRef propertyName);
70 * The callback invoked when getting a property's value.
72 static JSValueRef getStaticProperty(JSContextRef context, JSObjectRef object, JSStringRef propertyName, JSValueRef* exception);
75 * The callback invoked when an object is used as the target of an 'instanceof' expression.
77 static bool hasInstance(JSContextRef context, JSObjectRef constructor, JSValueRef possibleInstance, JSValueRef* exception);
80 * This structure contains properties and callbacks that define a type of object.
82 static JSClassDefinition m_classInfo;
85 * This structure describes a statically declared value property.
87 static JSStaticValue m_properties[];
89 static JSClassRef m_classRef;
96 #endif /* JSTIZENEXCEPTION_H_ */