xref: /aoo4110/main/sfx2/inc/sfx2/appuno.hxx (revision b1cdbd2c)
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 #ifndef _SFX_APPUNO_HXX
24 #define _SFX_APPUNO_HXX
25 
26 //____________________________________________________________________________________________________________________________________
27 //	generated header
28 //____________________________________________________________________________________________________________________________________
29 
30 #include <com/sun/star/frame/XFrame.hpp>
31 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
32 #include <com/sun/star/lang/XServiceInfo.hpp>
33 #include <com/sun/star/lang/XInitialization.hpp>
34 #include <com/sun/star/lang/XTypeProvider.hpp>
35 #include <com/sun/star/registry/XSimpleRegistry.hpp>
36 #include <com/sun/star/beans/PropertyValue.hpp>
37 #include <com/sun/star/util/URL.hpp>
38 #include <com/sun/star/uno/Exception.hpp>
39 #include <com/sun/star/frame/XDispatchProvider.hpp>
40 #include <com/sun/star/frame/XDispatch.hpp>
41 #include <com/sun/star/frame/XSynchronousDispatch.hpp>
42 #include <com/sun/star/frame/XNotifyingDispatch.hpp>
43 #include <com/sun/star/frame/XDispatchResultListener.hpp>
44 #include <com/sun/star/frame/DispatchDescriptor.hpp>
45 #include <com/sun/star/frame/XDispatchInformationProvider.hpp>
46 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
47 
48 //____________________________________________________________________________________________________________________________________
49 //	fix uno header
50 //____________________________________________________________________________________________________________________________________
51 #include <com/sun/star/uno/Any.h>
52 #include <com/sun/star/uno/Reference.h>
53 #include <com/sun/star/uno/Sequence.hxx>
54 #include <cppuhelper/weak.hxx>
55 #include <cppuhelper/implbase4.hxx>
56 
57 //____________________________________________________________________________________________________________________________________
58 //	something else header
59 //____________________________________________________________________________________________________________________________________
60 #include <tools/errcode.hxx>
61 #include <svl/svarray.hxx>
62 #define _SVSTDARR_STRINGSDTOR
63 #include <svl/svstdarr.hxx>
64 #include <sfx2/sfxuno.hxx>
65 
66 //____________________________________________________________________________________________________________________________________
67 //	forwards
68 //____________________________________________________________________________________________________________________________________
69 
70 //____________________________________________________________________________________________________________________________________
71 //	declarations
72 //____________________________________________________________________________________________________________________________________
73 class SfxObjectShell;
74 class SfxMacroLoader  :     public ::com::sun::star::frame::XDispatchProvider,
75                             public ::com::sun::star::frame::XNotifyingDispatch,
76                             public ::com::sun::star::frame::XSynchronousDispatch,
77 							public ::com::sun::star::lang::XTypeProvider,
78                             public ::com::sun::star::lang::XServiceInfo,
79                             public ::com::sun::star::lang::XInitialization,
80 							public ::cppu::OWeakObject
81 {
82 	::com::sun::star::uno::WeakReference < ::com::sun::star::frame::XFrame > m_xFrame;
83 
84 	SfxObjectShell*				GetObjectShell_Impl();
85 
86 public:
87 	// XInterface, XTypeProvider, XServiceInfo
88 	SFX_DECL_XINTERFACE_XTYPEPROVIDER_XSERVICEINFO
89 
SfxMacroLoader(const::com::sun::star::uno::Reference<::com::sun::star::lang::XMultiServiceFactory> &)90     SfxMacroLoader( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& )
91 	{}
92 
93 	static ErrCode loadMacro( const ::rtl::OUString& aURL, ::com::sun::star::uno::Any& rRetval, SfxObjectShell* pDoc=NULL ) throw( ::com::sun::star::uno::RuntimeException );
94 
95     virtual ::com::sun::star::uno::Reference < ::com::sun::star::frame::XDispatch > SAL_CALL
96                     queryDispatch( const ::com::sun::star::util::URL& aURL, const ::rtl::OUString& sTargetFrameName,
97                     FrameSearchFlags eSearchFlags ) throw( ::com::sun::star::uno::RuntimeException ) ;
98     virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference < ::com::sun::star::frame::XDispatch > > SAL_CALL
99                     queryDispatches( const ::com::sun::star::uno::Sequence < ::com::sun::star::frame::DispatchDescriptor >& seqDescriptor )
100                         throw( ::com::sun::star::uno::RuntimeException ) ;
101     virtual void SAL_CALL dispatchWithNotification( const ::com::sun::star::util::URL& aURL, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& lArgs, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchResultListener >& Listener ) throw (::com::sun::star::uno::RuntimeException);
102     virtual void SAL_CALL dispatch( const ::com::sun::star::util::URL& aURL, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& lArgs ) throw (::com::sun::star::uno::RuntimeException);
103     virtual ::com::sun::star::uno::Any SAL_CALL dispatchWithReturnValue( const ::com::sun::star::util::URL& aURL, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& lArgs ) throw (::com::sun::star::uno::RuntimeException);
104     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);
105     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);
106     virtual void SAL_CALL initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments ) throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
107 };
108 
109 class SfxAppDispatchProvider : public ::cppu::WeakImplHelper4< ::com::sun::star::frame::XDispatchProvider,
110                                                                ::com::sun::star::lang::XServiceInfo,
111                                                                ::com::sun::star::lang::XInitialization,
112                                                                ::com::sun::star::frame::XDispatchInformationProvider >
113 {
114 	::com::sun::star::uno::WeakReference < ::com::sun::star::frame::XFrame > m_xFrame;
115 public:
SfxAppDispatchProvider(const com::sun::star::uno::Reference<::com::sun::star::lang::XMultiServiceFactory> &)116                     SfxAppDispatchProvider( const com::sun::star::uno::Reference < ::com::sun::star::lang::XMultiServiceFactory >& )
117                     {}
118 
119     SFX_DECL_XSERVICEINFO
120     virtual ::com::sun::star::uno::Reference < ::com::sun::star::frame::XDispatch > SAL_CALL
121                     queryDispatch( const ::com::sun::star::util::URL& aURL, const ::rtl::OUString& sTargetFrameName,
122                     FrameSearchFlags eSearchFlags ) throw( ::com::sun::star::uno::RuntimeException ) ;
123     virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference < ::com::sun::star::frame::XDispatch > > SAL_CALL
124                     queryDispatches( const ::com::sun::star::uno::Sequence < ::com::sun::star::frame::DispatchDescriptor >& seqDescriptor )
125                         throw( ::com::sun::star::uno::RuntimeException ) ;
126     virtual void SAL_CALL initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments ) throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
127     virtual ::com::sun::star::uno::Sequence< sal_Int16 > SAL_CALL getSupportedCommandGroups() throw (::com::sun::star::uno::RuntimeException);
128     virtual ::com::sun::star::uno::Sequence< ::com::sun::star::frame::DispatchInformation > SAL_CALL getConfigurableDispatchInformation( sal_Int16 ) throw (::com::sun::star::uno::RuntimeException);
129 };
130 
131 #endif
132