Fix : Search APIs don't return exception despite the content in DB doesn't match...
[platform/framework/native/content.git] / src / FCnt_ContentDownloadListener.h
1 //
2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
3 //
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
7 //
8 //     http://www.apache.org/licenses/LICENSE-2.0
9 //
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.
15 //
16 /**
17  * @file                FCnt_ContentDownloadListener.h
18  * @brief               This is the header file for the %_ContentDownloadListener class.
19  *
20  * This header file contains the declarations of the %_ContentDownloadListener class.
21  */
22
23 #ifndef _FCNT_INTERNAL_CONTENT_DOWNLOAD_LISTENER_H_
24 #define _FCNT_INTERNAL_CONTENT_DOWNLOAD_LISTENER_H_
25
26 #include <FNetHttpHttpSession.h>
27 #include "FCnt_ContentDownloadUserData.h"
28
29 namespace Tizen { namespace Io
30 {
31 class File;
32 }}
33 namespace Tizen { namespace Net { namespace Http
34 {
35 class HttpTransaction;
36 }}}
37 namespace Tizen { namespace Net { namespace Http
38 {
39 class HttpRequest;
40 }}}
41
42 namespace Tizen { namespace Content
43 {
44
45 class _ContentDownloadListener
46         : public Tizen::Net::Http::IHttpTransactionEventListener
47         , public Tizen::Net::Http::IHttpProgressEventListener
48 {
49 public:
50         _ContentDownloadListener(void);
51         virtual ~_ContentDownloadListener(void);
52
53 public:
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);
60
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);
63
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);
68
69
70 private:
71         _ContentDownloadListener(const _ContentDownloadListener& rhs);
72         _ContentDownloadListener& operator =(const _ContentDownloadListener& rhs);
73 };  // class _ContentDownloadListener
74
75 }}  // Tizen::Content
76
77 #endif  // _FCNT_INTERNAL_CONTENT_DOWNLOAD_LISTENER_H_