update header for Doxygen
[platform/framework/native/content.git] / inc / FCntIDownloadListener.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                FCntIDownloadListener.h
18  * @brief               This is the header file for the %IDownloadListener interface.
19  *
20  * This header file contains the declarations of the %IDownloadListener interface.
21  */
22
23 #ifndef _FCNT_IDOWNLOAD_LISTENER_H_
24 #define _FCNT_IDOWNLOAD_LISTENER_H_
25
26 #include <FBaseString.h>
27 #include <FBaseRtIEventListener.h>
28
29 namespace Tizen { namespace Content
30 {
31
32 /**
33 * @interface IDownloadListener
34 * @brief    This interface is used for receiving the download operation events.
35 *
36 * @since 2.0
37 *
38 * The %IDownloadListener interface is used for receiving the download operation events.
39 */
40 class _OSP_EXPORT_ IDownloadListener
41         : virtual public Tizen::Base::Runtime::IEventListener
42 {
43 public:
44         /**
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.
47          *
48          * @since 2.0
49          */
50         virtual ~IDownloadListener(void) {}
51
52         /**
53          * Called when a download operation is canceled.
54          *
55          * @since 2.0
56          *
57          * @param[in] reqId           The request ID returned by DownloadManager::Start()
58          */
59         virtual void OnDownloadCanceled(RequestId reqId) = 0;
60
61         /**
62          * Called when a download operation is completed.
63          *
64          * @since 2.0
65          *
66          * @param[in] reqId           The request ID returned by DownloadManager::Start()
67          * @param[in] path            The path of the downloaded file
68          */
69         virtual void OnDownloadCompleted(RequestId reqId, const Tizen::Base::String& path) = 0;
70
71         /**
72          * Called when a download operation fails.
73          *
74          * @since 2.0
75          *
76          * @param[in] reqId           The request ID returned by DownloadManager::Start()
77          * @param[in] r               The error of a download operation @n The following error codes may be given through this argument.
78          * @param[in] errorCode         The http error code from the server
79          * @exception E_SUCCESS                 The method is successful.
80          * @exception E_INVALID_URL             The specified URL is invalid.
81          * @exception E_CONNECTION_FAILED       The server connection fails.
82          * @exception E_TIMEOUT                 The connection has timed out.
83          * @exception E_MAX_EXCEEDED    The request has exceeded the limit.
84          * @exception E_STORAGE_FULL    The storage is full.
85          * @exception E_OUT_OF_MEMORY   The memory is insufficient.
86          * @exception E_SYSTEM                  The method cannot proceed due to a severe system error.
87          */
88         virtual void OnDownloadFailed(RequestId reqId, result r, const Tizen::Base::String& errorCode) = 0;
89
90         /**
91          * Called when a download operation pauses.
92          *
93          * @since 2.0
94          *
95          * @param[in] reqId           The request ID returned by DownloadManager::Start()
96          */
97         virtual void OnDownloadPaused(RequestId reqId) = 0;
98
99         /**
100          * Called when the progress of download operation is changed.
101          *
102          * @since 2.0
103          *
104          * @param[in] reqId           The request ID
105          * @param[in] receivedSize    The size of received data in bytes
106          * @param[in] totalSize       The total size of data to receive in bytes
107          */
108         virtual void OnDownloadInProgress(RequestId reqId, unsigned long long receivedSize, unsigned long long totalSize) = 0;
109
110 protected:
111         //
112         // This method is for internal use only.
113         // Using this method can cause behavioral, security-related, and consistency-related issues in the application.
114         //
115         // This method is reserved and may change its name at any time without prior notice.
116         //
117         // @since 2.0
118         //
119         virtual void IDownloadListener_Reserved1(void) {}
120
121         //
122         // This method is for internal use only.
123         // Using this method can cause behavioral, security-related, and consistency-related issues in the application.
124         //
125         // This method is reserved and may change its name at any time without prior notice.
126         //
127         // @since 2.0
128         //
129         virtual void IDownloadListener_Reserved2(void) {}
130
131         //
132         // This method is for internal use only.
133         // Using this method can cause behavioral, security-related, and consistency-related issues in the application.
134         //
135         // This method is reserved and may change its name at any time without prior notice.
136         //
137         // @since 2.0
138         //
139         virtual void IDownloadListener_Reserved3(void) {}
140 }; // IDownloadListener
141
142 } } // Tizen::Content
143
144 #endif // _FCNT_IDOWNLOAD_LISTENER_H_