Fixed bug.
[platform/framework/native/net.git] / inc / FNetHttpIHttpProgressEventListener.h
1 //
2 // Open Service Platform
3 // Copyright (c) 2012-2013 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 /**
19  * @file                FNetHttpIHttpProgressEventListener.h
20  * @brief               This is the header file for the %IHttpProgressEventListener interface.
21  *
22  * This header file contains the declarations of the %IHttpProgressEventListener interface.
23  */
24
25 #ifndef _FNET_HTTP_IHTTP_PROGRESS_EVENT_LISTENER_H_
26 #define _FNET_HTTP_IHTTP_PROGRESS_EVENT_LISTENER_H_
27
28 #include <FBaseTypes.h>
29 #include <FBaseRtIEventListener.h>
30
31 namespace Tizen { namespace Net { namespace Http
32 {
33 class HttpSession;
34 class HttpTransaction;
35 /**
36  * @interface   IHttpProgressEventListener
37  * @brief               This interface provides the listeners for the HTTP progress events.
38  *
39  * @since       2.0
40  *
41  *  The %IHttpProgressEventListener interface is the listener for the HTTP progress events, when the HTTP message is uploaded or downloaded. In order to use this listener,
42  *      the listener must be set to the HttpTransaction instance using the HttpTransaction::SetHttpProgressListener() method.
43  */
44
45 class _OSP_EXPORT_ IHttpProgressEventListener
46         : virtual public Tizen::Base::Runtime::IEventListener
47 {
48
49 public:
50         /**
51         * This polymorphic destructor should be overridden if required. This way, the destructors of the derived classes are called when the destructor of this interface is called.
52         *
53         * @since 2.0
54         */
55         virtual ~IHttpProgressEventListener(void) {}
56
57 public:
58         /**
59          * Called to notify when the content body of the request message is being uploaded.
60          *
61          * @since       2.0
62          *
63          * @param[in]   httpSession                             The session information of the %Http transaction event
64          * @param[in]   httpTransaction                 The transaction information of the %Http transaction event
65          * @param[in]   currentLength                   The current length of the uploaded data (in bytes)
66          * @param[in]   totalLength                             The total length of the data (in bytes) to upload
67          * @remarks             If the content length of the request message is not set, the value of @c totalLength is -1.
68          */
69         virtual void OnHttpUploadInProgress(HttpSession& httpSession, HttpTransaction& httpTransaction, long long currentLength, long long totalLength) = 0;
70
71         /**
72          * Called to notify when the content body of the response message is being downloaded.
73          *
74          * @since       2.0
75          *
76          * @param[in]   httpSession                             The session information of the %Http transaction event
77          * @param[in]   httpTransaction                 The transaction information of the %Http transaction event
78          * @param[in]   currentLength                   The current length of the downloaded data (in bytes)
79          * @param[in]   totalLength                             The total length of the data (in bytes) to download
80          * @remarks             If the content length of the response message is not set, the value of @c totalLength is -1.
81          */
82         virtual void OnHttpDownloadInProgress(HttpSession& httpSession, HttpTransaction& httpTransaction, long long currentLength, long long totalLength) = 0;
83
84 protected:
85         // Reserved virtual methods for later extension.
86
87         //
88         // This method is for internal use only. Using this method can cause behavioral, security-related, and consistency-related issues in the application.
89         //
90         // This method is reserved and may change its name at any time without prior notice.
91         //
92         // @since       2.0
93         //
94         virtual void IHttpProgressEventListener_Reserved1(void) {}
95
96         //
97         // This method is for internal use only. Using this method can cause behavioral, security-related, and consistency-related issues in the application.
98         //
99         // This method is reserved and may change its name at any time without prior notice.
100         //
101         // @since       2.0
102         //
103         virtual void IHttpProgressEventListener_Reserved2(void) {}
104
105         //
106         // This method is for internal use only. Using this method can cause behavioral, security-related, and consistency-related issues in the application.
107         //
108         // This method is reserved and may change its name at any time without prior notice.
109         //
110         // @since       2.0
111         //
112         virtual void IHttpProgressEventListener_Reserved3(void) {}
113 };
114
115 } } } // Tizen::Net::Http
116 #endif // _FNET_HTTP_IHTTP_PROGRESS_EVENT_LISTENER_H_