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_ImageDownloadListener.h
20 * @brief This file contains the declaration of Image download listener class,
21 * required internally by Image::DecodeUrl.
24 #ifndef FMEDIA_INTERNAL_IMAGEDOWNLOADLISTENER_H_
25 #define FMEDIA_INTERNAL_IMAGEDOWNLOADLISTENER_H_
27 #define _EXCEPT_DEPENDENCY_
30 namespace Tizen{ namespace Media{
32 class _ImageUriDataEvent;
35 class _ImageDownloadListener
36 : virtual public Tizen::Net::Http::IHttpTransactionEventListener
37 , virtual public Tizen::Base::Object
38 , virtual public Tizen::Base::Runtime::IEventListener
42 _ImageDownloadListener(void);
43 virtual ~_ImageDownloadListener(void);
46 virtual void OnTransactionReadyToRead(Tizen::Net::Http::HttpSession& httpSession,
47 Tizen::Net::Http::HttpTransaction& httpTransaction, int availableBodyLen);
49 virtual void OnTransactionAborted(Tizen::Net::Http::HttpSession& httpSession,
50 Tizen::Net::Http::HttpTransaction& httpTransaction, result r);
52 virtual void OnTransactionCompleted(Tizen::Net::Http::HttpSession& httpSession,
53 Tizen::Net::Http::HttpTransaction& httpTransaction);
55 virtual void OnTransactionCertVerificationRequiredN(Tizen::Net::Http::HttpSession& httpSession,
56 Tizen::Net::Http::HttpTransaction& httpTransaction, Tizen::Base::String* pCert);
58 virtual void OnTransactionHeaderCompleted(Tizen::Net::Http::HttpSession& httpSession,
59 Tizen::Net::Http::HttpTransaction& httpTransaction, int headerLen, bool bAuthRequired);
61 virtual void OnTransactionReadyToWrite(Tizen::Net::Http::HttpSession& httpSession,
62 Tizen::Net::Http::HttpTransaction& httpTransaction, int recommendedChunkSize);
64 void OnDownloadCanceled(result res);
66 void setDownloadPath(Tizen::Base::String NewDownloadPath);
67 void SetImageUrlEvent(_ImageUriDataEvent* pImageUriEvent);
68 void SetImageUrlData(_ImageUriData* pImageUriData);
69 void SetImagePixelFormat(Tizen::Graphics::BitmapPixelFormat colorFormat);
70 void SetImageDestDimension(int destWidth, int destHeight);
71 void SetRequestId(RequestId reqId);
75 * This is the copy constructor for this class.
77 _ImageDownloadListener(const _ImageDownloadListener& rhs);
79 * This is the assignment operator.
81 _ImageDownloadListener& operator =(const _ImageDownloadListener& rhs);
83 RequestId __requestID;
84 _ImageUriDataEvent* __pImageUriEvent;
85 _ImageUriData* __pImageUriData;
86 Tizen::Base::ByteBuffer* __pDownloadedData;
87 Tizen::Graphics::BitmapPixelFormat __colorFormat;
94 #endif // FMEDIA_INTERNAL_IMAGEDOWNLOADLISTENER_H_