2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
19 #ifndef _JS_TIZEN_MEDIA_H_
20 #define _JS_TIZEN_MEDIA_H_
22 #include <JavaScriptCore/JavaScript.h>
23 #include <CommonsJavaScript/PrivateObject.h>
24 #include <API/Mediacontent/MediacontentMedia.h>
27 using namespace TizenApis::Api::Mediacontent;
28 using namespace WrtDeviceApis::Commons;
29 using namespace WrtDeviceApis::CommonsJavaScript;
33 namespace Mediacontent {
35 typedef PrivateObject<Api::Mediacontent::MediacontentMediaPtr, NoOwnership> MediaPrivObject;
41 static const JSClassDefinition* getClassInfo();
43 static const JSClassRef getClassRef();
45 static Api::Mediacontent::MediacontentMediaPtr getMediaObject(JSObjectRef object);
49 * This member variable contains the values which has to be passed when
50 * the this class is embedded into JS Engine.
52 static JSClassDefinition m_classInfo;
55 * This structure describes a statically declared function property.
57 static JSStaticFunction m_function[];
60 * This member variable contains the initialization values for the
61 * properties of this class. The values are given according to the
62 * data structure JSPropertySpec.
64 static JSStaticValue m_property[];
66 static JSClassRef m_jsClassRef;
69 * The callback invoked when an object is first created.
71 static void initialize(JSContextRef context, JSObjectRef object);
74 * The callback invoked when an object is finalized.
76 static void finalize(JSObjectRef object);
81 * Getters and setters for properties
83 static JSValueRef getPropertyId(
86 JSStringRef propertyName,
87 JSValueRef* exception);
89 static JSValueRef getPropertyType(
92 JSStringRef propertyName,
93 JSValueRef* exception);
95 static JSValueRef getPropertyMimeType(
98 JSStringRef propertyName,
99 JSValueRef* exception);
101 static JSValueRef getPropertyDisplayName(
102 JSContextRef context,
104 JSStringRef propertyName,
105 JSValueRef* exception);
107 static JSValueRef getPropertyFilePath(
108 JSContextRef context,
110 JSStringRef propertyName,
111 JSValueRef* exception);
113 static JSValueRef getPropertyDescription(
114 JSContextRef context,
116 JSStringRef propertyName,
117 JSValueRef* exception);
119 static JSValueRef getPropertyThumbnailPath(
120 JSContextRef context,
122 JSStringRef propertyName,
123 JSValueRef* exception);
125 static JSValueRef getPropertyReleasedDate(
126 JSContextRef context,
128 JSStringRef propertyName,
129 JSValueRef* exception);
131 static JSValueRef getPropertyModifiedDate(
132 JSContextRef context,
134 JSStringRef propertyName,
135 JSValueRef* exception);
137 static JSValueRef getPropertyRating(
138 JSContextRef context,
140 JSStringRef propertyName,
141 JSValueRef* exception);
143 static JSValueRef getPropertySize(
144 JSContextRef context,
146 JSStringRef propertyName,
147 JSValueRef* exception);
150 static JSValueRef getPropertyEditableAttr(
151 JSContextRef context,
153 JSStringRef propertyName,
154 JSValueRef* exception);
156 static bool setPropertyRating(
157 JSContextRef context,
159 JSStringRef propertyName,
161 JSValueRef* exception);
163 static bool setPropertyDisplayName(
164 JSContextRef context,
166 JSStringRef propertyName,
168 JSValueRef* exception);
170 static bool setPropertyDescription(
171 JSContextRef context,
173 JSStringRef propertyName,
175 JSValueRef* exception);
184 #endif /* _JS_TIZEN_MEDIA_H_ */