merge the formfield patch from ooo-build
[ooovba.git] / dbaccess / source / ext / macromigration / docinteraction.hxx
blob298e06c71d5a59ee7245f96d376ae5a815715d2d
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
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;
43 #include <memory>
45 //........................................................................
46 namespace dbmm
48 //........................................................................
50 //====================================================================
51 //= DocumentErrorHandling
52 //====================================================================
53 struct InteractionHandler_Data;
54 /** wraps common operations with an interaction handler.
56 class InteractionHandler
58 public:
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 );
74 /** destructor
76 ~InteractionHandler();
78 /** requests a document password
79 @param _rDocumentName
80 the document name
81 @param _io_rPassword
82 the initial password on method entry, the password as entered by the user on method leave
83 @return
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)
93 to the user
95 void reportError(
96 const ::com::sun::star::uno::Any& _rError
99 private:
100 ::std::auto_ptr< InteractionHandler_Data > m_pData;
103 //........................................................................
104 } // namespace dbmm
105 //........................................................................
107 #endif // DBACCESS_DOCERRORHANDLING_HXX