xref: /trunk/main/sfx2/inc/sfx2/appuno.hxx (revision 8ff7eef7)
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     /**
94      * Execute a BASIC macro.
95      *
96      * @param aURL URL pointing to the macro (in the form macro:...)
97      * @param rRetval will be set with the macro's return value.
98      * @param aReferer "Referer" identifying the source of this request. May be empty.
99      * @param pDoc shell to use. Default is NULL for using
100      * SfxObjectShell::Current().
101      *
102      * @return ERRCODE_NONE if all went smoothly.
103      */
104     static ErrCode loadMacro( const ::rtl::OUString& aURL, ::com::sun::star::uno::Any& rRetval, const ::rtl::OUString& aReferer, SfxObjectShell* pDoc=NULL ) throw( ::com::sun::star::uno::RuntimeException );
105 
106     virtual ::com::sun::star::uno::Reference < ::com::sun::star::frame::XDispatch > SAL_CALL
107                     queryDispatch( const ::com::sun::star::util::URL& aURL, const ::rtl::OUString& sTargetFrameName,
108                     FrameSearchFlags eSearchFlags ) throw( ::com::sun::star::uno::RuntimeException ) ;
109     virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference < ::com::sun::star::frame::XDispatch > > SAL_CALL
110                     queryDispatches( const ::com::sun::star::uno::Sequence < ::com::sun::star::frame::DispatchDescriptor >& seqDescriptor )
111                         throw( ::com::sun::star::uno::RuntimeException ) ;
112     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);
113     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);
114     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);
115     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);
116     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);
117     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);
118 };
119 
120 class SfxAppDispatchProvider : public ::cppu::WeakImplHelper4< ::com::sun::star::frame::XDispatchProvider,
121                                                                ::com::sun::star::lang::XServiceInfo,
122                                                                ::com::sun::star::lang::XInitialization,
123                                                                ::com::sun::star::frame::XDispatchInformationProvider >
124 {
125 	::com::sun::star::uno::WeakReference < ::com::sun::star::frame::XFrame > m_xFrame;
126 public:
SfxAppDispatchProvider(const com::sun::star::uno::Reference<::com::sun::star::lang::XMultiServiceFactory> &)127                     SfxAppDispatchProvider( const com::sun::star::uno::Reference < ::com::sun::star::lang::XMultiServiceFactory >& )
128                     {}
129 
130     SFX_DECL_XSERVICEINFO
131     virtual ::com::sun::star::uno::Reference < ::com::sun::star::frame::XDispatch > SAL_CALL
132                     queryDispatch( const ::com::sun::star::util::URL& aURL, const ::rtl::OUString& sTargetFrameName,
133                     FrameSearchFlags eSearchFlags ) throw( ::com::sun::star::uno::RuntimeException ) ;
134     virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference < ::com::sun::star::frame::XDispatch > > SAL_CALL
135                     queryDispatches( const ::com::sun::star::uno::Sequence < ::com::sun::star::frame::DispatchDescriptor >& seqDescriptor )
136                         throw( ::com::sun::star::uno::RuntimeException ) ;
137     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);
138     virtual ::com::sun::star::uno::Sequence< sal_Int16 > SAL_CALL getSupportedCommandGroups() throw (::com::sun::star::uno::RuntimeException);
139     virtual ::com::sun::star::uno::Sequence< ::com::sun::star::frame::DispatchInformation > SAL_CALL getConfigurableDispatchInformation( sal_Int16 ) throw (::com::sun::star::uno::RuntimeException);
140 };
141 
142 #endif
143