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 TIZENAPIS_TIZEN_JS_APPLICATION_SERVICE_REPLY_H_
18 #define TIZENAPIS_TIZEN_JS_APPLICATION_SERVICE_REPLY_H_
20 #include <JavaScriptCore/JavaScript.h>
21 #include <CommonsJavaScript/PrivateObject.h>
22 #include <API/Application/ApplicationServiceReply.h>
23 #include "JSApplicationServiceExtraDataArray.h"
27 namespace Application {
29 typedef WrtDeviceApis::CommonsJavaScript::PrivateObjectT<Api::Application::ApplicationServiceReplyPtr>::Type JSApplicationServiceReplyPriv;
31 class JSApplicationServiceReply {
33 static const JSClassDefinition* getClassInfo();
35 static const JSClassRef getClassRef();
38 * create an JSObject for callback function(onAnswerReceived).
40 static JSObjectRef createJSObject(JSContextRef context,
41 const Api::Application::ApplicationServiceReplyPtr &appsvc);
43 static bool isObjectOfClass(JSContextRef context, JSValueRef value);
45 static Api::Application::ApplicationServiceReplyPtr getApplicationServiceReply(JSContextRef context, JSValueRef value);
49 static Api::Application::ApplicationServiceReplyPtr getPrivateData(JSObjectRef object);
53 * The callback invoked when an object is first created.
55 static void initialize(JSContextRef context, JSObjectRef object);
58 * The callback invoked when an object is finalized.
60 static void finalize(JSObjectRef object);
63 * The callback invoked when getting a success property's value.
65 static JSValueRef getIsSucceed(JSContextRef context,
67 JSStringRef propertyName,
68 JSValueRef* exception);
71 * The callback invoked when getting a extraData property's value.
73 static JSValueRef getExtraData(JSContextRef context,
75 JSStringRef propertyName,
76 JSValueRef* exception);
79 * The callback invoked when an object is used as the target of an 'instanceof' expression.
81 static bool hasInstance(JSContextRef context,
82 JSObjectRef constructor,
83 JSValueRef possibleInstance,
84 JSValueRef* exception);
87 * This structure contains properties and callbacks that define a type of object.
89 static JSClassDefinition m_classInfo;
92 * This structure describes a statically declared value property.
94 static JSStaticValue m_property[];
96 static JSClassRef m_jsClassRef;