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 FNetHttpIHttpEntity.h
20 * @brief This is the header file for the %IHttpEntity interface.
22 * This header file contains the declarations of the %IHttpEntity interface.
25 #ifndef _FNET_HTTP_IHTTP_ENTITY_H_
26 #define _FNET_HTTP_IHTTP_ENTITY_H_
28 #include <FBaseTypes.h>
29 #include <FBaseString.h>
30 #include <FBaseByteBuffer.h>
31 #include <FNetHttpHttpTypes.h>
33 namespace Tizen { namespace Net { namespace Http
35 class _HttpRequestImpl;
37 * @interface IHttpEntity
38 * @brief This interface provides common functions for the HTTP entity.
42 * The %IHttpEntity interface represents the HTTP entity for the data exchanged between the client and the server.
46 class _OSP_EXPORT_ IHttpEntity
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 ~IHttpEntity(void) {}
59 * Gets the length of the request content.
63 * @return The length of the content, @n
64 * else @c -1 if the content length is unknown
66 virtual long long GetContentLength(void) const = 0;
69 * Gets the type of the request content.
73 * @return The type of the content
75 virtual Tizen::Base::String GetContentType(void) const = 0;
79 * Checks whether the next data exists.
83 * @return @c true if the next data exists, @n
85 * @exception E_SUCCESS The method is successful.
86 * @exception E_OUT_OF_MEMORY The memory is insufficient.
87 * @exception E_INVALID_STATE The method invoked is invalid.
88 * @exception E_SYSTEM A system error has occurred.
89 * @remarks The specific error code can be accessed using the GetLastResult() method.
91 virtual bool HasNextData(void) = 0;
98 * @return The buffer to be read
99 * @param[in] recommendedSize The recommended size of the data to send
100 * @exception E_SUCCESS The method is successful.
101 * @exception E_OUT_OF_MEMORY The memory is insufficient.
102 * @exception E_INVALID_STATE The method invoked is invalid.
103 * @exception E_SYSTEM A system error has occurred.
104 * @remarks The specific error code can be accessed using the GetLastResult() method.
106 virtual Tizen::Base::ByteBuffer* GetNextDataN(int recommendedSize) = 0;
109 // Reserved virtual methods for later extension.
112 // This method is for internal use only. Using this method can cause behavioral, security-related, and consistency-related issues in the application.
114 // This method is reserved and may change its name at any time without prior notice.
118 virtual void IHttpEntity_Reserved1(void) {}
121 // This method is for internal use only. Using this method can cause behavioral, security-related, and consistency-related issues in the application.
123 // This method is reserved and may change its name at any time without prior notice.
127 virtual void IHttpEntity_Reserved2(void) {}
130 // This method is for internal use only. Using this method can cause behavioral, security-related, and consistency-related issues in the application.
132 // This method is reserved and may change its name at any time without prior notice.
136 virtual void IHttpEntity_Reserved3(void) {}
138 friend class _HttpRequestImpl;
141 } } } // Tizen::Net::Http
142 #endif // _FNET_HTTP_IHTTP_ENTITY_H_