merge commits of 2.2.1 to public
[platform/framework/native/image.git] / src / FMedia_ImageUriDataHolder.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_ImageUriDataHolder.cpp
20  * @brief  This file contains the implementation of _ImageUriDataHolder class,
21  *               required internally by Image::DecodeUrl.
22  */
23
24
25 #include <FBaseRtTimer.h>
26 #include <FBaseRtITimerEventListener.h>
27 #include <FBaseRtIEventListener.h>
28 #include <FBaseUtilUri.h>
29 #include <FBaseObject.h>
30 #include <FGrpDimension.h>
31 #include <FGrpBitmapCommon.h>
32 #include "FMedia_ImageUriData.h"
33 #include "FMedia_ImageUriDataHolder.h"
34
35 using namespace Tizen::Base;
36 using namespace Tizen::Graphics;
37 using namespace Tizen::Base::Runtime;
38 using namespace Tizen::Base::Utility;
39
40 namespace Tizen{ namespace Media{
41
42 _ImageUriDataHolder::_ImageUriDataHolder(void)
43 {
44         __timeout = 0;
45         __colorFormat = BITMAP_PIXEL_FORMAT_RGB565;
46         __pListener = null;
47         __requestId = -1;
48 }
49
50 _ImageUriDataHolder::~_ImageUriDataHolder(void)
51 {
52
53 }
54
55 Dimension
56 _ImageUriDataHolder::GetDestDim(void) const
57 {
58         return __destDim;
59 }
60
61 long
62 _ImageUriDataHolder::GetTimeout(void) const
63 {
64         return __timeout;
65 }
66
67 Uri
68 _ImageUriDataHolder::GetUri(void) const
69 {
70         return __uri;
71 }
72
73 void
74 _ImageUriDataHolder::SetDestDim(const Dimension& destDim)
75 {
76         __destDim = destDim;
77 }
78
79 void
80 _ImageUriDataHolder::SetTimeout(long timeout)
81 {
82         __timeout = timeout;
83 }
84
85 void
86 _ImageUriDataHolder::SetUri(const Uri& uri)
87 {
88         __uri = uri;
89 }
90
91 BitmapPixelFormat
92 _ImageUriDataHolder::GetColorFormat(void) const
93 {
94         return __colorFormat;
95 }
96
97 void
98 _ImageUriDataHolder::SetColorFormat(BitmapPixelFormat colorFormat)
99 {
100         __colorFormat = colorFormat;
101 }
102
103 IEventListener*
104 _ImageUriDataHolder::GetListener(void) const
105 {
106         return __pListener;
107 }
108
109 void
110 _ImageUriDataHolder::SetListener(IEventListener* pListener)
111 {
112         __pListener = pListener;
113 }
114
115 RequestId
116 _ImageUriDataHolder::GetRequestId(void) const
117 {
118         return __requestId;
119 }
120
121 void
122 _ImageUriDataHolder::SetRequestId(RequestId reqId)
123 {
124         __requestId = reqId;
125 }
126
127 }} // Tizen::Media