xref: /AOO41X/main/framework/inc/dispatch/systemexec.hxx (revision f8e07b45f7e1fb69563504f404bb0b75210f0be6)
1*f8e07b45SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*f8e07b45SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*f8e07b45SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*f8e07b45SAndrew Rist  * distributed with this work for additional information
6*f8e07b45SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*f8e07b45SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*f8e07b45SAndrew Rist  * "License"); you may not use this file except in compliance
9*f8e07b45SAndrew Rist  * with the License.  You may obtain a copy of the License at
10cdf0e10cSrcweir  *
11*f8e07b45SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir  *
13*f8e07b45SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*f8e07b45SAndrew Rist  * software distributed under the License is distributed on an
15*f8e07b45SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*f8e07b45SAndrew Rist  * KIND, either express or implied.  See the License for the
17*f8e07b45SAndrew Rist  * specific language governing permissions and limitations
18*f8e07b45SAndrew Rist  * under the License.
19cdf0e10cSrcweir  *
20*f8e07b45SAndrew Rist  *************************************************************/
21*f8e07b45SAndrew Rist 
22*f8e07b45SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef __FRAMEWORK_DISPATCH_SYSTEMEXEC_HXX_
25cdf0e10cSrcweir #define __FRAMEWORK_DISPATCH_SYSTEMEXEC_HXX_
26cdf0e10cSrcweir 
27cdf0e10cSrcweir //_________________________________________________________________________________________________________________
28cdf0e10cSrcweir //	my own includes
29cdf0e10cSrcweir //_________________________________________________________________________________________________________________
30cdf0e10cSrcweir 
31cdf0e10cSrcweir #include <macros/generic.hxx>
32cdf0e10cSrcweir #include <macros/xinterface.hxx>
33cdf0e10cSrcweir #include <macros/xtypeprovider.hxx>
34cdf0e10cSrcweir #include <macros/xserviceinfo.hxx>
35cdf0e10cSrcweir #include <macros/debug.hxx>
36cdf0e10cSrcweir #include <threadhelp/threadhelpbase.hxx>
37cdf0e10cSrcweir #include <general.h>
38cdf0e10cSrcweir #include <stdtypes.h>
39cdf0e10cSrcweir 
40cdf0e10cSrcweir //_________________________________________________________________________________________________________________
41cdf0e10cSrcweir //	interface includes
42cdf0e10cSrcweir //_________________________________________________________________________________________________________________
43cdf0e10cSrcweir #include <com/sun/star/lang/XTypeProvider.hpp>
44cdf0e10cSrcweir #include <com/sun/star/frame/XNotifyingDispatch.hpp>
45cdf0e10cSrcweir #include <com/sun/star/frame/XDispatch.hpp>
46cdf0e10cSrcweir #include <com/sun/star/frame/XDispatchProvider.hpp>
47cdf0e10cSrcweir #include <com/sun/star/util/URL.hpp>
48cdf0e10cSrcweir #include <com/sun/star/beans/PropertyValue.hpp>
49cdf0e10cSrcweir #include <com/sun/star/frame/XStatusListener.hpp>
50cdf0e10cSrcweir 
51cdf0e10cSrcweir //_________________________________________________________________________________________________________________
52cdf0e10cSrcweir //	other includes
53cdf0e10cSrcweir //_________________________________________________________________________________________________________________
54cdf0e10cSrcweir #include <cppuhelper/weak.hxx>
55cdf0e10cSrcweir 
56cdf0e10cSrcweir //_________________________________________________________________________________________________________________
57cdf0e10cSrcweir //	namespace
58cdf0e10cSrcweir //_________________________________________________________________________________________________________________
59cdf0e10cSrcweir 
60cdf0e10cSrcweir namespace framework{
61cdf0e10cSrcweir 
62cdf0e10cSrcweir //_________________________________________________________________________________________________________________
63cdf0e10cSrcweir //	exported const
64cdf0e10cSrcweir //_________________________________________________________________________________________________________________
65cdf0e10cSrcweir 
66cdf0e10cSrcweir //_________________________________________________________________________________________________________________
67cdf0e10cSrcweir //	exported definitions
68cdf0e10cSrcweir //_________________________________________________________________________________________________________________
69cdf0e10cSrcweir 
70cdf0e10cSrcweir /**
71cdf0e10cSrcweir     @short          protocol handler for "systemexec:*" URLs
72cdf0e10cSrcweir     @descr          It's a special dispatch/provider object which is registered for such URL pattern and will
73cdf0e10cSrcweir                     be automaticly used by the framework dispatch mechanism if such URL occured.
74cdf0e10cSrcweir                     It forwards all URL's to the underlying operating system.
75cdf0e10cSrcweir                     So it would e.g. be possible to open HTML files outside the office within a web browser.
76cdf0e10cSrcweir 
77cdf0e10cSrcweir     @base           ThreadHelpBase
78cdf0e10cSrcweir                         exports a lock member to guarantee right initialize value of it
79cdf0e10cSrcweir     @base           OWeakObject
80cdf0e10cSrcweir                         provides XWeak and ref count mechanism
81cdf0e10cSrcweir 
82cdf0e10cSrcweir 	@devstatus		ready to use
83cdf0e10cSrcweir */
84cdf0e10cSrcweir class SystemExec : // interfaces
85cdf0e10cSrcweir                        public  css::lang::XTypeProvider      ,
86cdf0e10cSrcweir                        public  css::lang::XServiceInfo       ,
87cdf0e10cSrcweir                        public  css::frame::XDispatchProvider ,
88cdf0e10cSrcweir                        public  css::frame::XNotifyingDispatch, // => XDispatch
89cdf0e10cSrcweir                        // baseclasses
90cdf0e10cSrcweir                        // Order is neccessary for right initialization!
91cdf0e10cSrcweir                        private ThreadHelpBase                ,
92cdf0e10cSrcweir                        public  cppu::OWeakObject
93cdf0e10cSrcweir {
94cdf0e10cSrcweir     /* member */
95cdf0e10cSrcweir     private:
96cdf0e10cSrcweir 
97cdf0e10cSrcweir         /// reference to global uno service manager which had created us
98cdf0e10cSrcweir         css::uno::Reference< css::lang::XMultiServiceFactory > m_xFactory;
99cdf0e10cSrcweir 
100cdf0e10cSrcweir     /* interface */
101cdf0e10cSrcweir 	public:
102cdf0e10cSrcweir 
103cdf0e10cSrcweir         // ctor/dtor
104cdf0e10cSrcweir                  SystemExec( const css::uno::Reference< css::lang::XMultiServiceFactory >& xFactory );
105cdf0e10cSrcweir         virtual ~SystemExec(                                                                        );
106cdf0e10cSrcweir 
107cdf0e10cSrcweir         // XInterface, XTypeProvider, XServiceInfo
108cdf0e10cSrcweir         FWK_DECLARE_XINTERFACE
109cdf0e10cSrcweir 		FWK_DECLARE_XTYPEPROVIDER
110cdf0e10cSrcweir         DECLARE_XSERVICEINFO
111cdf0e10cSrcweir 
112cdf0e10cSrcweir         // XDispatchProvider
113cdf0e10cSrcweir         virtual css::uno::Reference< css::frame::XDispatch > SAL_CALL                       queryDispatch  ( const css::util::URL&                                       aURL        ,
114cdf0e10cSrcweir                                                                                                              const ::rtl::OUString&                                      sTarget     ,
115cdf0e10cSrcweir                                                                                                                    sal_Int32                                             nFlags      ) throw( css::uno::RuntimeException );
116cdf0e10cSrcweir         virtual css::uno::Sequence< css::uno::Reference< css::frame::XDispatch > > SAL_CALL queryDispatches( const css::uno::Sequence< css::frame::DispatchDescriptor >& lDescriptor ) throw( css::uno::RuntimeException );
117cdf0e10cSrcweir 
118cdf0e10cSrcweir         // XNotifyingDispatch
119cdf0e10cSrcweir         virtual void SAL_CALL dispatchWithNotification( const css::util::URL&                                             aURL      ,
120cdf0e10cSrcweir                                                         const css::uno::Sequence< css::beans::PropertyValue >&            lArguments,
121cdf0e10cSrcweir                                                         const css::uno::Reference< css::frame::XDispatchResultListener >& xListener ) throw( css::uno::RuntimeException );
122cdf0e10cSrcweir 
123cdf0e10cSrcweir         // XDispatch
124cdf0e10cSrcweir         virtual void SAL_CALL dispatch            ( const css::util::URL&                                     aURL       ,
125cdf0e10cSrcweir                                                     const css::uno::Sequence< css::beans::PropertyValue >&    lArguments ) throw( css::uno::RuntimeException );
126cdf0e10cSrcweir         virtual void SAL_CALL addStatusListener   ( const css::uno::Reference< css::frame::XStatusListener >& xListener  ,
127cdf0e10cSrcweir                                                     const css::util::URL&                                     aURL       ) throw( css::uno::RuntimeException );
128cdf0e10cSrcweir         virtual void SAL_CALL removeStatusListener( const css::uno::Reference< css::frame::XStatusListener >& xListener  ,
129cdf0e10cSrcweir                                                     const css::util::URL&                                     aURL       ) throw( css::uno::RuntimeException );
130cdf0e10cSrcweir 
131cdf0e10cSrcweir     /* internal */
132cdf0e10cSrcweir     private:
133cdf0e10cSrcweir 
134cdf0e10cSrcweir         void impl_notifyResultListener(const css::uno::Reference< css::frame::XDispatchResultListener >& xListener,
135cdf0e10cSrcweir                                        const sal_Int16                                                   nState   );
136cdf0e10cSrcweir 
137cdf0e10cSrcweir };      //  class SystemExec
138cdf0e10cSrcweir 
139cdf0e10cSrcweir }		//	namespace framework
140cdf0e10cSrcweir 
141cdf0e10cSrcweir #endif  //  #ifndef __FRAMEWORK_DISPATCH_SYSTEMEXEC_HXX_
142