Git Init
[profile/ivi/wrt-plugins-tizen.git] / src / standards / Tizen / Application / JSApplicationServiceReply.h
1 /*
2  * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
3  *
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
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */
16
17 #ifndef TIZENAPIS_TIZEN_JS_APPLICATION_SERVICE_REPLY_H_
18 #define TIZENAPIS_TIZEN_JS_APPLICATION_SERVICE_REPLY_H_
19
20 #include <JavaScriptCore/JavaScript.h>
21 #include <CommonsJavaScript/PrivateObject.h>
22 #include <API/Application/ApplicationServiceReply.h>
23 #include "JSApplicationServiceExtraDataArray.h"
24
25 namespace TizenApis {
26 namespace Tizen1_0 {
27 namespace Application {
28
29 typedef WrtDeviceApis::CommonsJavaScript::PrivateObjectT<Api::Application::ApplicationServiceReplyPtr>::Type JSApplicationServiceReplyPriv;
30
31 class JSApplicationServiceReply {
32 public:
33         static const JSClassDefinition* getClassInfo();
34
35         static const JSClassRef getClassRef();
36
37         /**
38           * create an JSObject for callback function(onAnswerReceived).
39           */
40         static JSObjectRef createJSObject(JSContextRef context,
41                            const Api::Application::ApplicationServiceReplyPtr &appsvc);
42
43         static bool isObjectOfClass(JSContextRef context, JSValueRef value);
44
45         static Api::Application::ApplicationServiceReplyPtr getApplicationServiceReply(JSContextRef context, JSValueRef value);
46         /**
47           * return private data
48           */
49         static Api::Application::ApplicationServiceReplyPtr getPrivateData(JSObjectRef object);
50         
51 private:
52         /**
53          * The callback invoked when an object is first created.
54          */
55         static void initialize(JSContextRef context, JSObjectRef object);
56
57         /**
58          * The callback invoked when an object is finalized.
59          */
60         static void finalize(JSObjectRef object);
61
62     /**
63      * The callback invoked when getting a success property's value.
64      */
65     static JSValueRef getIsSucceed(JSContextRef context,
66             JSObjectRef object,
67             JSStringRef propertyName,
68             JSValueRef* exception);
69
70     /**
71      * The callback invoked when getting a extraData property's value.
72      */
73     static JSValueRef getExtraData(JSContextRef context,
74             JSObjectRef object,
75             JSStringRef propertyName,
76             JSValueRef* exception);
77
78      /**
79      * The callback invoked when an object is used as the target of an 'instanceof' expression.
80      */
81     static bool hasInstance(JSContextRef context,
82             JSObjectRef constructor,
83             JSValueRef possibleInstance,
84             JSValueRef* exception);
85
86     /**
87      * This structure contains properties and callbacks that define a type of object.
88      */
89     static JSClassDefinition m_classInfo;
90
91     /**
92      * This structure describes a statically declared value property.
93      */
94     static JSStaticValue m_property[];
95
96     static JSClassRef m_jsClassRef;
97
98 };
99
100 }
101 }
102 }
103 #endif