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_VIDEO_H_
20 #define _JS_TIZEN_VIDEO_H_
22 #include <JavaScriptCore/JavaScript.h>
23 #include <CommonsJavaScript/PrivateObject.h>
24 #include "ContentMedia.h"
25 #include "ContentVideo.h"
26 #include "JSContent.h"
28 using namespace WrtDeviceApis::Commons;
29 using namespace WrtDeviceApis::CommonsJavaScript;
34 typedef PrivateObject<MediacontentVideoPtr, NoOwnership> VideoPrivObject;
40 static const JSClassDefinition* getClassInfo();
42 static const JSClassRef getClassRef();
44 static MediacontentVideoPtr getVideoObject(JSObjectRef object);
48 * This member variable contains the values which has to be passed when
49 * the this class is embedded into JS Engine.
51 static JSClassDefinition m_classInfo;
54 * This structure describes a statically declared function property.
56 static JSStaticFunction m_function[];
59 * This member variable contains the initialization values for the
60 * properties of this class. The values are given according to the
61 * data structure JSPropertySpec.
63 static JSStaticValue m_property[];
65 static JSClassRef m_jsClassRef;
68 * The callback invoked when an object is first created.
70 static void initialize(JSContextRef context, JSObjectRef object);
73 * The callback invoked when an object is finalized.
75 static void finalize(JSObjectRef object);
80 * Getters and setters for properties
83 static JSValueRef getPropertyAlbum(
86 JSStringRef propertyName,
87 JSValueRef* exception);
89 static JSValueRef getPropertyArtist(
92 JSStringRef propertyName,
93 JSValueRef* exception);
95 static JSValueRef getPropertyDuration(
98 JSStringRef propertyName,
99 JSValueRef* exception);
102 static JSValueRef getPropertyWidth(
103 JSContextRef context,
105 JSStringRef propertyName,
106 JSValueRef* exception);
108 static JSValueRef getPropertyHeight(
109 JSContextRef context,
111 JSStringRef propertyName,
112 JSValueRef* exception);
114 static bool setPropertyPlayCount(
115 JSContextRef context,
117 JSStringRef propertyName,
119 JSValueRef* exception);
122 static bool setPropertyPlayedTime(
123 JSContextRef context,
125 JSStringRef propertyName,
127 JSValueRef* exception);
129 static bool setPropertyAlbum(
130 JSContextRef context,
132 JSStringRef propertyName,
134 JSValueRef* exception);
136 static bool setPropertyArtists(
137 JSContextRef context,
139 JSStringRef propertyName,
141 JSValueRef* exception);
143 static bool setProperty(
144 JSContextRef context,
146 JSStringRef propertyName,
148 JSValueRef* exception);
157 #endif /* _JS_TIZEN_VIDEO_H_ */