Beta merge 2
[profile/ivi/wrt-plugins-tizen.git] / src / standards / Tizen / Mediacontent / JSImage.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_IMAGE_H_
19 #define _JS_TIZEN_IMAGE_H_
20
21 #include <JavaScriptCore/JavaScript.h>
22 #include <CommonsJavaScript/PrivateObject.h>
23 #include <API/Mediacontent/MediacontentMedia.h>
24 #include <API/Mediacontent/MediacontentImage.h>
25 #include "JSMedia.h"
26
27
28 using namespace TizenApis::Api::Mediacontent;
29 using namespace WrtDeviceApis::Commons;
30 using namespace WrtDeviceApis::CommonsJavaScript;
31
32
33 namespace TizenApis {
34 namespace Tizen1_0 {
35 namespace Mediacontent {
36
37 typedef PrivateObject<MediacontentImagePtr, NoOwnership> ImagePrivObject;
38
39 class JSImage
40 {
41 public:
42
43     static const JSClassDefinition* getClassInfo();
44
45     static const JSClassRef getClassRef();
46
47     static MediacontentImagePtr getImageObject(JSObjectRef object);
48
49
50 private:
51     /**
52      * This member variable contains the values which has to be passed when 
53      * the this class is embedded into JS Engine.
54      */
55     static JSClassDefinition m_classInfo;
56
57     /**
58      * This structure describes a statically declared function property.
59      */
60     static JSStaticFunction m_function[];
61
62     /**
63      * This member variable contains the initialization values for the 
64      * properties of this class. The values are given according to the
65      * data structure JSPropertySpec.
66      */
67     static JSStaticValue m_property[];
68
69     static JSClassRef m_jsClassRef;
70
71     /**
72      * The callback invoked when an object is first created.
73      */
74     static void initialize(JSContextRef context, JSObjectRef object);
75
76     /**
77      * The callback invoked when an object is finalized.
78      */
79     static void finalize(JSObjectRef object);
80
81
82
83     /**
84      * Getters and setters for properties
85      */
86         
87     static JSValueRef   getPropertyGeoLocation(
88                                         JSContextRef context,
89                                         JSObjectRef object,
90                                         JSStringRef propertyName,
91                                         JSValueRef* exception);
92
93     static JSValueRef   getPropertyWidth(
94                                         JSContextRef context,
95                                         JSObjectRef object,
96                                         JSStringRef propertyName,
97                                         JSValueRef* exception);
98
99     static JSValueRef   getPropertyHeight(
100                                         JSContextRef context,
101                                         JSObjectRef object,
102                                         JSStringRef propertyName,
103                                         JSValueRef* exception);
104     
105
106     static JSValueRef   getPropertyOrientation(
107                                         JSContextRef context,
108                                         JSObjectRef object,
109                                         JSStringRef propertyName,
110                                         JSValueRef* exception);    
111
112  
113 };
114
115 }
116 }
117 }
118
119 #endif /* _JS_TIZEN_IMAGE_H_ */