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 getPropertyGeoLocation(
86 JSStringRef propertyName,
87 JSValueRef* exception);
89 static JSValueRef getPropertyAlbum(
92 JSStringRef propertyName,
93 JSValueRef* exception);
95 static JSValueRef getPropertyArtist(
98 JSStringRef propertyName,
99 JSValueRef* exception);
101 static JSValueRef getPropertyDuration(
102 JSContextRef context,
104 JSStringRef propertyName,
105 JSValueRef* exception);
108 static JSValueRef getPropertyWidth(
109 JSContextRef context,
111 JSStringRef propertyName,
112 JSValueRef* exception);
114 static JSValueRef getPropertyHeight(
115 JSContextRef context,
117 JSStringRef propertyName,
118 JSValueRef* exception);
120 static bool setPropertyPlayCount(
121 JSContextRef context,
123 JSStringRef propertyName,
125 JSValueRef* exception);
128 static bool setPropertyPlayedTime(
129 JSContextRef context,
131 JSStringRef propertyName,
133 JSValueRef* exception);
135 static bool setPropertyAlbum(
136 JSContextRef context,
138 JSStringRef propertyName,
140 JSValueRef* exception);
142 static bool setPropertyArtists(
143 JSContextRef context,
145 JSStringRef propertyName,
147 JSValueRef* exception);
149 static bool setPropertyGeoLocation(
150 JSContextRef context,
152 JSStringRef propertyName,
154 JSValueRef* exception);
157 //static JSValueRef setPropertyPlayedTime
165 #endif /* _JS_TIZEN_VIDEO_H_ */