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 FNetHttpHttpCredentials.h
20 * @brief This is the header file for the %HttpCredentials class.
22 * This header file contains the declarations of the %HttpCredentials class.
25 #ifndef _FNET_HTTP_HTTP_CREDENTIALS_H_
26 #define _FNET_HTTP_HTTP_CREDENTIALS_H_
28 #include <FNetHttpHttpTypes.h>
30 namespace Tizen { namespace Net { namespace Http
33 /////////////////////////////////////////////////////////////////////////////
35 * @class HttpCredentials
36 * @brief This class represents the credentials required for authentication.
40 * The %HttpCredentials class represents the credentials required for authentication, that is, the user name and password.
42 * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/net/http_connectivity.htm">HTTP Guide</a>.
44 //////////////////////////////////////////////////////////////////////////
45 class _OSP_EXPORT_ HttpCredentials
46 : public Tizen::Base::Object
51 * This is the default constructor for this class.
55 HttpCredentials(void);
58 * Initializes an instance of %HttpCredentials with the specified user name and password.
62 * @param[in] name The user name string
63 * @param[in] password The password string
65 HttpCredentials(const Tizen::Base::String& name, const Tizen::Base::String& password);
68 * Copying of objects using this copy constructor is allowed.
72 * @param[in] rhs An instance of %HttpCredentials
74 HttpCredentials(const HttpCredentials& rhs);
77 * This destructor overrides Tizen::Base::Object::~Object().
81 virtual ~HttpCredentials(void);
84 * Copying of objects using this copy assignment operator is allowed.
88 * @param[in] rhs An instance of %HttpCredentials
90 HttpCredentials& operator =(const HttpCredentials& rhs);
93 * Sets the user name for the current instance of %HttpCredentials.
97 * @privilege %http://tizen.org/privilege/http
99 * @param[in] name The user name string
100 * @exception E_SUCCESS The method is successful.
101 * @exception E_INVALID_ARG The specified input parameter is invalid.
102 * @exception E_OUT_OF_MEMORY The memory is insufficient.
103 * @exception E_SYSTEM A system error has occurred.
104 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
106 result SetName(const Tizen::Base::String& name);
109 * Sets the password for the current instance of %HttpCredentials.
113 * @privilege %http://tizen.org/privilege/http
115 * @param[in] password The password string
116 * @exception E_SUCCESS The method is successful.
117 * @exception E_INVALID_ARG The specified input parameter is invalid.
118 * @exception E_OUT_OF_MEMORY The memory is insufficient.
119 * @exception E_SYSTEM A system error has occurred.
120 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
122 result SetPassword(const Tizen::Base::String& password);
125 * Gets the user name of the current instance of %HttpCredentials.
129 * @privilege %http://tizen.org/privilege/http
131 * @return The user name
132 * @exception E_SUCCESS The method is successful.
133 * @exception E_OUT_OF_MEMORY The memory is insufficient.
134 * @exception E_SYSTEM A system error has occurred.
135 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
136 * @remarks The specific error code can be accessed using the GetLastResult() method.
138 Tizen::Base::String GetName(void) const;
141 * Gets the password of the current instance of %HttpCredentials.
145 * @privilege %http://tizen.org/privilege/http
147 * @return The password
148 * @exception E_SUCCESS The method is successful.
149 * @exception E_OUT_OF_MEMORY The memory is insufficient.
150 * @exception E_SYSTEM A system error has occurred.
151 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
152 * @remarks The specific error code can be accessed using the GetLastResult() method.
154 Tizen::Base::String GetPassword(void) const;
157 * Compares the specified instance of %HttpCredentials with the calling instance.
161 * @return @c true if the values match, @n
163 * @param[in] rhs The other Tizen::Base::Object to compare
164 * @see Tizen::Base::Object::Equals()
166 virtual bool Equals(const Tizen::Base::Object& rhs) const;
169 * Gets the hash value of the current instance.
173 * @return The hash value of the current instance
175 virtual int GetHashCode(void) const;
178 Tizen::Base::String __userName;
179 Tizen::Base::String __password;
181 friend class HttpCredentialsImpl;
182 class HttpCredentialsImpl* __pHttpCredentialsImpl;
184 }; // HttpCredentials
186 } } } //Tizen::Net::Http
187 #endif // _FNET_HTTP_HTTP_CREDENTIALS_H_