Beta merge 2
[profile/ivi/wrt-plugins-tizen.git] / src / standards / Tizen / Mediacontent / JSMedia.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  
19 #ifndef _JS_TIZEN_MEDIA_H_
20 #define _JS_TIZEN_MEDIA_H_
21
22 #include <JavaScriptCore/JavaScript.h>
23 #include <CommonsJavaScript/PrivateObject.h>
24 #include <API/Mediacontent/MediacontentMedia.h>
25
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<Api::Mediacontent::MediacontentMediaPtr, NoOwnership> MediaPrivObject;
36
37 class JSMedia
38 {
39         public:
40
41         static const JSClassDefinition* getClassInfo();
42
43         static const JSClassRef getClassRef();
44
45         static Api::Mediacontent::MediacontentMediaPtr getMediaObject(JSObjectRef object);
46
47
48         private:
49         /**
50         * This member variable contains the values which has to be passed when 
51         * the this class is embedded into JS Engine.
52         */
53         static JSClassDefinition m_classInfo;
54
55         /**
56         * This structure describes a statically declared function property.
57         */
58         static JSStaticFunction m_function[];
59
60         /**
61         * This member variable contains the initialization values for the 
62         * properties of this class. The values are given according to the
63         * data structure JSPropertySpec.
64         */
65         static JSStaticValue m_property[];
66
67         static JSClassRef m_jsClassRef;
68
69         /**
70         * The callback invoked when an object is first created.
71         */
72         static void initialize(JSContextRef context, JSObjectRef object);
73
74         /**
75         * The callback invoked when an object is finalized.
76         */
77         static void finalize(JSObjectRef object);
78
79
80
81         /**
82         * Getters and setters for properties
83         */
84         static JSValueRef       getPropertyId(
85                                                 JSContextRef context,
86                                                 JSObjectRef object,
87                                                 JSStringRef propertyName,
88                                                 JSValueRef* exception);
89
90         static JSValueRef       getPropertyType(
91                                                 JSContextRef context,
92                                                 JSObjectRef object,
93                                                 JSStringRef propertyName,
94                                                 JSValueRef* exception);
95
96         static JSValueRef       getPropertyMimeType(
97                                                 JSContextRef context,
98                                                 JSObjectRef object,
99                                                 JSStringRef propertyName,
100                                                 JSValueRef* exception);
101         
102         static JSValueRef       getPropertyDisplayName(
103                                                 JSContextRef context,
104                                                 JSObjectRef object,
105                                                 JSStringRef propertyName,
106                                                 JSValueRef* exception);
107
108         static JSValueRef       getPropertyFilePath(
109                                                 JSContextRef context,
110                                                 JSObjectRef object,
111                                                 JSStringRef propertyName,
112                                                 JSValueRef* exception);
113
114         static JSValueRef   getPropertyDescription(
115                                                 JSContextRef context,
116                                                 JSObjectRef object, 
117                                                 JSStringRef propertyName, 
118                                                 JSValueRef* exception);
119
120         static JSValueRef       getPropertyThumbnailPath(
121                                                 JSContextRef context,
122                                                 JSObjectRef object,
123                                                 JSStringRef propertyName,
124                                                 JSValueRef* exception);
125
126         static JSValueRef       getPropertyCreatedDate(
127                                                 JSContextRef context,
128                                                 JSObjectRef object,
129                                                 JSStringRef propertyName,
130                                                 JSValueRef* exception);
131
132         static JSValueRef       getPropertyReleasedDate(
133                                                 JSContextRef context,
134                                                 JSObjectRef object,
135                                                 JSStringRef propertyName,
136                                                 JSValueRef* exception);
137
138         static JSValueRef       getPropertyModifiedDate(
139                                                 JSContextRef context,
140                                                 JSObjectRef object,
141                                                 JSStringRef propertyName,
142                                                 JSValueRef* exception);
143
144         static JSValueRef       getPropertyFavorite(
145                                                 JSContextRef context,
146                                                 JSObjectRef object,
147                                                 JSStringRef propertyName,
148                                                 JSValueRef* exception);    
149
150         static bool                     setPropertyFavorite(
151                                                 JSContextRef context,
152                                                 JSObjectRef object,
153                                                 JSStringRef propertyName,
154                                     JSValueRef value,
155                                                 JSValueRef* exception);  
156
157  
158 };
159
160 }
161 }
162 }
163
164 #endif /* _JS_TIZEN_MEDIA_H_ */