a8a3f9983f46e839c3c5dccaebc3a4ce71a2b085
[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   getPropertyGeoLocation(
84                                         JSContextRef context,
85                                         JSObjectRef object,
86                                         JSStringRef propertyName,
87                                         JSValueRef* exception);
88
89     static JSValueRef   getPropertyAlbum(
90                                         JSContextRef context,
91                                         JSObjectRef object,
92                                         JSStringRef propertyName,
93                                         JSValueRef* exception);
94
95     static JSValueRef   getPropertyArtist(
96                                         JSContextRef context,
97                                         JSObjectRef object,
98                                         JSStringRef propertyName,
99                                         JSValueRef* exception);
100
101     static JSValueRef   getPropertyDuration(
102                                         JSContextRef context,
103                                         JSObjectRef object,
104                                         JSStringRef propertyName,
105                                         JSValueRef* exception);
106
107
108     static JSValueRef   getPropertyWidth(
109                                         JSContextRef context,
110                                         JSObjectRef object,
111                                         JSStringRef propertyName,
112                                         JSValueRef* exception);
113
114     static JSValueRef   getPropertyHeight(
115                                                 JSContextRef context,
116                                                 JSObjectRef object,
117                                                 JSStringRef propertyName,
118                                                 JSValueRef* exception);
119
120     static bool                 setPropertyPlayCount(
121                                                 JSContextRef context,
122                                                 JSObjectRef object,
123                                                 JSStringRef propertyName,
124                                                 JSValueRef value,
125                                                 JSValueRef* exception);
126
127     
128     static bool                 setPropertyPlayedTime(
129                                         JSContextRef context,
130                                         JSObjectRef object,
131                                         JSStringRef propertyName,
132                                     JSValueRef value,
133                                         JSValueRef* exception);
134
135     static bool                 setPropertyAlbum(
136                                         JSContextRef context,
137                                         JSObjectRef object,
138                                         JSStringRef propertyName,
139                                     JSValueRef value,
140                                         JSValueRef* exception);
141
142     static bool                 setPropertyArtists(
143                                         JSContextRef context,
144                                         JSObjectRef object,
145                                         JSStringRef propertyName,
146                                     JSValueRef value,
147                                         JSValueRef* exception); 
148
149     static bool                 setPropertyGeoLocation(
150                                         JSContextRef context,
151                                         JSObjectRef object,
152                                         JSStringRef propertyName,
153                                     JSValueRef value,
154                                         JSValueRef* exception);
155
156         //todo-dykim
157         //static JSValueRef     setPropertyPlayedTime
158
159 };
160
161 }
162 }
163
164
165 #endif /* _JS_TIZEN_VIDEO_H_ */