summaryrefslogtreecommitdiff
path: root/wearable_src/Common/JSWebAPIError.h
diff options
context:
space:
mode:
Diffstat (limited to 'wearable_src/Common/JSWebAPIError.h')
-rw-r--r--wearable_src/Common/JSWebAPIError.h81
1 files changed, 81 insertions, 0 deletions
diff --git a/wearable_src/Common/JSWebAPIError.h b/wearable_src/Common/JSWebAPIError.h
new file mode 100644
index 0000000..3596a9d
--- /dev/null
+++ b/wearable_src/Common/JSWebAPIError.h
@@ -0,0 +1,81 @@
+//
+// Tizen Web Device API
+// Copyright (c) 2012 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+#ifndef _JS_WEBAPI_ERROR_H_
+#define _JS_WEBAPI_ERROR_H_
+
+#include <JavaScriptCore/JavaScript.h>
+#include "JSWebAPIErrorFactory.h"
+
+#include "WebAPIError.h"
+
+namespace DeviceAPI {
+namespace Common {
+
+class JSWebAPIErrorFactory;
+
+class JSWebAPIError
+{
+public:
+ static JSClassRef getClassRef();
+
+ static const JSClassDefinition* getClassInfo();
+
+ static bool isObjectOfClass(JSContextRef context, JSValueRef value);
+
+ static JSObjectRef constructor(JSContextRef context,
+ JSObjectRef constructor,
+ size_t argumentCount,
+ const JSValueRef arguments[],
+ JSValueRef* exception);
+
+private:
+ static JSObjectRef createJSObject(JSContextRef context, WebAPIError* webapiError);
+
+ static WebAPIError* getPriv(JSContextRef context, JSObjectRef object);
+
+ static void initialize(JSContextRef context, JSObjectRef object);
+
+ static void finalize(JSObjectRef object);
+
+ static JSValueRef getProperty(JSContextRef context,
+ JSObjectRef object,
+ JSStringRef propertyName,
+ JSValueRef* exception);
+
+ static JSValueRef toString(JSContextRef context,
+ JSObjectRef object,
+ JSObjectRef thisObject,
+ size_t argumentCount,
+ const JSValueRef arguments[],
+ JSValueRef* exception);
+
+ static JSClassDefinition m_classInfo;
+
+ static JSStaticValue m_properties[];
+
+ static JSClassRef m_classRef;
+
+ static JSStaticFunction m_function[];
+
+ friend class JSWebAPIErrorFactory;
+};
+
+} // Common
+} // DeviceAPI
+
+#endif // _JS_WEBAPI_ERROR_H_