1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: docinteraction.hxx,v $
10 * $Revision: 1.1.2.1 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef DBACCESS_DOCERRORHANDLING_HXX
32 #define DBACCESS_DOCERRORHANDLING_HXX
34 /** === begin UNO includes === **/
35 #include <com/sun/star/frame/XModel.hpp>
36 #include <com/sun/star/task/XInteractionHandler.hpp>
37 /** === end UNO includes === **/
39 namespace comphelper
{
40 class ComponentContext
;
45 //........................................................................
48 //........................................................................
50 //====================================================================
51 //= DocumentErrorHandling
52 //====================================================================
53 struct InteractionHandler_Data
;
54 /** wraps common operations with an interaction handler.
56 class InteractionHandler
59 /** creates an interaction handler by instantiating a css.task.InteractionHandler
60 component at the given component context.
62 InteractionHandler( const ::comphelper::ComponentContext
& _rContext
);
64 /** creates an InteractionHandler instance, using the given existing UNO handler.
66 InteractionHandler( const ::com::sun::star::uno::Reference
< ::com::sun::star::task::XInteractionHandler
>& _rxHandler
);
68 /** creates an interaction handler by instantiating a css.task.InteractionHandler
69 component at the given component context, or using the given document's interaction handler,
70 if one is specified in the document's media descriptor.
72 InteractionHandler( const ::comphelper::ComponentContext
& _rContext
, const ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XModel
>& _rxDocument
);
76 ~InteractionHandler();
78 /** requests a document password
82 the initial password on method entry, the password as entered by the user on method leave
84 <TRUE/> if and only if the user entered a password, and confirmed with OK, <FALSE/>
85 if the user aborted the request.
87 bool requestDocumentPassword(
88 const ::rtl::OUString
& _rDocumentName
,
89 ::rtl::OUString
& _io_rPassword
92 /** reports the given error (usually an exception caught on the caller's side)
96 const ::com::sun::star::uno::Any
& _rError
100 ::std::auto_ptr
< InteractionHandler_Data
> m_pData
;
103 //........................................................................
105 //........................................................................
107 #endif // DBACCESS_DOCERRORHANDLING_HXX