2 // Open Service Platform
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
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
9 // http://www.apache.org/licenses/LICENSE-2.0
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.
19 * @file FMedia_ImageUriData.h
20 * @brief This file contains the declaration of _ImageUriData class,
21 * required internally by Image::DecodeUrl.
24 #ifndef FMEDIA_INTERNAL_IMAGEURIDATA_H_
25 #define FMEDIA_INTERNAL_IMAGEURIDATA_H_
27 #include <unique_ptr.h>
29 namespace Tizen { namespace Net { namespace Http
31 class HttpTransaction;
35 class _HttpTransactionImpl;
36 class _HttpSessionImpl;
37 class _HttpRequestImpl;
39 namespace Tizen{ namespace Media{
41 class _ImageUriDataEvent;
42 class _ImageDownloadListener;
43 class IImageDecodeUrlEventListener;
46 * @brief This class provides the _ImageUriData
51 : virtual public Tizen::Base::Object
52 , virtual public Tizen::Base::Runtime::ITimerEventListener
53 , virtual public Tizen::Base::Runtime::IEventListener
57 virtual ~_ImageUriData(void);
59 result Construct(Tizen::Base::Runtime::IEventListener& listener);
60 result RequestDecode(const Tizen::Base::Utility::Uri &uri,
61 Tizen::Graphics::BitmapPixelFormat colorFormat,
62 const Tizen::Graphics::Dimension& destDim, RequestId& reqId, long msec);
63 result Cancel(RequestId reqId, result res);
64 RequestId GetRequestId(void) const;
66 Tizen::Base::Utility::Uri GetDownloadableUri(void) const;
69 _ImageUriData(const _ImageUriData& rhs);
70 _ImageUriData& operator =(const _ImageUriData& rhs);
72 result RequestDownload(const Tizen::Base::Utility::Uri &downloadUri, RequestId& reqId, long msec );
74 void OnTimerExpired (Tizen::Base::Runtime::Timer &timer);
76 Tizen::Base::Utility::Uri __srcUri;
77 Tizen::Base::Utility::Uri __downloadableUri;
80 std::unique_ptr<Tizen::Net::Http::HttpSession> __pSession;
81 Tizen::Net::Http::_HttpSessionImpl* __pSessionImpl;
82 std::unique_ptr<Tizen::Net::Http::HttpTransaction> __pTransaction;
83 Tizen::Net::Http::_HttpTransactionImpl* __pTransactionImpl;
84 Tizen::Net::Http::HttpRequest* __pRequest;
85 Tizen::Net::Http::_HttpRequestImpl* __pRequestImpl;
86 std::unique_ptr<_ImageDownloadListener> __pListener;
87 std::unique_ptr<_ImageUriDataEvent> __pDataEvent;
88 Tizen::Base::Runtime::Timer __requestTimeout;
89 Tizen::Graphics::BitmapPixelFormat __colorFormat;
90 RequestId __requestId;
92 bool __isTimerStarted;
97 #endif // FMEDIA_INTERNAL_IMAGEURIDATA_H_