Update change log and spec for wrt-plugins-tizen_0.4.57
[platform/framework/web/wrt-plugins-tizen.git] / src / Content / JSVideo.h
1 //
2 // Tizen Web Device API
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 //
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
8 //
9 // http://www.apache.org/licenses/LICENSE-2.0
10 //
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.
16 //
17
18
19 #ifndef _JS_TIZEN_VIDEO_H_
20 #define _JS_TIZEN_VIDEO_H_
21
22 #include <JavaScriptCore/JavaScript.h>
23 #include <CommonsJavaScript/PrivateObject.h>
24 #include "ContentMedia.h"
25 #include "ContentVideo.h"
26 #include "JSContent.h"
27
28 using namespace WrtDeviceApis::Commons;
29 using namespace WrtDeviceApis::CommonsJavaScript;
30
31 namespace DeviceAPI {
32 namespace Content {
33
34 typedef PrivateObject<MediacontentVideoPtr, NoOwnership> VideoPrivObject;
35
36 class JSVideo
37 {
38 public:
39
40     static const JSClassDefinition* getClassInfo();
41
42     static const JSClassRef getClassRef();
43
44         static MediacontentVideoPtr getVideoObject(JSObjectRef object);
45
46 private:
47     /**
48      * This member variable contains the values which has to be passed when 
49      * the this class is embedded into JS Engine.
50      */
51     static JSClassDefinition m_classInfo;
52
53     /**
54      * This structure describes a statically declared function property.
55      */
56     static JSStaticFunction m_function[];
57
58     /**
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.
62      */
63     static JSStaticValue m_property[];
64
65     static JSClassRef m_jsClassRef;
66
67     /**
68      * The callback invoked when an object is first created.
69      */
70     static void initialize(JSContextRef context, JSObjectRef object);
71
72     /**
73      * The callback invoked when an object is finalized.
74      */
75     static void finalize(JSObjectRef object);
76
77
78
79     /**
80      * Getters and setters for properties
81      */
82
83     static JSValueRef   getPropertyAlbum(
84                                         JSContextRef context,
85                                         JSObjectRef object,
86                                         JSStringRef propertyName,
87                                         JSValueRef* exception);
88
89     static JSValueRef   getPropertyArtist(
90                                         JSContextRef context,
91                                         JSObjectRef object,
92                                         JSStringRef propertyName,
93                                         JSValueRef* exception);
94
95     static JSValueRef   getPropertyDuration(
96                                         JSContextRef context,
97                                         JSObjectRef object,
98                                         JSStringRef propertyName,
99                                         JSValueRef* exception);
100
101
102     static JSValueRef   getPropertyWidth(
103                                         JSContextRef context,
104                                         JSObjectRef object,
105                                         JSStringRef propertyName,
106                                         JSValueRef* exception);
107
108     static JSValueRef   getPropertyHeight(
109                                                 JSContextRef context,
110                                                 JSObjectRef object,
111                                                 JSStringRef propertyName,
112                                                 JSValueRef* exception);
113
114     static bool                 setPropertyPlayCount(
115                                                 JSContextRef context,
116                                                 JSObjectRef object,
117                                                 JSStringRef propertyName,
118                                                 JSValueRef value,
119                                                 JSValueRef* exception);
120
121     
122     static bool                 setPropertyPlayedTime(
123                                         JSContextRef context,
124                                         JSObjectRef object,
125                                         JSStringRef propertyName,
126                                     JSValueRef value,
127                                         JSValueRef* exception);
128
129     static bool                 setPropertyAlbum(
130                                         JSContextRef context,
131                                         JSObjectRef object,
132                                         JSStringRef propertyName,
133                                     JSValueRef value,
134                                         JSValueRef* exception);
135
136     static bool                 setPropertyArtists(
137                                         JSContextRef context,
138                                         JSObjectRef object,
139                                         JSStringRef propertyName,
140                                     JSValueRef value,
141                                         JSValueRef* exception);
142
143     static bool     setProperty(
144                             JSContextRef context,
145                             JSObjectRef object,
146                             JSStringRef propertyName,
147                             JSValueRef value, 
148                             JSValueRef* exception);
149
150
151 };
152
153 }
154 }
155
156
157 #endif /* _JS_TIZEN_VIDEO_H_ */