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