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