[content] Fix a description for ContentManager
[platform/framework/native/content.git] / inc / FCntIDownloadListener.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                FCntIDownloadListener.h
19  * @brief               This is the header file for the %IDownloadListener interface.
20  *
21  * This header file contains the declarations of the %IDownloadListener interface.
22  */
23
24 #ifndef _FCNT_IDOWNLOAD_LISTENER_H_
25 #define _FCNT_IDOWNLOAD_LISTENER_H_
26
27 #include <FBaseString.h>
28 #include <FBaseRtIEventListener.h>
29
30 namespace Tizen { namespace Content
31 {
32
33 /**
34 * @interface IDownloadListener
35 * @brief    This interface is used for receiving the download operation events.
36 *
37 * @since 2.0
38 *
39 * The %IDownloadListener interface is used for receiving the download operation events.
40 */
41 class _OSP_EXPORT_ IDownloadListener
42         : virtual public Tizen::Base::Runtime::IEventListener
43 {
44 public:
45         /**
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.
48          *
49          * @since 2.0
50          */
51         virtual ~IDownloadListener(void) {}
52
53         /**
54          * Called when a download operation is canceled.
55          *
56          * @since 2.0
57          *
58          * @param[in] reqId           The request ID returned by DownloadManager::Start()
59          */
60         virtual void OnDownloadCanceled(RequestId reqId) = 0;
61
62         /**
63          * Called when a download operation is completed.
64          *
65          * @since 2.0
66          *
67          * @param[in] reqId           The request ID returned by DownloadManager::Start()
68          * @param[in] path            The path of the downloaded file
69          */
70         virtual void OnDownloadCompleted(RequestId reqId, const Tizen::Base::String& path) = 0;
71
72         /**
73          * Called when a download operation fails.
74          *
75          * @since 2.0
76          *
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.
88          */
89         virtual void OnDownloadFailed(RequestId reqId, result r, const Tizen::Base::String& errorCode) = 0;
90
91         /**
92          * Called when a download operation pauses.
93          *
94          * @since 2.0
95          *
96          * @param[in] reqId           The request ID returned by DownloadManager::Start()
97          */
98         virtual void OnDownloadPaused(RequestId reqId) = 0;
99
100         /**
101          * Called when the progress of download operation is changed.
102          *
103          * @since 2.0
104          *
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
108          */
109         virtual void OnDownloadInProgress(RequestId reqId, unsigned long long receivedSize, unsigned long long totalSize) = 0;
110
111 protected:
112         //
113         // This method is for internal use only.
114         // Using this method can cause behavioral, security-related, and consistency-related issues in the application.
115         //
116         // This method is reserved and may change its name at any time without prior notice.
117         //
118         // @since 2.0
119         //
120         virtual void IDownloadListener_Reserved1(void) {}
121
122         //
123         // This method is for internal use only.
124         // Using this method can cause behavioral, security-related, and consistency-related issues in the application.
125         //
126         // This method is reserved and may change its name at any time without prior notice.
127         //
128         // @since 2.0
129         //
130         virtual void IDownloadListener_Reserved2(void) {}
131
132         //
133         // This method is for internal use only.
134         // Using this method can cause behavioral, security-related, and consistency-related issues in the application.
135         //
136         // This method is reserved and may change its name at any time without prior notice.
137         //
138         // @since 2.0
139         //
140         virtual void IDownloadListener_Reserved3(void) {}
141 }; // IDownloadListener
142
143 } } // Tizen::Content
144
145 #endif // _FCNT_IDOWNLOAD_LISTENER_H_