Update change log and spec for wrt-plugins-tizen_0.4.70
[framework/web/wrt-plugins-tizen.git] / src / Content / JSContentManager.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
19 #ifndef _JS_TIZEN_CONTENTMANAGER_H_
20 #define _JS_TIZEN_CONTENTMANAGER_H_
21
22 #include <JavaScriptCore/JavaScript.h>
23 #include <CommonsJavaScript/PrivateObject.h>
24 #include <CommonsJavaScript/JSCallbackManager.h>
25 #include "IContentManager.h"
26
27 using namespace WrtDeviceApis::Commons;
28 using namespace WrtDeviceApis::CommonsJavaScript;
29
30
31 namespace DeviceAPI {
32 namespace Content {
33
34 typedef PrivateObject<IMediacontentManagerPtr, NoOwnership> MediacontentManagerPrivObject;
35
36 class MediacontentManagerPriv :
37         public MediacontentManagerPrivObject,
38         public DeviceAPI::Common::SecurityAccessor
39 {
40 public:
41         MediacontentManagerPriv(JSContextRef context, IMediacontentManagerPtr contentManager) :
42                 MediacontentManagerPrivObject(context, contentManager),
43                 DeviceAPI::Common::SecurityAccessor()
44         {
45         }
46
47         virtual ~MediacontentManagerPriv()
48         {
49         }
50 };
51
52 class JSMediacontentManager 
53 {
54 public:
55         static const JSClassDefinition* getClassInfo();
56         static const JSClassRef getClassRef();
57
58 private:
59
60 /*
61 static JSValueRef getMediacontent(
62                                         JSContextRef context,
63                                         JSObjectRef object,
64                                         JSObjectRef thisObject,
65                                         size_t argumentCount,
66                                         const JSValueRef arguments[],
67                                         JSValueRef* exception);
68 */
69         static IMediacontentManagerPtr getContentManagerPrivObject(
70                         JSContextRef ctx,
71                         const JSObjectRef object,
72                         JSValueRef* exception);
73
74             
75         /**
76          * The callback invoked when an object is first created.
77          */
78         static void initialize(JSContextRef context, JSObjectRef object);
79
80         /**
81          * The callback invoked when an object is finalized.
82          */
83         static void finalize(JSObjectRef object);
84
85
86
87         /**
88          * The callback invoked when getting a property's value.
89          */
90         static JSValueRef getProperty(
91                         JSContextRef context,
92                         JSObjectRef object,
93                         JSStringRef propertyName,
94                         JSValueRef* exception);
95
96         /**
97          * The callback invoked when an object is used as the target of an 'instanceof' expression.
98          */
99         static bool hasInstance(
100                         JSContextRef context,
101                         JSObjectRef constructor,
102                         JSValueRef possibleInstance,
103                         JSValueRef* exception);
104
105
106         static JSValueRef getFolders(
107                         JSContextRef context,
108                         JSObjectRef object,
109                         JSObjectRef thisObject,
110                         size_t argumentCount,
111                         const JSValueRef arguments[],
112                         JSValueRef* exception);
113
114         static JSValueRef updateItem(
115                         JSContextRef context,
116                         JSObjectRef object,
117                         JSObjectRef thisObject,
118                         size_t argumentCount,
119                         const JSValueRef arguments[],
120                         JSValueRef* exception);
121
122         static JSValueRef updateItemsBatch(
123                         JSContextRef context,
124                         JSObjectRef object,
125                         JSObjectRef thisObject,
126                         size_t argumentCount,
127                         const JSValueRef arguments[],
128                         JSValueRef* exception);
129
130
131         static JSValueRef findItems(
132                         JSContextRef context,
133                         JSObjectRef object,
134                         JSObjectRef thisObject,
135                         size_t argumentCount,
136                         const JSValueRef arguments[],
137                         JSValueRef* exception);
138
139         static JSValueRef scanFile(
140                         JSContextRef context,
141                         JSObjectRef object,
142                         JSObjectRef thisObject,
143                         size_t argumentCount,
144                         const JSValueRef arguments[],
145                         JSValueRef* exception);
146
147         static JSValueRef setChangeListener(
148                         JSContextRef context,
149                         JSObjectRef object,
150                         JSObjectRef thisObject,
151                         size_t argumentCount,
152                         const JSValueRef arguments[],
153                         JSValueRef* exception);
154
155         static JSValueRef unsetChangeListener(
156                         JSContextRef context,
157                         JSObjectRef object,
158                         JSObjectRef thisObject,
159                         size_t argumentCount,
160                         const JSValueRef arguments[],
161                         JSValueRef* exception);
162
163
164         /**
165          * This structure contains properties and callbacks that define a type of object.
166          */
167         static JSClassDefinition m_classInfo;
168         static JSStaticFunction m_function[];
169
170         /**
171          * This structure describes a statically declared value property.
172          */
173         static JSStaticValue m_property[];
174
175         static JSClassRef m_jsClassRef;
176 };
177
178 }
179 }
180
181 #endif //_JS_TIZEN_CONTENTMANAGER_H_
182