1 /************************************************************************* 2 * 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * Copyright 2000, 2010 Oracle and/or its affiliates. 6 * 7 * OpenOffice.org - a multi-platform office productivity suite 8 * 9 * This file is part of OpenOffice.org. 10 * 11 * OpenOffice.org is free software: you can redistribute it and/or modify 12 * it under the terms of the GNU Lesser General Public License version 3 13 * only, as published by the Free Software Foundation. 14 * 15 * OpenOffice.org is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 * GNU Lesser General Public License version 3 for more details 19 * (a copy is included in the LICENSE file that accompanied this code). 20 * 21 * You should have received a copy of the GNU Lesser General Public License 22 * version 3 along with OpenOffice.org. If not, see 23 * <http://www.openoffice.org/license.html> 24 * for a copy of the LGPLv3 License. 25 * 26 ************************************************************************/ 27 28 #ifndef _SW_UNOMODULE_HXX 29 #define _SW_UNOMODULE_HXX 30 31 #include <rtl/ustring.hxx> 32 #include <com/sun/star/frame/XDispatchProvider.hpp> 33 #include <com/sun/star/frame/XNotifyingDispatch.hpp> 34 #include <com/sun/star/uno/RuntimeException.hpp> 35 #include <com/sun/star/frame/DispatchDescriptor.hpp> 36 #include <com/sun/star/uno/Reference.h> 37 #include <cppuhelper/implbase3.hxx> 38 39 #include <com/sun/star/lang/XServiceInfo.hpp> 40 41 namespace com 42 { 43 namespace sun 44 { 45 namespace star 46 { 47 namespace lang 48 { 49 class XMultiServiceFactory; 50 } 51 namespace beans 52 { 53 struct PropertyValue; 54 } 55 } 56 } 57 } 58 59 #define REFERENCE ::com::sun::star::uno::Reference 60 #define SEQUENCE ::com::sun::star::uno::Sequence 61 #define RUNTIMEEXCEPTION ::com::sun::star::uno::RuntimeException 62 #define REFERENCE ::com::sun::star::uno::Reference 63 #define SEQUENCE ::com::sun::star::uno::Sequence 64 #define XDISPATCH ::com::sun::star::frame::XDispatch 65 #define XNOTIFYINGDISPATCH ::com::sun::star::frame::XNotifyingDispatch 66 #define OUSTRING ::rtl::OUString 67 #define UNOURL ::com::sun::star::util::URL 68 #define DISPATCHDESCRIPTOR ::com::sun::star::frame::DispatchDescriptor 69 70 class SwUnoModule : public ::cppu::WeakImplHelper3< ::com::sun::star::frame::XDispatchProvider, ::com::sun::star::frame::XNotifyingDispatch, ::com::sun::star::lang::XServiceInfo > 71 { 72 REFERENCE < ::com::sun::star::lang::XMultiServiceFactory > m_xFactory; 73 74 public: 75 SwUnoModule( const REFERENCE < ::com::sun::star::lang::XMultiServiceFactory >& xFactory ) 76 : m_xFactory( xFactory ) 77 {} 78 79 // XNotifyingDispatch 80 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); 81 82 // XDispatch 83 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 ); 84 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 ); 85 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 ); 86 87 // XDispatchProvider 88 virtual SEQUENCE< REFERENCE< XDISPATCH > > SAL_CALL queryDispatches( const SEQUENCE< DISPATCHDESCRIPTOR >& seqDescriptor ) throw( RUNTIMEEXCEPTION ) ; 89 virtual REFERENCE< XDISPATCH > SAL_CALL queryDispatch( const UNOURL & aURL , 90 const OUSTRING & sTargetFrameName, 91 sal_Int32 eSearchFlags ) throw( RUNTIMEEXCEPTION ) ; 92 // XServiceInfo 93 virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException); 94 virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw(::com::sun::star::uno::RuntimeException); 95 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException); 96 }; 97 98 #endif 99