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 JSMediacontentManager
39 static const JSClassDefinition* getClassInfo();
40 static const JSClassRef getClassRef();
45 static JSValueRef getMediacontent(
48 JSObjectRef thisObject,
50 const JSValueRef arguments[],
51 JSValueRef* exception);
53 static IMediacontentManagerPtr getContentManagerPrivObject(
55 const JSObjectRef object,
56 JSValueRef* exception);
60 * The callback invoked when an object is first created.
62 static void initialize(JSContextRef context, JSObjectRef object);
65 * The callback invoked when an object is finalized.
67 static void finalize(JSObjectRef object);
72 * The callback invoked when getting a property's value.
74 static JSValueRef getProperty(
77 JSStringRef propertyName,
78 JSValueRef* exception);
81 * The callback invoked when an object is used as the target of an 'instanceof' expression.
83 static bool hasInstance(
85 JSObjectRef constructor,
86 JSValueRef possibleInstance,
87 JSValueRef* exception);
90 static JSValueRef getFolders(
93 JSObjectRef thisObject,
95 const JSValueRef arguments[],
96 JSValueRef* exception);
98 static JSValueRef updateItem(
101 JSObjectRef thisObject,
102 size_t argumentCount,
103 const JSValueRef arguments[],
104 JSValueRef* exception);
106 static JSValueRef updateItemsBatch(
107 JSContextRef context,
109 JSObjectRef thisObject,
110 size_t argumentCount,
111 const JSValueRef arguments[],
112 JSValueRef* exception);
115 static JSValueRef findItems(
116 JSContextRef context,
118 JSObjectRef thisObject,
119 size_t argumentCount,
120 const JSValueRef arguments[],
121 JSValueRef* exception);
123 static JSValueRef scanFile(
124 JSContextRef context,
126 JSObjectRef thisObject,
127 size_t argumentCount,
128 const JSValueRef arguments[],
129 JSValueRef* exception);
131 static JSValueRef setChangeListener(
132 JSContextRef context,
134 JSObjectRef thisObject,
135 size_t argumentCount,
136 const JSValueRef arguments[],
137 JSValueRef* exception);
139 static JSValueRef unsetChangeListener(
140 JSContextRef context,
142 JSObjectRef thisObject,
143 size_t argumentCount,
144 const JSValueRef arguments[],
145 JSValueRef* exception);
148 static JSValueRef updateMetadata(
149 JSContextRef context,
151 JSObjectRef thisObject,
152 size_t argumentCount,
153 const JSValueRef arguments[],
154 JSValueRef* exception);
158 * This structure contains properties and callbacks that define a type of object.
160 static JSClassDefinition m_classInfo;
161 static JSStaticFunction m_function[];
164 * This structure describes a statically declared value property.
166 static JSStaticValue m_property[];
168 static JSClassRef m_jsClassRef;
174 #endif //_JS_TIZEN_CONTENTMANAGER_H_