Beta merge 2
[profile/ivi/wrt-plugins-tizen.git] / src / standards / Tizen / NFC / JSNdefRecordArray.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 WRTPLUGINS_TIZEN_JS_NDEFRECORD_ARRAY_H_
18 #define WRTPLUGINS_TIZEN_JS_NDEFRECORD_ARRAY_H_
19
20 #include <JavaScriptCore/JavaScript.h>
21 #include <CommonsJavaScript/PrivateObject.h>
22 #include <API/NFC/INdefMessage.h>
23
24 namespace TizenApis {
25 namespace Tizen1_0 {
26
27 class JSNdefRecordArray
28 {
29   public:
30
31     static const JSClassDefinition* getClassInfo();
32
33     static JSClassRef getClassRef();
34
35     static JSObjectRef createArray(JSContextRef context,
36             const Api::NFC::INdefMessagePtr &recordArray);
37
38         static bool isObjectOfClass(JSContextRef context, JSValueRef value);
39
40         static Api::NFC::INdefMessagePtr 
41                 getNdefRecordArray(JSContextRef context, JSValueRef value);
42
43   private:
44
45     /**
46      * The callback invoked when an object is first created.
47      */
48     static void initialize(JSContextRef context,
49             JSObjectRef object);
50
51     /**
52      * The callback invoked when an object is finalized.
53      */
54     static void finalize(JSObjectRef object);
55
56     static JSValueRef getLength(JSContextRef context,
57             JSObjectRef object,
58             JSStringRef propertyName,
59             JSValueRef* exception);
60
61     static bool hasProperty(JSContextRef context,
62             JSObjectRef object,
63             JSStringRef propertyName);
64
65     static JSValueRef getProperty(JSContextRef context,
66             JSObjectRef object,
67             JSStringRef propertyName,
68             JSValueRef* exception);
69
70     static bool setProperty(JSContextRef context,
71             JSObjectRef object,
72             JSStringRef propertyName,
73             JSValueRef value,
74             JSValueRef* exception);
75     static JSValueRef concat(JSContextRef context,
76             JSObjectRef function,
77             JSObjectRef thisObject,
78             size_t argumentCount,
79             const JSValueRef arguments[],
80             JSValueRef* exception);
81     static JSValueRef join(JSContextRef context,
82             JSObjectRef function,
83             JSObjectRef thisObject,
84             size_t argumentCount,
85             const JSValueRef arguments[],
86             JSValueRef* exception);
87     static JSValueRef pop(JSContextRef context,
88             JSObjectRef function,
89             JSObjectRef thisObject,
90             size_t argumentCount,
91             const JSValueRef arguments[],
92             JSValueRef* exception);
93     static JSValueRef push(JSContextRef context,
94             JSObjectRef function,
95             JSObjectRef thisObject,
96             size_t argumentCount,
97             const JSValueRef arguments[],
98             JSValueRef* exception);
99     static JSValueRef reverse(JSContextRef context,
100             JSObjectRef function,
101             JSObjectRef thisObject,
102             size_t argumentCount,
103             const JSValueRef arguments[],
104             JSValueRef* exception);
105     static JSValueRef shift(JSContextRef context,
106             JSObjectRef function,
107             JSObjectRef thisObject,
108             size_t argumentCount,
109             const JSValueRef arguments[],
110             JSValueRef* exception);
111     static JSValueRef slice(JSContextRef context,
112             JSObjectRef function,
113             JSObjectRef thisObject,
114             size_t argumentCount,
115             const JSValueRef arguments[],
116             JSValueRef* exception);
117     static JSValueRef sort(JSContextRef context,
118             JSObjectRef function,
119             JSObjectRef thisObject,
120             size_t argumentCount,
121             const JSValueRef arguments[],
122             JSValueRef* exception);
123     static JSValueRef splice(JSContextRef context,
124             JSObjectRef function,
125             JSObjectRef thisObject,
126             size_t argumentCount,
127             const JSValueRef arguments[],
128             JSValueRef* exception);
129     static JSValueRef toString(JSContextRef context,
130             JSObjectRef function,
131             JSObjectRef thisObject,
132             size_t argumentCount,
133             const JSValueRef arguments[],
134             JSValueRef* exception);
135     static JSValueRef unshift(JSContextRef context,
136             JSObjectRef function,
137             JSObjectRef thisObject,
138             size_t argumentCount,
139             const JSValueRef arguments[],
140             JSValueRef* exception);
141     static JSValueRef valueOf(JSContextRef context,
142             JSObjectRef function,
143             JSObjectRef thisObject,
144             size_t argumentCount,
145             const JSValueRef arguments[],
146             JSValueRef* exception);
147
148     static bool checkValue(const std::string &value);
149     static JSClassRef m_jsClassRef;
150     /**
151      * This structure describes a statically declared function property.
152      */
153     static JSStaticFunction m_function[];
154
155     /**
156      * This structure contains properties and callbacks that define a type of object.
157      */
158     static JSClassDefinition m_classInfo;
159
160     /**
161      * This member variable contains the initialization values for the static properties of this class.
162      * The values are given according to the data structure JSPropertySpec
163      */
164     static JSStaticValue m_property[];
165 };
166 }
167 }
168 #endif