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.
18 * @file FCnt_ContentDownloadListener.h
19 * @brief This is the header file for the %_ContentDownloadListener class.
21 * This header file contains the declarations of the %_ContentDownloadListener class.
24 #ifndef _FCNT_INTERNAL_CONTENT_DOWNLOAD_LISTENER_H_
25 #define _FCNT_INTERNAL_CONTENT_DOWNLOAD_LISTENER_H_
27 #include <FNetHttpHttpSession.h>
28 #include "FCnt_ContentDownloadUserData.h"
30 namespace Tizen { namespace Io
34 namespace Tizen { namespace Net { namespace Http
36 class HttpTransaction;
38 namespace Tizen { namespace Net { namespace Http
43 namespace Tizen { namespace Content
46 class _ContentDownloadListener
47 : public Tizen::Net::Http::IHttpTransactionEventListener
48 , public Tizen::Net::Http::IHttpProgressEventListener
51 _ContentDownloadListener(void);
52 virtual ~_ContentDownloadListener(void);
55 virtual void OnTransactionReadyToRead(Tizen::Net::Http::HttpSession& httpSession, Tizen::Net::Http::HttpTransaction& httpTransaction, int availableBodyLen);
56 virtual void OnTransactionAborted(Tizen::Net::Http::HttpSession& httpSession, Tizen::Net::Http::HttpTransaction& httpTransaction, result r);
57 virtual void OnTransactionCompleted(Tizen::Net::Http::HttpSession& httpSession, Tizen::Net::Http::HttpTransaction& httpTransaction);
58 virtual void OnTransactionCertVerificationRequiredN(Tizen::Net::Http::HttpSession& httpSession, Tizen::Net::Http::HttpTransaction& httpTransaction, Tizen::Base::String* pCert);
59 virtual void OnTransactionHeaderCompleted(Tizen::Net::Http::HttpSession& httpSession, Tizen::Net::Http::HttpTransaction& httpTransaction, int headerLen, bool bAuthRequired);
60 virtual void OnTransactionReadyToWrite(Tizen::Net::Http::HttpSession& httpSession, Tizen::Net::Http::HttpTransaction& httpTransaction, int recommendedChunkSize);
62 virtual void OnHttpDownloadInProgress(Tizen::Net::Http::HttpSession& httpSession, Tizen::Net::Http::HttpTransaction& httpTransaction, long long currentLength, long long totalLength);
63 virtual void OnHttpUploadInProgress(Tizen::Net::Http::HttpSession& httpSession, Tizen::Net::Http::HttpTransaction& httpTransaction, long long currentLength, long long totalLength);
65 void DownloadCompleted(Tizen::Net::Http::HttpSession& httpSession, Tizen::Net::Http::HttpTransaction& httpTransaction, _ContentDownloadUserData* pUserData, int errorCode, Tizen::Base::String errorMsg, result res);
66 void DownloadCanceled(_ContentDownloadUserData* pUserData, int statusCode, Tizen::Base::String errorMsg, result r);
67 void TransferProgress(Tizen::Net::Http::HttpSession& httpSession, Tizen::Net::Http::HttpTransaction& httpTransaction, long long currentLength, long long totalLength, _ContentDownloadUserData* pUserData);
68 result RegisterMediaFile(Tizen::Net::Http::HttpSession& httpSession, Tizen::Net::Http::HttpTransaction& httpTransaction, _ContentDownloadUserData* pUserData);
72 _ContentDownloadListener(const _ContentDownloadListener& rhs);
73 _ContentDownloadListener& operator =(const _ContentDownloadListener& rhs);
74 }; // class _ContentDownloadListener
78 #endif // _FCNT_INTERNAL_CONTENT_DOWNLOAD_LISTENER_H_