Init Tizen 2.2.1
[framework/osp/web.git] / inc / FWebCtrlAuthenticationChallenge.h
1 //
2 // Open Service Platform
3 // Copyright (c) 2012 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                FWebCtrlAuthenticationChallenge.h
20  * @brief               This is the header file for the %AuthenticationChallenge class.
21  *
22  * This header file contains the declarations of the %AuthenticationChallenge class.
23  */
24
25 #ifndef _FWEB_CTRL_AUTHENTICATION_CHALLENGE_H_
26 #define _FWEB_CTRL_AUTHENTICATION_CHALLENGE_H_
27
28 #include <FBaseDataType.h>
29 #include <FBaseObject.h>
30 #include <FBaseString.h>
31
32 namespace Tizen { namespace Web { namespace Controls
33 {
34
35 /**
36  *
37  * @class       AuthenticationChallenge
38  * @brief       This class handles the HyperText Transfer Protocol (HTTP) authentication requests.
39  *
40  * @since               2.0
41  *
42  * The %AuthenticationChallenge class sends the user ID and password to the server requesting user authentication.
43  * @n
44  * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/web/controls_namespace.htm">Web Controls Guide</a>.
45  */
46 class _OSP_EXPORT_ AuthenticationChallenge
47         : public Tizen::Base::Object
48 {
49 public:
50         /**
51          * This destructor overrides Tizen::Base::Object::~Object().
52          *
53          * @since               2.0
54          */
55         virtual ~AuthenticationChallenge(void);
56
57         /**
58          * Sends the user ID and password to the host.
59          *
60          * @since               2.0
61          * @privlevel           public
62          * @privilege           %http://tizen.org/privilege/web.service
63          *
64          * @param[in]           userId                                          The user ID for authentication
65          * @param[in]           password                                        The password for authentication
66          * @exception           E_SUCCESS                                       The method is successful.
67          * @exception           E_PRIVILEGE_DENIED                      The application does not have the privilege to call this method.
68          * @exception           E_USER_NOT_CONSENTED            The user has blocked the application from calling this method. @b Since: @b 2.1
69          * @remarks     The specific error code can be accessed using the GetLastResult() method.
70          */
71         void Process(const UserId& userId, const Tizen::Base::String& password);
72
73         /**
74          * Cancels the authentication request.
75          *
76          * @since               2.0
77          * @privlevel           public
78          * @privilege           %http://tizen.org/privilege/web.service
79          *
80          * @exception           E_SUCCESS                                       The method is successful.
81          * @exception           E_PRIVILEGE_DENIED                      The application does not have the privilege to call this method.
82          * @exception           E_USER_NOT_CONSENTED            The user has blocked the application from calling this method. @b Since: @b 2.1
83          * @remarks     The specific error code can be accessed using the GetLastResult() method.
84          */
85         void Cancel(void);
86
87 private :
88         //
89         // This is the constructor for the %AuthenticationChallenge class.
90         //
91         // @remarks             This constructor is hidden.
92         //
93         AuthenticationChallenge(void);
94
95 private:
96         friend class _WebImpl;
97         friend class _AuthenticationChallengeImpl;
98         class _AuthenticationChallengeImpl* __pAuthenticationChallengeImpl;
99 }; // AuthenticationChallenge
100
101 }}} // Tizen::Web::Controls
102 #endif // _FWEB_CTRL_AUTHENTICATION_CHALLENGE_H_