[content] Fix remove item bug on PlayList
[platform/framework/native/content.git] / src / FCnt_ContentDownloadListener.h
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  * @file                FCnt_ContentDownloadListener.h
19  * @brief               This is the header file for the %_ContentDownloadListener class.
20  *
21  * This header file contains the declarations of the %_ContentDownloadListener class.
22  */
23
24 #ifndef _FCNT_INTERNAL_CONTENT_DOWNLOAD_LISTENER_H_
25 #define _FCNT_INTERNAL_CONTENT_DOWNLOAD_LISTENER_H_
26
27 #include <FNetHttpHttpSession.h>
28 #include "FCnt_ContentDownloadUserData.h"
29
30 namespace Tizen { namespace Io
31 {
32 class File;
33 }}
34 namespace Tizen { namespace Net { namespace Http
35 {
36 class HttpTransaction;
37 }}}
38 namespace Tizen { namespace Net { namespace Http
39 {
40 class HttpRequest;
41 }}}
42
43 namespace Tizen { namespace Content
44 {
45
46 class _ContentDownloadListener
47         : public Tizen::Net::Http::IHttpTransactionEventListener
48         , public Tizen::Net::Http::IHttpProgressEventListener
49 {
50 public:
51         _ContentDownloadListener(void);
52         virtual ~_ContentDownloadListener(void);
53
54 public:
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);
61
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);
64
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);
69
70
71 private:
72         _ContentDownloadListener(const _ContentDownloadListener& rhs);
73         _ContentDownloadListener& operator =(const _ContentDownloadListener& rhs);
74 };  // class _ContentDownloadListener
75
76 }}  // Tizen::Content
77
78 #endif  // _FCNT_INTERNAL_CONTENT_DOWNLOAD_LISTENER_H_