2 // Tizen Web Device API
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
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
9 // http://www.apache.org/licenses/LICENSE-2.0
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.
19 #ifndef _JS_TIZEN_CONTENTMANAGER_H_
20 #define _JS_TIZEN_CONTENTMANAGER_H_
22 #include <JavaScriptCore/JavaScript.h>
23 #include <CommonsJavaScript/PrivateObject.h>
24 #include <CommonsJavaScript/JSCallbackManager.h>
25 #include "IContentManager.h"
27 using namespace WrtDeviceApis::Commons;
28 using namespace WrtDeviceApis::CommonsJavaScript;
34 typedef PrivateObject<IMediacontentManagerPtr, NoOwnership> MediacontentManagerPrivObject;
36 class MediacontentManagerPriv :
37 public MediacontentManagerPrivObject,
38 public DeviceAPI::Common::SecurityAccessor
41 MediacontentManagerPriv(JSContextRef context, IMediacontentManagerPtr contentManager) :
42 MediacontentManagerPrivObject(context, contentManager),
43 DeviceAPI::Common::SecurityAccessor()
47 virtual ~MediacontentManagerPriv()
52 class JSMediacontentManager
55 static const JSClassDefinition* getClassInfo();
56 static const JSClassRef getClassRef();
61 static JSValueRef getMediacontent(
64 JSObjectRef thisObject,
66 const JSValueRef arguments[],
67 JSValueRef* exception);
69 static IMediacontentManagerPtr getContentManagerPrivObject(
71 const JSObjectRef object,
72 JSValueRef* exception);
76 * The callback invoked when an object is first created.
78 static void initialize(JSContextRef context, JSObjectRef object);
81 * The callback invoked when an object is finalized.
83 static void finalize(JSObjectRef object);
88 * The callback invoked when getting a property's value.
90 static JSValueRef getProperty(
93 JSStringRef propertyName,
94 JSValueRef* exception);
97 * The callback invoked when an object is used as the target of an 'instanceof' expression.
99 static bool hasInstance(
100 JSContextRef context,
101 JSObjectRef constructor,
102 JSValueRef possibleInstance,
103 JSValueRef* exception);
106 static JSValueRef getFolders(
107 JSContextRef context,
109 JSObjectRef thisObject,
110 size_t argumentCount,
111 const JSValueRef arguments[],
112 JSValueRef* exception);
114 static JSValueRef updateItem(
115 JSContextRef context,
117 JSObjectRef thisObject,
118 size_t argumentCount,
119 const JSValueRef arguments[],
120 JSValueRef* exception);
122 static JSValueRef updateItemsBatch(
123 JSContextRef context,
125 JSObjectRef thisObject,
126 size_t argumentCount,
127 const JSValueRef arguments[],
128 JSValueRef* exception);
131 static JSValueRef findItems(
132 JSContextRef context,
134 JSObjectRef thisObject,
135 size_t argumentCount,
136 const JSValueRef arguments[],
137 JSValueRef* exception);
139 static JSValueRef scanFile(
140 JSContextRef context,
142 JSObjectRef thisObject,
143 size_t argumentCount,
144 const JSValueRef arguments[],
145 JSValueRef* exception);
147 static JSValueRef setChangeListener(
148 JSContextRef context,
150 JSObjectRef thisObject,
151 size_t argumentCount,
152 const JSValueRef arguments[],
153 JSValueRef* exception);
155 static JSValueRef unsetChangeListener(
156 JSContextRef context,
158 JSObjectRef thisObject,
159 size_t argumentCount,
160 const JSValueRef arguments[],
161 JSValueRef* exception);
165 * This structure contains properties and callbacks that define a type of object.
167 static JSClassDefinition m_classInfo;
168 static JSStaticFunction m_function[];
171 * This structure describes a statically declared value property.
173 static JSStaticValue m_property[];
175 static JSClassRef m_jsClassRef;
181 #endif //_JS_TIZEN_CONTENTMANAGER_H_