xref: /aoo41x/main/sd/source/ui/unoidl/unomodule.hxx (revision 67e470da)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef _SD_UNOMODULE_HXX
25 #define _SD_UNOMODULE_HXX
26 
27 #include <rtl/ustring.hxx>
28 #include <com/sun/star/frame/XDispatchProvider.hpp>
29 #include <com/sun/star/frame/XNotifyingDispatch.hpp>
30 #include <com/sun/star/uno/RuntimeException.hpp>
31 #include <com/sun/star/frame/DispatchDescriptor.hpp>
32 #include <com/sun/star/uno/Reference.h>
33 #include <cppuhelper/implbase3.hxx>
34 
35 #include <com/sun/star/lang/XServiceInfo.hpp>
36 
37 namespace com
38 {
39     namespace sun
40     {
41         namespace star
42         {
43             namespace lang
44             {
45                 class XMultiServiceFactory;
46             }
47             namespace beans
48             {
49                 struct PropertyValue;
50             }
51         }
52     }
53 }
54 
55 #define REFERENCE 				::com::sun::star::uno::Reference
56 #define SEQUENCE 				::com::sun::star::uno::Sequence
57 #define RUNTIMEEXCEPTION 		::com::sun::star::uno::RuntimeException
58 #define	REFERENCE				::com::sun::star::uno::Reference
59 #define	SEQUENCE				::com::sun::star::uno::Sequence
60 #define XDISPATCH               ::com::sun::star::frame::XDispatch
61 #define XNOTIFYINGDISPATCH      ::com::sun::star::frame::XNotifyingDispatch
62 #define	OUSTRING				::rtl::OUString
63 #define	UNOURL					::com::sun::star::util::URL
64 #define	DISPATCHDESCRIPTOR		::com::sun::star::frame::DispatchDescriptor
65 
66 class SdUnoModule : public ::cppu::WeakImplHelper3< ::com::sun::star::frame::XDispatchProvider, ::com::sun::star::frame::XNotifyingDispatch, ::com::sun::star::lang::XServiceInfo >
67 {
68 	REFERENCE < ::com::sun::star::lang::XMultiServiceFactory > m_xFactory;
69 
70 public:
SdUnoModule(const REFERENCE<::com::sun::star::lang::XMultiServiceFactory> & xFactory)71                             SdUnoModule( const REFERENCE < ::com::sun::star::lang::XMultiServiceFactory >& xFactory )
72 								: m_xFactory( xFactory )
73 							{}
74 
75     // XnotifyingDispatch
76     virtual void SAL_CALL dispatchWithNotification( const ::com::sun::star::util::URL& URL, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& Arguments, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchResultListener >& Listener ) throw (::com::sun::star::uno::RuntimeException);
77 
78 	// XDispatch
79 	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 );
80 	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 );
81 	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 );
82 
83 	// XDispatchProvider
84 	virtual SEQUENCE< REFERENCE< XDISPATCH > > SAL_CALL queryDispatches( const SEQUENCE< DISPATCHDESCRIPTOR >& seqDescriptor ) throw( RUNTIMEEXCEPTION ) ;
85 	virtual REFERENCE< XDISPATCH > SAL_CALL queryDispatch(	const	UNOURL &			aURL			,
86 															const	OUSTRING &			sTargetFrameName,
87 																	sal_Int32	eSearchFlags	) throw( RUNTIMEEXCEPTION ) ;
88 	// XServiceInfo
89     virtual ::rtl::OUString SAL_CALL getImplementationName(  ) throw(::com::sun::star::uno::RuntimeException);
90     virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw(::com::sun::star::uno::RuntimeException);
91     virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames(  ) throw(::com::sun::star::uno::RuntimeException);
92 };
93 
94 #endif
95