Merge "[content] Change codes fabout content path not including extension" into tizen_2.2
[platform/framework/native/content.git] / inc / FCntIContentTransferListener.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  * @if OSPDEPREC
18  * @file                        FCntIContentTransferListener.h
19  * @brief               This is the header file for the %IContentTransferListener interface.
20  *
21  * This header file contains the declarations of the %IContentTransferListener interface.
22  * @endif
23  */
24
25 #ifndef _FCNT_ICONTENT_TRANSFER_LISTENER_H_
26 #define _FCNT_ICONTENT_TRANSFER_LISTENER_H_
27
28 #include <FBaseRtIEventListener.h>
29 #include <FCntTypes.h>
30
31 namespace Tizen { namespace Base
32 {
33 class ByteBuffer;
34 }}
35
36 namespace Tizen { namespace Content
37 {
38 /**
39  * @if OSPDEPREC
40  * @interface IContentTransferListener
41  * @brief       <i> [Deprecated] </i> This interface provides event handlers that receive the events associated with ContentTransfer.
42  *
43  * @deprecated  This class is deprecated. Instead of using this class, use DownloadManager class.
44  * @since       2.0
45  *
46  * The %IContentTransferListener interface handles the content download events.
47  * @endif
48  */
49 class _OSP_EXPORT_ IContentTransferListener
50         : virtual public Tizen::Base::Runtime::IEventListener
51 {
52 public:
53         /**
54          * This polymorphic destructor should be overridden if required. @n
55          * This way, the destructors of the derived classes are called when the destructor of this interface is called.
56          *
57          * @brief       <i> [Deprecated] </i>
58          * @deprecated  This class is deprecated. Instead of using this class, use DownloadManager class.
59          * @since       2.0
60          */
61         virtual ~IContentTransferListener(void) {}
62
63         /**
64          * Called when the content transfer is in progress.
65          *
66          * @brief       <i> [Deprecated] </i>
67          * @deprecated  This class is deprecated. Instead of using this class, use DownloadManager class.
68          * @since                       2.0
69          *
70          * @param[in]   reqId                   The request ID
71          * @param[in]   totalTransferedSize             The total size of the data to transfer in bytes
72          */
73         virtual void OnContentTransferInProgress(RequestId reqId, int totalTransferedSize) = 0;
74
75         /**
76          * Called when a download operation is completed.
77          *
78          * @brief       <i> [Deprecated] </i>
79          * @deprecated  This class is deprecated. Instead of using this class, use DownloadManager class.
80          * @since                       2.0
81          *
82          * @param[in]   reqId           The request ID
83          * @param[in]   contentId       The registered content ID
84          * @param[in]   r                       The result of the download
85          * @param[in]   errorCode       The error code from the server
86          * @param[in]   errorMessage    The error message from the server
87          * @exception   E_SUCCESS               The method is successful.
88          * @exception   E_SERVER                An error has occurred on the server side.
89          * @exception   E_CONNECTION_FAILED The server connection has failed.
90          * @exception   E_ILLEGAL_ACCESS        The request to access a server is illegal.
91          * @exception   E_STORAGE_FULL          The storage is full.
92          * @exception   E_OUT_OF_MEMORY         The memory is insufficient.
93          * @exception   E_SYSTEM                A system error has occurred.
94          */
95         virtual void OnContentDownloadCompleted(RequestId reqId, ContentId contentId, result r, const Tizen::Base::String& errorCode, const Tizen::Base::String& errorMessage) = 0;
96
97         /**
98          * Called when a download to buffer operation is completed.
99          *
100          * @brief       <i> [Deprecated] </i>
101          * @deprecated  This class is deprecated. Instead of using this class, use DownloadManager class.
102          * @since                       2.0
103          *
104          * @param[in]   reqId           The request ID
105          * @param[in]   pBuffer         The binary buffer that has been downloaded
106          * @param[in]   r                       The result of the download
107          * @param[in]   errorCode       The error code from the server
108          * @param[in]   errorMessage    The error message from the server
109          * @exception   E_SUCCESS               The method is successful.
110          * @exception   E_SERVER                An error has occurred on the server side.
111          * @exception   E_FILE_ALREADY_EXIST The specified file already exists.
112          * @exception   E_STORAGE_FULL          The storage is full.
113          * @exception   E_CONNECTION_FAILED The server connection has failed.
114          * @exception   E_ILLEGAL_ACCESS        The request to access a server is illegal.
115          * @exception   E_OUT_OF_MEMORY         The memory is insufficient.
116          * @exception   E_SYSTEM                A system error has occurred.
117          */
118         virtual void OnContentDownloadToBufferCompleted(RequestId reqId, Tizen::Base::ByteBuffer* pBuffer, result r, const Tizen::Base::String& errorCode, const Tizen::Base::String& errorMessage) = 0;
119
120         /**
121         * Called when a transfer operation is cancelled.
122          *
123          * @brief       <i> [Deprecated] </i>
124          * @deprecated  This class is deprecated. Instead of using this class, use DownloadManager class.
125          * @since                       2.0
126          *
127          * @param[in]   reqId           The request ID
128          * @param[in]   r                       The result of the transfer
129          * @param[in]   errorCode       The error code from the server
130          * @param[in]   errorMessage    The error message from the server
131          * @exception   E_SUCCESS               The method is successful.
132          * @exception   E_SERVER                An error has occurred on the server side.
133          */
134         virtual void OnContentTransferCanceled(RequestId reqId, result r, const Tizen::Base::String& errorCode, const Tizen::Base::String& errorMessage) = 0;
135
136 protected:
137
138         //
139         // This method is for internal use only.
140         // Using this method can cause behavioral, security-related, and consistency-related issues in the application.
141         //
142         // This method is reserved and may change its name at any time without prior notice.
143         //
144         // @since               2.0
145         //
146         virtual void IContentTransferListener_Reserved1(void) {}
147
148         //
149         // This method is for internal use only.
150         // Using this method can cause behavioral, security-related, and consistency-related issues in the application.
151         //
152         // This method is reserved and may change its name at any time without prior notice.
153         //
154         // @since               2.0
155         //
156         virtual void IContentTransferListener_Reserved2(void) {}
157
158 };  // class IContentTransferListener
159
160 }} // Tizen::Content
161
162 #endif // _FCNT_ICONTENT_TRANSFER_LISTENER_H_