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 FCntIDownloadListener.h
18 * @brief This is the header file for the %IDownloadListener interface.
20 * This header file contains the declarations of the %IDownloadListener interface.
23 #ifndef _FCNT_IDOWNLOAD_LISTENER_H_
24 #define _FCNT_IDOWNLOAD_LISTENER_H_
26 #include <FBaseString.h>
27 #include <FBaseRtIEventListener.h>
29 namespace Tizen { namespace Content
33 * @interface IDownloadListener
34 * @brief This interface is used for receiving the download operation events.
38 * The %IDownloadListener interface is used for receiving the download operation events.
40 class _OSP_EXPORT_ IDownloadListener
41 : virtual public Tizen::Base::Runtime::IEventListener
45 * This polymorphic destructor should be overridden if required. @n
46 * This way, the destructors of the derived classes are called when the destructor of this interface is called.
50 virtual ~IDownloadListener(void) {}
53 * Called when the download operation is cancelled.
57 * @param[in] reqId The request ID returned by DownloadManager::Start()
59 virtual void OnDownloadCanceled(RequestId reqId) = 0;
62 * Called when the download operation is completed.
66 * @param[in] reqId The request ID returned by DownloadManager::Start()
67 * @param[in] path The path of the downloaded file
69 virtual void OnDownloadCompleted(RequestId reqId, const Tizen::Base::String& path) = 0;
72 * Called when the download operation fails.
76 * @param[in] reqId The request ID returned by DownloadManager::Start()
77 * @param[in] r The error of the download operation @n
78 * 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 failed.
83 * @exception E_TIMEOUT The connection has timed out.
84 * @exception E_MAX_EXCEEDED The request has exceeded the maximum 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 the 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 the download operation is changed.
105 * @param[in] reqId The request ID
106 * @param[in] receivedSize The size of the received data in bytes
107 * @param[in] totalSize The total size of the 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_