merge commits of 2.2.1 to public
[platform/framework/native/image.git] / src / FMedia_ImageUriDataEventArg.cpp
1 //
2 // Open Service Platform
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  * @file   FMedia_ImageUriDataEventArg.cpp
20  * @brief  This file contains the implementation of _ImageUriDataEvent class,
21  *               required internally by Image::DecodeUrl.
22  */
23
24
25 //include
26 #include <unique_ptr.h>
27 #include "FMedia_ImageUriDataEventArg.h"
28
29 using namespace Tizen::Base;
30 using namespace Tizen::Graphics;
31
32 namespace Tizen{ namespace Media{
33
34 _ImageUriDataEventTypeArg::_ImageUriDataEventTypeArg(void)
35         : __ImageUriDataEventType(IMAGE_URI_DATA_EVENT_NONE)
36         , __reqId(0)
37 {
38
39 }
40
41 _ImageUriDataEventTypeArg::~_ImageUriDataEventTypeArg(void)
42 {
43         // nothing to do.
44 }
45
46 void
47 _ImageUriDataEventTypeArg::SetEventType(_ImageUriDataEventType eType)
48 {
49         __ImageUriDataEventType = eType;
50 }
51
52 _ImageUriDataEventType
53 _ImageUriDataEventTypeArg::GetEventType(void) const
54 {
55         return __ImageUriDataEventType;
56 }
57
58 RequestId
59 _ImageUriDataEventTypeArg::GetRequestId(void) const
60 {
61         return __reqId;
62 }
63
64 void
65 _ImageUriDataEventTypeArg::SetRequestId(RequestId reqId)
66 {
67         __reqId = reqId;
68 }
69
70 _ImageUriDataEventArg::_ImageUriDataEventArg(void)
71         : __imageFormat(IMG_FORMAT_NONE)
72         , __colorFormat(BITMAP_PIXEL_FORMAT_RGB565)
73         , __res(E_SUCCESS)
74 {
75
76 }
77
78 _ImageUriDataEventArg::~_ImageUriDataEventArg(void)
79 {
80 }
81
82 void
83 _ImageUriDataEventArg::SetData( ByteBuffer* data)
84 {
85         __pImageData.reset(data);
86 }
87
88 ByteBuffer*
89 _ImageUriDataEventArg::GetData(void) const
90 {
91         return __pImageData.get();
92 }
93
94 void
95 _ImageUriDataEventArg::SetDestDimension( Dimension dimension)
96 {
97         __dimension = dimension;
98 }
99
100 Dimension
101 _ImageUriDataEventArg::GetDestDimension(void) const
102 {
103         return __dimension;
104 }
105
106 void
107 _ImageUriDataEventArg::SetImageFormat( ImageFormat imageFormat )
108 {
109         __imageFormat = imageFormat;
110 }
111
112 ImageFormat
113 _ImageUriDataEventArg::GetImageFormat(void) const
114 {
115         return __imageFormat;
116 }
117
118 void
119 _ImageUriDataEventArg::SetColorFormat( BitmapPixelFormat colorFormat)
120 {
121         __colorFormat = colorFormat;
122 }
123
124 BitmapPixelFormat
125 _ImageUriDataEventArg::GetColorFormat(void) const
126 {
127         return __colorFormat;
128 }
129
130 void
131 _ImageUriDataEventArg::SetResult(result r)
132 {
133         __res = r;
134 }
135
136 result
137 _ImageUriDataEventArg::GetResult(void) const
138 {
139         return __res;
140 }
141
142 _ImageUriDataErrorArg::_ImageUriDataErrorArg(void)
143         : __error(E_UNKNOWN)
144 {
145         __errorCode = String(L"");
146         __errorMessage = String(L"");
147 }
148
149 _ImageUriDataErrorArg::~_ImageUriDataErrorArg(void)
150 {
151         // nothing to do.
152 }
153
154 result
155 _ImageUriDataErrorArg::GetError(void) const
156 {
157         return __error;
158 }
159
160 void
161 _ImageUriDataErrorArg::SetError(result r)
162 {
163         __error = r;
164 }
165
166 String
167 _ImageUriDataErrorArg::GetErrorCode(void) const
168 {
169         return __errorCode;
170 }
171
172 void
173 _ImageUriDataErrorArg::SetErrorCode( const String& errorCode)
174 {
175         __errorCode = errorCode;
176 }
177
178 String
179 _ImageUriDataErrorArg::GetErrorMessage(void) const
180 {
181         return __errorMessage;
182 }
183
184 void
185 _ImageUriDataErrorArg::SetErrorMessage( const String& errorMessage)
186 {
187         __errorMessage = errorMessage;
188 }
189
190
191 _ImageUriDataDestroyArg::_ImageUriDataDestroyArg(void)
192 {
193         // nothing to do.
194 }
195
196 _ImageUriDataDestroyArg::~_ImageUriDataDestroyArg(void)
197 {
198         // nothing to do.
199 }
200
201 }} // Tizen::Media
202
203