merge the formfield patch from ooo-build
[ooovba.git] / sw / source / ui / uno / unomodule.hxx
blob741cc4e0220b99d30aa9230eabc522a2a4c8a95b
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: unomodule.hxx,v $
10 * $Revision: 1.5 $
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 _SW_UNOMODULE_HXX
32 #define _SW_UNOMODULE_HXX
34 #include <rtl/ustring.hxx>
35 #include <com/sun/star/frame/XDispatchProvider.hpp>
36 #include <com/sun/star/frame/XNotifyingDispatch.hpp>
37 #include <com/sun/star/uno/RuntimeException.hpp>
38 #include <com/sun/star/frame/DispatchDescriptor.hpp>
39 #include <com/sun/star/uno/Reference.h>
40 #include <cppuhelper/implbase3.hxx>
42 #include <com/sun/star/lang/XServiceInfo.hpp>
44 namespace com
46 namespace sun
48 namespace star
50 namespace lang
52 class XMultiServiceFactory;
54 namespace beans
56 struct PropertyValue;
62 #define REFERENCE ::com::sun::star::uno::Reference
63 #define SEQUENCE ::com::sun::star::uno::Sequence
64 #define RUNTIMEEXCEPTION ::com::sun::star::uno::RuntimeException
65 #define REFERENCE ::com::sun::star::uno::Reference
66 #define SEQUENCE ::com::sun::star::uno::Sequence
67 #define XDISPATCH ::com::sun::star::frame::XDispatch
68 #define XNOTIFYINGDISPATCH ::com::sun::star::frame::XNotifyingDispatch
69 #define OUSTRING ::rtl::OUString
70 #define UNOURL ::com::sun::star::util::URL
71 #define DISPATCHDESCRIPTOR ::com::sun::star::frame::DispatchDescriptor
73 class SwUnoModule : public ::cppu::WeakImplHelper3< ::com::sun::star::frame::XDispatchProvider, ::com::sun::star::frame::XNotifyingDispatch, ::com::sun::star::lang::XServiceInfo >
75 REFERENCE < ::com::sun::star::lang::XMultiServiceFactory > m_xFactory;
77 public:
78 SwUnoModule( const REFERENCE < ::com::sun::star::lang::XMultiServiceFactory >& xFactory )
79 : m_xFactory( xFactory )
82 // XNotifyingDispatch
83 virtual void SAL_CALL dispatchWithNotification( const ::com::sun::star::util::URL& aURL, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aArgs, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchResultListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
85 // XDispatch
86 virtual void SAL_CALL dispatch( const ::com::sun::star::util::URL& aURL, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aArgs ) throw( ::com::sun::star::uno::RuntimeException );
87 virtual void SAL_CALL addStatusListener(const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XStatusListener > & xControl, const ::com::sun::star::util::URL& aURL) throw( ::com::sun::star::uno::RuntimeException );
88 virtual void SAL_CALL removeStatusListener(const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XStatusListener > & xControl, const ::com::sun::star::util::URL& aURL) throw( ::com::sun::star::uno::RuntimeException );
90 // XDispatchProvider
91 virtual SEQUENCE< REFERENCE< XDISPATCH > > SAL_CALL queryDispatches( const SEQUENCE< DISPATCHDESCRIPTOR >& seqDescriptor ) throw( RUNTIMEEXCEPTION ) ;
92 virtual REFERENCE< XDISPATCH > SAL_CALL queryDispatch( const UNOURL & aURL ,
93 const OUSTRING & sTargetFrameName,
94 sal_Int32 eSearchFlags ) throw( RUNTIMEEXCEPTION ) ;
95 // XServiceInfo
96 virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException);
97 virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw(::com::sun::star::uno::RuntimeException);
98 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException);
101 #endif