2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 // Licensed under the Apache License, Version 2.0 (the License);
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
8 // http://www.apache.org/licenses/LICENSE-2.0
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
17 * @file FCnt_ContentDownloadListener.h
18 * @brief This is the header file for the %_ContentDownloadListener class.
20 * This header file contains the declarations of the %_ContentDownloadListener class.
23 #ifndef _FCNT_INTERNAL_CONTENT_DOWNLOAD_LISTENER_H_
24 #define _FCNT_INTERNAL_CONTENT_DOWNLOAD_LISTENER_H_
26 #include <FNetHttpHttpSession.h>
27 #include "FCnt_ContentDownloadUserData.h"
29 namespace Tizen { namespace Io
33 namespace Tizen { namespace Net { namespace Http
35 class HttpTransaction;
37 namespace Tizen { namespace Net { namespace Http
42 namespace Tizen { namespace Content
45 class _ContentDownloadListener
46 : public Tizen::Net::Http::IHttpTransactionEventListener
47 , public Tizen::Net::Http::IHttpProgressEventListener
50 _ContentDownloadListener(void);
51 virtual ~_ContentDownloadListener(void);
54 virtual void OnTransactionReadyToRead(Tizen::Net::Http::HttpSession& httpSession, Tizen::Net::Http::HttpTransaction& httpTransaction, int availableBodyLen);
55 virtual void OnTransactionAborted(Tizen::Net::Http::HttpSession& httpSession, Tizen::Net::Http::HttpTransaction& httpTransaction, result r);
56 virtual void OnTransactionCompleted(Tizen::Net::Http::HttpSession& httpSession, Tizen::Net::Http::HttpTransaction& httpTransaction);
57 virtual void OnTransactionCertVerificationRequiredN(Tizen::Net::Http::HttpSession& httpSession, Tizen::Net::Http::HttpTransaction& httpTransaction, Tizen::Base::String* pCert);
58 virtual void OnTransactionHeaderCompleted(Tizen::Net::Http::HttpSession& httpSession, Tizen::Net::Http::HttpTransaction& httpTransaction, int headerLen, bool bAuthRequired);
59 virtual void OnTransactionReadyToWrite(Tizen::Net::Http::HttpSession& httpSession, Tizen::Net::Http::HttpTransaction& httpTransaction, int recommendedChunkSize);
61 virtual void OnHttpDownloadInProgress(Tizen::Net::Http::HttpSession& httpSession, Tizen::Net::Http::HttpTransaction& httpTransaction, long long currentLength, long long totalLength);
62 virtual void OnHttpUploadInProgress(Tizen::Net::Http::HttpSession& httpSession, Tizen::Net::Http::HttpTransaction& httpTransaction, long long currentLength, long long totalLength);
64 void DownloadCompleted(Tizen::Net::Http::HttpSession& httpSession, Tizen::Net::Http::HttpTransaction& httpTransaction, _ContentDownloadUserData* pUserData, int errorCode, Tizen::Base::String errorMsg, result res);
65 void DownloadCanceled(_ContentDownloadUserData* pUserData, int statusCode, Tizen::Base::String errorMsg, result r);
66 void TransferProgress(Tizen::Net::Http::HttpSession& httpSession, Tizen::Net::Http::HttpTransaction& httpTransaction, long long currentLength, long long totalLength, _ContentDownloadUserData* pUserData);
67 result RegisterMediaFile(Tizen::Net::Http::HttpSession& httpSession, Tizen::Net::Http::HttpTransaction& httpTransaction, _ContentDownloadUserData* pUserData);
71 _ContentDownloadListener(const _ContentDownloadListener& rhs);
72 _ContentDownloadListener& operator =(const _ContentDownloadListener& rhs);
73 }; // class _ContentDownloadListener
77 #endif // _FCNT_INTERNAL_CONTENT_DOWNLOAD_LISTENER_H_