Update change log and spec for wrt-plugins-tizen_0.4.13
[framework/web/wrt-plugins-tizen.git] / src / Common / JSTizenException.h
1 //
2 // Tizen Web Device API
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 //
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
8 //
9 // http://www.apache.org/licenses/LICENSE-2.0
10 //
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.
16 //
17
18 #ifndef JSTIZENEXCEPTION_H_
19 #define JSTIZENEXCEPTION_H_
20
21 #include <JavaScriptCore/JavaScript.h>
22 #include <CommonsJavaScript/PrivateObject.h>
23
24 #include "TizenExceptionData.h"
25
26 namespace DeviceAPI {
27 namespace Common {
28
29                 /**
30                  * @deprecated
31                  * TizenException is deprecated. use JSWebAPIError instead.
32                 */
33                 class JSTizenException {
34                         public:
35                                 typedef  WrtDeviceApis::CommonsJavaScript::PrivateObjectT<TizenExceptionDataPtr>::Type PrivateObject;
36
37                         public:
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;
49                           public:
50                                 static JSClassRef getClassRef();
51
52                                 static const JSClassDefinition* getClassInfo();
53
54                         private:
55                                 /**
56                                  * The callback invoked when an object is first created.
57                                  */
58                                 static void initialize(JSContextRef context, JSObjectRef object);
59
60                                 /**
61                                  * The callback invoked when an object is finalized.
62                                  */
63                                 static void finalize(JSObjectRef object);
64
65                                 /**
66                                  * The callback invoked when getting a property's value.
67                                  */
68                                 static bool hasProperty(JSContextRef context, JSObjectRef object, JSStringRef propertyName);
69
70                                 /**
71                                  * The callback invoked when getting a property's value.
72                                  */
73                                 static JSValueRef getStaticProperty(JSContextRef context, JSObjectRef object, JSStringRef propertyName, JSValueRef* exception);
74
75                                 /**
76                                  * The callback invoked when an object is used as the target of an 'instanceof' expression.
77                                  */
78                                 static bool hasInstance(JSContextRef context, JSObjectRef constructor, JSValueRef possibleInstance, JSValueRef* exception);
79
80                                 /**
81                                  * This structure contains properties and callbacks that define a type of object.
82                                  */
83                                 static JSClassDefinition m_classInfo;
84
85                                 /**
86                                  * This structure describes a statically declared value property.
87                                  */
88                                 static JSStaticValue m_properties[];
89
90                                 static JSClassRef m_classRef;
91                 };
92
93 }// Common
94 }// DeviceAPI
95
96 #endif /* JSTIZENEXCEPTION_H_ */