remove Doxygen warning
[platform/framework/native/net.git] / inc / FNetHttpIHttpEntity.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                FNetHttpIHttpEntity.h
20  * @brief               This is the header file for the %IHttpEntity interface.
21  *
22  * This header file contains the declarations of the %IHttpEntity interface.
23  */
24
25 #ifndef _FNET_HTTP_IHTTP_ENTITY_H_
26 #define _FNET_HTTP_IHTTP_ENTITY_H_
27
28 #include <FBaseTypes.h>
29 #include <FBaseString.h>
30 #include <FBaseByteBuffer.h>
31 #include <FNetHttpHttpTypes.h>
32
33 namespace Tizen { namespace Net { namespace Http
34 {
35 class _HttpRequestImpl;
36 /**
37  * @interface   IHttpEntity
38  * @brief               This interface provides common functions for the HTTP entity.
39  *
40  * @since       2.0
41  *
42  *      The %IHttpEntity interface represents the HTTP entity for the data exchanged between the client and the server.
43  */
44
45
46 class _OSP_EXPORT_ IHttpEntity
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 ~IHttpEntity(void) {}
56
57 public:
58         /**
59          * Gets the length of the request content.
60          *
61          * @since       2.0
62          *
63          * @return              The length of the content, @n
64          *                              else @c -1 if the content length is unknown
65          */
66         virtual long long GetContentLength(void) const = 0;
67
68         /**
69          * Gets the type of the request content.
70          *
71          * @since       2.0
72          *
73          * @return              The type of the content
74          */
75         virtual Tizen::Base::String GetContentType(void) const = 0;
76
77 protected:
78         /**
79          * Checks whether the next data exists.
80          *
81          * @since       2.0
82          *
83          * @return              @c true if the next data exists, @n
84          *                              else @c false
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.
90          */
91         virtual bool HasNextData(void) = 0;
92
93         /**
94          * Gets the next data.
95          *
96          * @since       2.0
97          *
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.
105          */
106         virtual Tizen::Base::ByteBuffer* GetNextDataN(int recommendedSize) = 0;
107
108 protected:
109         // Reserved virtual methods for later extension.
110
111         //
112         // This method is for internal use only. Using this method can cause behavioral, security-related, and consistency-related issues in the application.
113         //
114         // This method is reserved and may change its name at any time without prior notice.
115         //
116         // @since       2.0
117         //
118         virtual void IHttpEntity_Reserved1(void) {}
119
120         //
121         // This method is for internal use only. Using this method can cause behavioral, security-related, and consistency-related issues in the application.
122         //
123         // This method is reserved and may change its name at any time without prior notice.
124         //
125         // @since       2.0
126         //
127         virtual void IHttpEntity_Reserved2(void) {}
128
129         //
130         // This method is for internal use only. Using this method can cause behavioral, security-related, and consistency-related issues in the application.
131         //
132         // This method is reserved and may change its name at any time without prior notice.
133         //
134         // @since       2.0
135         //
136         virtual void IHttpEntity_Reserved3(void) {}
137
138         friend class _HttpRequestImpl;
139 };
140
141 } } } // Tizen::Net::Http
142 #endif // _FNET_HTTP_IHTTP_ENTITY_H_