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.
18 #ifndef _JS_TIZEN_VIDEO_H_
19 #define _JS_TIZEN_VIDEO_H_
21 #include <JavaScriptCore/JavaScript.h>
22 #include <CommonsJavaScript/PrivateObject.h>
23 #include <API/Mediacontent/MediacontentMedia.h>
24 #include <API/Mediacontent/MediacontentVideo.h>
27 using namespace TizenApis::Api::Mediacontent;
28 using namespace WrtDeviceApis::Commons;
29 using namespace WrtDeviceApis::CommonsJavaScript;
33 namespace Mediacontent {
35 typedef PrivateObject<MediacontentVideoPtr, NoOwnership> VideoPrivObject;
41 static const JSClassDefinition* getClassInfo();
43 static const JSClassRef getClassRef();
45 static Api::Mediacontent::MediacontentVideoPtr getVideoObject(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
84 static JSValueRef getPropertyGeoLocation(
87 JSStringRef propertyName,
88 JSValueRef* exception);
90 static JSValueRef getPropertyAlbum(
93 JSStringRef propertyName,
94 JSValueRef* exception);
96 static JSValueRef getPropertyArtist(
99 JSStringRef propertyName,
100 JSValueRef* exception);
102 static JSValueRef getPropertyDuration(
103 JSContextRef context,
105 JSStringRef propertyName,
106 JSValueRef* exception);
108 static JSValueRef getPropertyPlayedTime(
109 JSContextRef context,
111 JSStringRef propertyName,
112 JSValueRef* exception);
114 static JSValueRef getPropertyPlayCount(
115 JSContextRef context,
117 JSStringRef propertyName,
118 JSValueRef* exception);
121 static JSValueRef getPropertyWidth(
122 JSContextRef context,
124 JSStringRef propertyName,
125 JSValueRef* exception);
127 static JSValueRef getPropertyHeight(
128 JSContextRef context,
130 JSStringRef propertyName,
131 JSValueRef* exception);
133 static bool setPropertyPlayCount(
134 JSContextRef context,
136 JSStringRef propertyName,
138 JSValueRef* exception);
141 static bool setPropertyPlayedTime(
142 JSContextRef context,
144 JSStringRef propertyName,
146 JSValueRef* exception);
148 static bool setPropertyAlbum(
149 JSContextRef context,
151 JSStringRef propertyName,
153 JSValueRef* exception);
155 static bool setPropertyArtists(
156 JSContextRef context,
158 JSStringRef propertyName,
160 JSValueRef* exception);
162 static bool setPropertyGeoLocation(
163 JSContextRef context,
165 JSStringRef propertyName,
167 JSValueRef* exception);
170 //static JSValueRef setPropertyPlayedTime
178 #endif /* _JS_TIZEN_VIDEO_H_ */