LibreOffice Module ucb (master)  1
tdoc_passwordrequest.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
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/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
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 .
18  */
19 
20 #ifndef INCLUDED_UCB_SOURCE_UCP_TDOC_TDOC_PASSWORDREQUEST_HXX
21 #define INCLUDED_UCB_SOURCE_UCP_TDOC_TDOC_PASSWORDREQUEST_HXX
22 
23 #include <com/sun/star/task/PasswordRequestMode.hpp>
24 
26 
27 namespace tdoc_ucp {
28 
29  /*
30  @usage:
31 
32  uno::Reference< ucb::XCommandEnvironment > Environment = ...;
33 
34  if ( Environment.is() )
35  {
36  uno::Reference< task::XInteractionHandler > xIH
37  = Environment->getInteractionHandler();
38  if ( xIH.is() )
39  {
40  rtl::Reference< DocumentPasswordRequest > xRequest
41  = new DocumentPasswordRequest(
42  task::PasswordRequestMode_PASSWORD_ENTER,
43  m_xIdentifier->getContentIdentifier() );
44  xIH->handle( xRequest.get() );
45 
46  rtl::Reference< ucbhelper::InteractionContinuation > xSelection
47  = xRequest->getSelection();
48 
49  if ( xSelection.is() )
50  {
51  // Handler handled the request.
52  uno::Reference< task::XInteractionAbort > xAbort(
53  xSelection.get(), uno::UNO_QUERY );
54  if ( xAbort.is() )
55  {
56  // @@@
57  }
58 
59  uno::Reference< task::XInteractionRetry > xRetry(
60  xSelection.get(), uno::UNO_QUERY );
61  if ( xRetry.is() )
62  {
63  // @@@
64  }
65 
66  uno::Reference< task::XInteractionPassword > xPassword(
67  xSelection.get(), uno::UNO_QUERY );
68  if ( xPassword.is() )
69  {
70  OUString aPassword = xPassword->getPassword();
71 
72  // @@@
73  }
74  }
75  }
76  }
77 
78  */
79 
81  {
82  public:
84  css::task::PasswordRequestMode eMode,
85  const OUString & rDocumentName );
86  };
87 
88 } // namespace tdoc_ucp
89 
90 #endif // INCLUDED_UCB_SOURCE_UCP_TDOC_TDOC_PASSWORDREQUEST_HXX
91 
92 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
DocumentPasswordRequest(css::task::PasswordRequestMode eMode, const OUString &rDocumentName)