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 FNetHttpHttpCookieStorageManager.h
20 * @brief This is the header file for the %HttpCookieStorageManager class.
22 * This header file contains the declarations of the %HttpCookieStorageManager class.
25 #ifndef _FNET_HTTP_HTTP_COOKIE_STORAGE_MANAGER_H_
26 #define _FNET_HTTP_HTTP_COOKIE_STORAGE_MANAGER_H_
28 #include <FBaseResult.h>
29 #include <FNetHttpHttpTypes.h>
31 namespace Tizen { namespace Net { namespace Http
34 class _HttpCookieStorageManagerImpl;
36 * @class HttpCookieStorageManager
37 * @brief This class provides a collection of %Http cookies of a particular session.
41 * The %HttpCookieStorageManager class instance encapsulates the cookies received by the client in this particular session.
43 * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/net/http_connectivity.htm">HTTP Guide</a>.
45 class _OSP_EXPORT_ HttpCookieStorageManager
46 : public Tizen::Base::Object
51 * Gets the string to be used in the cookie header of the request corresponding to the requested URL.
55 * @return An error code
56 * @param[in] url The request URL
57 * @param[out] cookies The cookie header value @n
58 * For example, cookie-name1=cookie-value1;cookie-name2=cookie-value2.
59 * @exception E_SUCCESS The method is successful.
60 * @exception E_INVALID_ARG The specified @c cookies is an empty string.
61 * @exception E_INVALID_STATE The method invoked is invalid.
63 result GetCookies(const Tizen::Base::String& url, Tizen::Base::String& cookies) const;
66 * Removes all the cookies corresponding to the requested URL from the cookie storage.
70 * @privilege http://tizen.org/privilege/http
72 * @return An error code
73 * @param[in] url The requested URL
74 * @exception E_SUCCESS The method is successful.
75 * @exception E_INVALID_ARG The specified @c url is an empty string.
76 * @exception E_INVALID_STATE The method invoked is invalid.
77 * @exception E_OUT_OF_MEMORY The memory is insufficient.
78 * @exception E_SYSTEM A system error has occurred.
79 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
81 result RemoveCookies(const Tizen::Base::String& url);
84 * Removes all the cookies from the cookie storage.
88 * @privilege http://tizen.org/privilege/http
90 * @return An error code
91 * @exception E_SUCCESS The method is successful.
92 * @exception E_INVALID_STATE The method invoked is invalid.
93 * @exception E_OUT_OF_MEMORY The memory is insufficient.
94 * @exception E_SYSTEM A system error has occurred.
95 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
97 result RemoveAllCookies();
101 * This default constructor is intentionally declared as private so that only the platform can create an instance.
103 HttpCookieStorageManager();
106 * This default constructor is intentionally declared as private so that only the platform can delete an instance.
108 ~HttpCookieStorageManager();
111 * The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
113 * @param[in] rhs An instance of %HttpCookieStorageManager
115 HttpCookieStorageManager(const HttpCookieStorageManager& rhs);
118 * The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
120 * @param[in] rhs An instance of %HttpCookieStorageManager
122 HttpCookieStorageManager& operator =(const HttpCookieStorageManager& rhs);
125 friend class _HttpCookieStorageManagerImpl;
126 _HttpCookieStorageManagerImpl* __pHttpCookieStorageManagerImpl;
128 }; // HttpCookieStorageManager
130 } } } //Tizen::Net::Http
131 #endif // _FNET_HTTP_HTTP_COOKIE_STORAGE_MANAGER_H_