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: dbinteraction.hxx,v $
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 _DBAUI_INTERACTION_HXX_
32 #define _DBAUI_INTERACTION_HXX_
34 #ifndef _CPPUHELPER_IMPLBASE2_HXX_
35 #include <cppuhelper/implbase2.hxx>
38 #ifndef _DBAUI_MODULE_DBU_HXX_
39 #include "moduledbu.hxx"
41 #ifndef _COM_SUN_STAR_LANG_XSERVICEINFO_HPP_
42 #include <com/sun/star/lang/XServiceInfo.hpp>
44 #ifndef _COM_SUN_STAR_TASK_XINTERACTIONHANDLER_HPP_
45 #include <com/sun/star/task/XInteractionHandler.hpp>
47 #ifndef _COM_SUN_STAR_LANG_XMULTISERVICEFACTORY_HPP_
48 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
50 #ifndef _COM_SUN_STAR_UCB_AUTHENTICATIONREQUEST_HPP_
51 #include <com/sun/star/ucb/AuthenticationRequest.hpp>
53 #ifndef _COM_SUN_STAR_SDB_PARAMETERSREQUEST_HPP_
54 #include <com/sun/star/sdb/ParametersRequest.hpp>
56 #ifndef _COM_SUN_STAR_SDB_DOCUMENTSAVEREQUEST_HPP_
57 #include <com/sun/star/sdb/DocumentSaveRequest.hpp>
59 #ifndef _DBASHARED_APITOOLS_HXX_
60 #include "apitools.hxx"
65 class SQLExceptionInfo
;
68 //.........................................................................
71 //.........................................................................
73 //=========================================================================
74 //= OInteractionHandler
75 //=========================================================================
76 typedef ::cppu::WeakImplHelper2
< ::com::sun::star::lang::XServiceInfo
77 , ::com::sun::star::task::XInteractionHandler
78 > OInteractionHandler_Base
;
79 /** implements an <type scope="com.sun.star.task">XInteractionHandler</type> for
80 database related interaction requests.
82 Supported interaction requests by now (specified by an exception: The appropriate exception
83 has to be returned by the getRequest method of the object implementing the
84 <type scope="com.sun.star.task">XInteractionRequest</type> interface.
86 <li><b><type scope="com.sun.star.sdbc">SQLException</type></b>: requests to display a
87 standard error dialog for the (maybe chained) exception given</li>
90 class OInteractionHandler
91 :public OInteractionHandler_Base
93 OModuleClient m_aModuleClient
;
94 ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XMultiServiceFactory
>
97 OInteractionHandler(const ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XMultiServiceFactory
>& _rxORB
);
100 DECLARE_SERVICE_INFO_STATIC();
102 // XInteractionHandler
103 virtual void SAL_CALL
handle( const ::com::sun::star::uno::Reference
< ::com::sun::star::task::XInteractionRequest
>& Request
) throw(::com::sun::star::uno::RuntimeException
);
106 /// handle SQLExceptions (and derived classes)
108 const ::dbtools::SQLExceptionInfo
& _rSqlInfo
,
109 const ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Reference
< ::com::sun::star::task::XInteractionContinuation
> >& _rContinuations
);
111 /// handle parameter requests
113 const ::com::sun::star::sdb::ParametersRequest
& _rParamRequest
,
114 const ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Reference
< ::com::sun::star::task::XInteractionContinuation
> >& _rContinuations
);
116 /// handle document save requests
118 const ::com::sun::star::sdb::DocumentSaveRequest
& _rParamRequest
,
119 const ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Reference
< ::com::sun::star::task::XInteractionContinuation
> >& _rContinuations
);
121 /// handles requests which are not SDB-specific
122 bool implHandleUnknown(
123 const ::com::sun::star::uno::Reference
< ::com::sun::star::task::XInteractionRequest
>& _rxRequest
);
125 /// known continuation types
135 /** check if a given continuation sequence contains a given continuation type<p/>
136 @return the index within <arg>_rContinuations</arg> of the first occurence of a continuation
137 of the requested type, -1 of no such continuation exists
139 sal_Int32
getContinuation(
141 const ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Reference
< ::com::sun::star::task::XInteractionContinuation
> >& _rContinuations
);
144 //.........................................................................
146 //.........................................................................
148 #endif // _DBAUI_INTERACTION_HXX_