update emoji autocorrect entries from po-files
[LibreOffice.git] / include / ucbhelper / simpleauthenticationrequest.hxx
blob7bc5a402cfdb06f750572dda75a59fbbc58ea402
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef INCLUDED_UCBHELPER_SIMPLEAUTHENTICATIONREQUEST_HXX
21 #define INCLUDED_UCBHELPER_SIMPLEAUTHENTICATIONREQUEST_HXX
23 #include <rtl/ref.hxx>
24 #include <ucbhelper/interactionrequest.hxx>
25 #include <ucbhelper/ucbhelperdllapi.h>
27 namespace com { namespace sun { namespace star { namespace ucb {
28 class URLAuthenticationRequest;
29 } } } }
31 namespace ucbhelper {
33 /**
34 * This class implements a simple authentication interaction request.
35 * Instances can be passed directly to XInteractionHandler::handle(...). Each
36 * instance contains an AuthenticationRequest and three interaction
37 * continuations: "Abort", "Retry" and "SupplyAuthentication". The parameters
38 * for the AuthenticationRequest and the InteractionSupplyAuthentication
39 * objects are partly taken from contructors parameters and partly defaulted
40 * as follows:
42 * Read-only values : servername, realm
43 * Read-write values: username, password, account
44 * All remember-authentication values: RememberAuthentication_NO
46 * @see com::sun::star::ucb::AuthenticationRequest
47 * @see com::sun::star::ucb::RememberAuthentication
48 * @see InteractionAbort
49 * @see InteractionRetry
50 * @see InteractionSupplyAuthentication
52 class UCBHELPER_DLLPUBLIC SimpleAuthenticationRequest : public ucbhelper::InteractionRequest
54 rtl::Reference<
55 ucbhelper::InteractionSupplyAuthentication > m_xAuthSupplier;
57 private:
58 void initialize( const ::com::sun::star::ucb::URLAuthenticationRequest & rRequest,
59 bool bCanSetRealm,
60 bool bCanSetUserName,
61 bool bCanSetPassword,
62 bool bCanSetAccount,
63 bool bAllowPersistentStoring,
64 bool bAllowUseSystemCredentials,
65 bool bAllowSessionStoring = true );
67 public:
68 /** Specification whether some entity (realm, username, password, account)
69 is either not applicable at all, has a fixed value, or is modifiable.
71 enum EntityType
73 ENTITY_NA,
74 ENTITY_FIXED,
75 ENTITY_MODIFY
78 /**
79 * Constructor.
81 * @param rURL contains a URL for which authentication is requested.
82 * @param rServerName contains a server name.
83 * @param rRealm contains a realm, if applicable.
84 * @param rUserName contains a username, if available (for instance from
85 * a previous try).
86 * @param rPassword contains a password, if available (for instance from
87 * a previous try).
88 * @param rAccount contains an account, if applicable.
89 * @param bAllowPersistentStoring specifies if the credentials should
90 * be stored in the passowrd container persistently
91 * @param bAllowUseSystemCredntials specifies if requesting client is
92 * able to obtain and use system credentials for authentication
94 SimpleAuthenticationRequest( const OUString & rURL,
95 const OUString & rServerName,
96 const OUString & rRealm,
97 const OUString & rUserName,
98 const OUString & rPassword,
99 const OUString & rAccount,
100 bool bAllowPersistentStoring,
101 bool bAllowUseSystemCredentials,
102 bool bAllowSessionStoring = true );
106 * Constructor.
108 * @param rServerName contains a server name.
109 * @param eRealmType specifies whether a realm is applicable and
110 modifiable.
111 * @param rRealm contains a realm, if applicable.
112 * @param eUserNameType specifies whether a username is applicable and
113 modifiable.
114 * @param rUserName contains a username, if available (for instance from
115 * a previous try).
116 * @param ePasswordType specifies whether a password is applicable and
117 modifiable.
118 * @param rPassword contains a password, if available (for instance from
119 * a previous try).
120 * @param eAccountType specifies whether an account is applicable and
121 modifiable.
122 * @param rAccount contains an account, if applicable.
124 SimpleAuthenticationRequest( const OUString & rURL,
125 const OUString & rServerName,
126 EntityType eRealmType,
127 const OUString & rRealm,
128 EntityType eUserNameType,
129 const OUString & rUserName,
130 EntityType ePasswordType,
131 const OUString & rPassword,
132 EntityType eAccountType = ENTITY_NA,
133 const OUString & rAccount
134 = OUString() );
137 * This method returns the supplier for the missing authentication data,
138 * that, for instance can be used to query the password supplied by the
139 * interaction handler.
141 * @return the supplier for the missing authentication data.
143 const rtl::Reference< ucbhelper::InteractionSupplyAuthentication > &
144 getAuthenticationSupplier() const { return m_xAuthSupplier; }
147 } // namespace ucbhelper
149 #endif /* ! INCLUDED_UCBHELPER_SIMPLEAUTHENTICATIONREQUEST_HXX */
151 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */