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 FCntIDownloadListener.h
19 * @brief This is the header file for the %IDownloadListener interface.
21 * This header file contains the declarations of the %IDownloadListener interface.
24 #ifndef _FCNT_IDOWNLOAD_LISTENER_H_
25 #define _FCNT_IDOWNLOAD_LISTENER_H_
27 #include <FBaseString.h>
28 #include <FBaseRtIEventListener.h>
30 namespace Tizen { namespace Content
34 * @interface IDownloadListener
35 * @brief This interface is used for receiving the download operation events.
39 * The %IDownloadListener interface is used for receiving the download operation events.
41 class _OSP_EXPORT_ IDownloadListener
42 : virtual public Tizen::Base::Runtime::IEventListener
46 * This polymorphic destructor should be overridden if required. @n
47 * This way, the destructors of the derived classes are called when the destructor of this interface is called.
51 virtual ~IDownloadListener(void) {}
54 * Called when a download operation is canceled.
58 * @param[in] reqId The request ID returned by DownloadManager::Start()
60 virtual void OnDownloadCanceled(RequestId reqId) = 0;
63 * Called when a download operation is completed.
67 * @param[in] reqId The request ID returned by DownloadManager::Start()
68 * @param[in] path The path of the downloaded file
70 virtual void OnDownloadCompleted(RequestId reqId, const Tizen::Base::String& path) = 0;
73 * Called when a download operation fails.
77 * @param[in] reqId The request ID returned by DownloadManager::Start()
78 * @param[in] r The error of a download operation @n The following error codes may be given through this argument.
79 * @param[in] errorCode The http error code from the server
80 * @exception E_SUCCESS The method is successful.
81 * @exception E_INVALID_URL The specified URL is invalid.
82 * @exception E_CONNECTION_FAILED The server connection fails.
83 * @exception E_TIMEOUT The connection has timed out.
84 * @exception E_MAX_EXCEEDED The request has exceeded the limit.
85 * @exception E_STORAGE_FULL The storage is full.
86 * @exception E_OUT_OF_MEMORY The memory is insufficient.
87 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
89 virtual void OnDownloadFailed(RequestId reqId, result r, const Tizen::Base::String& errorCode) = 0;
92 * Called when a download operation pauses.
96 * @param[in] reqId The request ID returned by DownloadManager::Start()
98 virtual void OnDownloadPaused(RequestId reqId) = 0;
101 * Called when the progress of download operation is changed.
105 * @param[in] reqId The request ID
106 * @param[in] receivedSize The size of received data in bytes
107 * @param[in] totalSize The total size of data to receive in bytes
109 virtual void OnDownloadInProgress(RequestId reqId, unsigned long long receivedSize, unsigned long long totalSize) = 0;
113 // This method is for internal use only.
114 // Using this method can cause behavioral, security-related, and consistency-related issues in the application.
116 // This method is reserved and may change its name at any time without prior notice.
120 virtual void IDownloadListener_Reserved1(void) {}
123 // This method is for internal use only.
124 // Using this method can cause behavioral, security-related, and consistency-related issues in the application.
126 // This method is reserved and may change its name at any time without prior notice.
130 virtual void IDownloadListener_Reserved2(void) {}
133 // This method is for internal use only.
134 // Using this method can cause behavioral, security-related, and consistency-related issues in the application.
136 // This method is reserved and may change its name at any time without prior notice.
140 virtual void IDownloadListener_Reserved3(void) {}
141 }; // IDownloadListener
143 } } // Tizen::Content
145 #endif // _FCNT_IDOWNLOAD_LISTENER_H_