Bump for 3.6-28
[LibreOffice.git] / ucb / source / ucp / tdoc / tdoc_passwordrequest.hxx
blobf96210e859a3b9c11a720f4d35c6be33d54cefbc
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * Copyright 2000, 2010 Oracle and/or its affiliates.
8 * OpenOffice.org - a multi-platform office productivity suite
10 * This file is part of OpenOffice.org.
12 * OpenOffice.org is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU Lesser General Public License version 3
14 * only, as published by the Free Software Foundation.
16 * OpenOffice.org is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License version 3 for more details
20 * (a copy is included in the LICENSE file that accompanied this code).
22 * You should have received a copy of the GNU Lesser General Public License
23 * version 3 along with OpenOffice.org. If not, see
24 * <http://www.openoffice.org/license.html>
25 * for a copy of the LGPLv3 License.
27 ************************************************************************/
29 #ifndef INCLUDED_TDOC_PASSWORDREQUEST_HXX
30 #define INCLUDED_TDOC_PASSWORDREQUEST_HXX
32 #include "com/sun/star/task/PasswordRequestMode.hpp"
33 #include "com/sun/star/task/XInteractionPassword.hpp"
35 #include "ucbhelper/interactionrequest.hxx"
37 namespace tdoc_ucp {
40 @usage:
42 uno::Reference< ucb::XCommandEnvironment > Environment = ...;
44 if ( Environment.is() )
46 uno::Reference< task::XInteractionHandler > xIH
47 = Environment->getInteractionHandler();
48 if ( xIH.is() )
50 rtl::Reference< DocumentPasswordRequest > xRequest
51 = new DocumentPasswordRequest(
52 task::PasswordRequestMode_PASSWORD_ENTER,
53 m_xIdentifier->getContentIdentifier() );
54 xIH->handle( xRequest.get() );
56 rtl::Reference< ucbhelper::InteractionContinuation > xSelection
57 = xRequest->getSelection();
59 if ( xSelection.is() )
61 // Handler handled the request.
62 uno::Reference< task::XInteractionAbort > xAbort(
63 xSelection.get(), uno::UNO_QUERY );
64 if ( xAbort.is() )
66 // @@@
69 uno::Reference< task::XInteractionRetry > xRetry(
70 xSelection.get(), uno::UNO_QUERY );
71 if ( xRetry.is() )
73 // @@@
76 uno::Reference< task::XInteractionPassword > xPassword(
77 xSelection.get(), uno::UNO_QUERY );
78 if ( xPassword.is() )
80 rtl::OUString aPassword = xPassword->getPassword();
82 // @@@
90 class DocumentPasswordRequest : public ucbhelper::InteractionRequest
92 public:
93 DocumentPasswordRequest(
94 com::sun::star::task::PasswordRequestMode eMode,
95 const rtl::OUString & rDocumentName );
98 } // namespace tdoc_ucp
100 #endif /* !INCLUDED_TDOC_PASSWORDREQUEST_HXX */
102 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */