tdf#130857 qt weld: Implement QtInstanceWidget::strip_mnemonic
[LibreOffice.git] / ucbhelper / source / provider / interactionrequest.cxx
blob1e4ca4dab319924de956128c21304c720e8af635
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 #include <ucbhelper/interactionrequest.hxx>
22 #include <rtl/ref.hxx>
23 #include <osl/diagnose.h>
24 #include <cppuhelper/typeprovider.hxx>
25 #include <cppuhelper/queryinterface.hxx>
26 #include <utility>
28 using namespace com::sun::star;
29 using namespace ucbhelper;
32 // InteractionRequest Implementation.
35 namespace ucbhelper
38 struct InteractionRequest_Impl
40 rtl::Reference< InteractionContinuation > m_xSelection;
41 css::uno::Any m_aRequest;
42 css::uno::Sequence<
43 css::uno::Reference<
44 css::task::XInteractionContinuation > > m_aContinuations;
46 InteractionRequest_Impl() {}
47 explicit InteractionRequest_Impl( uno::Any aRequest )
48 : m_aRequest(std::move( aRequest )) {}
54 InteractionRequest::InteractionRequest()
55 : m_pImpl( new InteractionRequest_Impl )
60 InteractionRequest::InteractionRequest( const uno::Any & rRequest )
61 : m_pImpl( new InteractionRequest_Impl( rRequest ) )
66 // virtual
67 InteractionRequest::~InteractionRequest()
72 void InteractionRequest::setRequest( const uno::Any & rRequest )
74 m_pImpl->m_aRequest = rRequest;
78 void InteractionRequest::setContinuations(
79 const uno::Sequence< uno::Reference<
80 task::XInteractionContinuation > > & rContinuations )
82 m_pImpl->m_aContinuations = rContinuations;
86 rtl::Reference< InteractionContinuation > const &
87 InteractionRequest::getSelection() const
89 return m_pImpl->m_xSelection;
93 void InteractionRequest::setSelection(
94 const rtl::Reference< InteractionContinuation > & rxSelection )
96 m_pImpl->m_xSelection = rxSelection;
100 // XInterface methods.
103 // XInteractionRequest methods.
106 // virtual
107 uno::Any SAL_CALL InteractionRequest::getRequest()
109 return m_pImpl->m_aRequest;
113 // virtual
114 uno::Sequence< uno::Reference< task::XInteractionContinuation > > SAL_CALL
115 InteractionRequest::getContinuations()
117 return m_pImpl->m_aContinuations;
121 // InteractionContinuation Implementation.
124 InteractionContinuation::InteractionContinuation(
125 InteractionRequest * pRequest )
126 : m_pRequest( pRequest )
131 // virtual
132 InteractionContinuation::~InteractionContinuation()
137 void InteractionContinuation::recordSelection()
139 m_pRequest->setSelection( this );
143 // InteractionAbort Implementation.
146 // XInteractionContinuation methods.
149 // virtual
150 void SAL_CALL InteractionAbort::select()
152 recordSelection();
156 // InteractionRetry Implementation.
159 // XInteractionContinuation methods.
162 // virtual
163 void SAL_CALL InteractionRetry::select()
165 recordSelection();
169 // InteractionApprove Implementation.
172 // XInteractionContinuation methods.
175 // virtual
176 void SAL_CALL InteractionApprove::select()
178 recordSelection();
182 // InteractionDisapprove Implementation.
185 // XInteractionContinuation methods.
188 // virtual
189 void SAL_CALL InteractionDisapprove::select()
191 recordSelection();
195 // InteractionSupplyAuthentication Implementation.
198 // XInteractionContinuation methods.
201 // virtual
202 void SAL_CALL InteractionSupplyAuthentication::select()
204 recordSelection();
208 // XInteractionSupplyAuthentication methods.
211 // virtual
212 sal_Bool SAL_CALL
213 InteractionSupplyAuthentication::canSetRealm()
215 return m_bCanSetRealm;
219 // virtual
220 void SAL_CALL
221 InteractionSupplyAuthentication::setRealm( const OUString& Realm )
223 OSL_ENSURE( m_bCanSetPassword,
224 "InteractionSupplyAuthentication::setRealm - Not supported!" );
226 if ( m_bCanSetRealm )
227 m_aRealm = Realm;
231 // virtual
232 sal_Bool SAL_CALL
233 InteractionSupplyAuthentication::canSetUserName()
235 return m_bCanSetUserName;
239 // virtual
240 void SAL_CALL
241 InteractionSupplyAuthentication::setUserName( const OUString& UserName )
243 OSL_ENSURE( m_bCanSetUserName,
244 "InteractionSupplyAuthentication::setUserName - Not supported!" );
246 if ( m_bCanSetUserName )
247 m_aUserName = UserName;
251 // virtual
252 sal_Bool SAL_CALL
253 InteractionSupplyAuthentication::canSetPassword()
255 return m_bCanSetPassword;
259 // virtual
260 void SAL_CALL
261 InteractionSupplyAuthentication::setPassword( const OUString& Password )
263 OSL_ENSURE( m_bCanSetPassword,
264 "InteractionSupplyAuthentication::setPassword - Not supported!" );
266 if ( m_bCanSetPassword )
267 m_aPassword = Password;
271 // virtual
272 uno::Sequence< ucb::RememberAuthentication > SAL_CALL
273 InteractionSupplyAuthentication::getRememberPasswordModes(
274 ucb::RememberAuthentication& Default )
276 Default = m_eDefaultRememberPasswordMode;
277 return m_aRememberPasswordModes;
281 // virtual
282 void SAL_CALL
283 InteractionSupplyAuthentication::setRememberPassword(
284 ucb::RememberAuthentication Remember )
286 m_eRememberPasswordMode = Remember;
290 // virtual
291 sal_Bool SAL_CALL
292 InteractionSupplyAuthentication::canSetAccount()
294 return m_bCanSetAccount;
298 // virtual
299 void SAL_CALL
300 InteractionSupplyAuthentication::setAccount( const OUString& /*Account*/ )
302 OSL_ENSURE( m_bCanSetAccount,
303 "InteractionSupplyAuthentication::setAccount - Not supported!" );
307 // virtual
308 uno::Sequence< ucb::RememberAuthentication > SAL_CALL
309 InteractionSupplyAuthentication::getRememberAccountModes(
310 ucb::RememberAuthentication& Default )
312 Default = m_eDefaultRememberAccountMode;
313 return m_aRememberAccountModes;
317 // virtual
318 void SAL_CALL InteractionSupplyAuthentication::setRememberAccount(
319 ucb::RememberAuthentication )
324 // XInteractionSupplyAuthentication2 methods.
327 // virtual
328 sal_Bool SAL_CALL
329 InteractionSupplyAuthentication::canUseSystemCredentials(
330 sal_Bool& Default )
332 Default = false;
333 return m_bCanUseSystemCredentials;
337 // virtual
338 void SAL_CALL InteractionSupplyAuthentication::setUseSystemCredentials(
339 sal_Bool UseSystemCredentials )
341 if ( m_bCanUseSystemCredentials )
342 m_bUseSystemCredentials = UseSystemCredentials;
346 // InteractionReplaceExistingData Implementation.
349 // XInteractionContinuation methods.
352 // virtual
353 void SAL_CALL InteractionReplaceExistingData::select()
355 recordSelection();
358 // InteractionAuthFallback Implementation
360 // XInteractionContinuation methods.
362 // virtual
363 void SAL_CALL InteractionAuthFallback::select()
365 recordSelection();
368 // XInteractionAuthFallback methods
370 // virtual
371 void SAL_CALL InteractionAuthFallback::setCode( const OUString& code )
373 m_aCode = code;
376 const OUString& InteractionAuthFallback::getCode() const
378 return m_aCode;
381 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */