2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
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
9 // http://www.apache.org/licenses/LICENSE-2.0
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.
19 * @file FNetHttpIHttpProgressEventListener.h
20 * @brief This is the header file for the %IHttpProgressEventListener interface.
22 * This header file contains the declarations of the %IHttpProgressEventListener interface.
25 #ifndef _FNET_HTTP_IHTTP_PROGRESS_EVENT_LISTENER_H_
26 #define _FNET_HTTP_IHTTP_PROGRESS_EVENT_LISTENER_H_
28 #include <FBaseTypes.h>
29 #include <FBaseRtIEventListener.h>
31 namespace Tizen { namespace Net { namespace Http
34 class HttpTransaction;
36 * @interface IHttpProgressEventListener
37 * @brief This interface provides the listeners for the HTTP progress events.
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.
45 class _OSP_EXPORT_ IHttpProgressEventListener
46 : virtual public Tizen::Base::Runtime::IEventListener
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.
55 virtual ~IHttpProgressEventListener(void) {}
59 * Called to notify when the content body of the request message is being uploaded.
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.
69 virtual void OnHttpUploadInProgress(HttpSession& httpSession, HttpTransaction& httpTransaction, long long currentLength, long long totalLength) = 0;
72 * Called to notify when the content body of the response message is being downloaded.
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.
82 virtual void OnHttpDownloadInProgress(HttpSession& httpSession, HttpTransaction& httpTransaction, long long currentLength, long long totalLength) = 0;
85 // Reserved virtual methods for later extension.
88 // This method is for internal use only. Using this method can cause behavioral, security-related, and consistency-related issues in the application.
90 // This method is reserved and may change its name at any time without prior notice.
94 virtual void IHttpProgressEventListener_Reserved1(void) {}
97 // This method is for internal use only. Using this method can cause behavioral, security-related, and consistency-related issues in the application.
99 // This method is reserved and may change its name at any time without prior notice.
103 virtual void IHttpProgressEventListener_Reserved2(void) {}
106 // This method is for internal use only. Using this method can cause behavioral, security-related, and consistency-related issues in the application.
108 // This method is reserved and may change its name at any time without prior notice.
112 virtual void IHttpProgressEventListener_Reserved3(void) {}
115 } } } // Tizen::Net::Http
116 #endif // _FNET_HTTP_IHTTP_PROGRESS_EVENT_LISTENER_H_