1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: systemexec.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef __FRAMEWORK_DISPATCH_SYSTEMEXEC_HXX_
32 #define __FRAMEWORK_DISPATCH_SYSTEMEXEC_HXX_
34 //_________________________________________________________________________________________________________________
36 //_________________________________________________________________________________________________________________
38 #include <macros/generic.hxx>
39 #include <macros/xinterface.hxx>
40 #include <macros/xtypeprovider.hxx>
41 #include <macros/xserviceinfo.hxx>
42 #include <macros/debug.hxx>
43 #include <threadhelp/threadhelpbase.hxx>
47 //_________________________________________________________________________________________________________________
49 //_________________________________________________________________________________________________________________
50 #include <com/sun/star/lang/XTypeProvider.hpp>
51 #include <com/sun/star/frame/XNotifyingDispatch.hpp>
52 #include <com/sun/star/frame/XDispatch.hpp>
53 #include <com/sun/star/frame/XDispatchProvider.hpp>
54 #include <com/sun/star/util/URL.hpp>
55 #include <com/sun/star/beans/PropertyValue.hpp>
56 #include <com/sun/star/frame/XStatusListener.hpp>
58 //_________________________________________________________________________________________________________________
60 //_________________________________________________________________________________________________________________
61 #include <cppuhelper/weak.hxx>
63 //_________________________________________________________________________________________________________________
65 //_________________________________________________________________________________________________________________
69 //_________________________________________________________________________________________________________________
71 //_________________________________________________________________________________________________________________
73 //_________________________________________________________________________________________________________________
74 // exported definitions
75 //_________________________________________________________________________________________________________________
78 @short protocol handler for "systemexec:*" URLs
79 @descr It's a special dispatch/provider object which is registered for such URL pattern and will
80 be automaticly used by the framework dispatch mechanism if such URL occured.
81 It forwards all URL's to the underlying operating system.
82 So it would e.g. be possible to open HTML files outside the office within a web browser.
85 exports a lock member to guarantee right initialize value of it
87 provides XWeak and ref count mechanism
89 @devstatus ready to use
91 class SystemExec
: // interfaces
92 public css::lang::XTypeProvider
,
93 public css::lang::XServiceInfo
,
94 public css::frame::XDispatchProvider
,
95 public css::frame::XNotifyingDispatch
, // => XDispatch
97 // Order is neccessary for right initialization!
98 private ThreadHelpBase
,
99 public cppu::OWeakObject
104 /// reference to global uno service manager which had created us
105 css::uno::Reference
< css::lang::XMultiServiceFactory
> m_xFactory
;
111 SystemExec( const css::uno::Reference
< css::lang::XMultiServiceFactory
>& xFactory
);
112 virtual ~SystemExec( );
114 // XInterface, XTypeProvider, XServiceInfo
115 FWK_DECLARE_XINTERFACE
116 FWK_DECLARE_XTYPEPROVIDER
120 virtual css::uno::Reference
< css::frame::XDispatch
> SAL_CALL
queryDispatch ( const css::util::URL
& aURL
,
121 const ::rtl::OUString
& sTarget
,
122 sal_Int32 nFlags
) throw( css::uno::RuntimeException
);
123 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
);
125 // XNotifyingDispatch
126 virtual void SAL_CALL
dispatchWithNotification( const css::util::URL
& aURL
,
127 const css::uno::Sequence
< css::beans::PropertyValue
>& lArguments
,
128 const css::uno::Reference
< css::frame::XDispatchResultListener
>& xListener
) throw( css::uno::RuntimeException
);
131 virtual void SAL_CALL
dispatch ( const css::util::URL
& aURL
,
132 const css::uno::Sequence
< css::beans::PropertyValue
>& lArguments
) throw( css::uno::RuntimeException
);
133 virtual void SAL_CALL
addStatusListener ( const css::uno::Reference
< css::frame::XStatusListener
>& xListener
,
134 const css::util::URL
& aURL
) throw( css::uno::RuntimeException
);
135 virtual void SAL_CALL
removeStatusListener( const css::uno::Reference
< css::frame::XStatusListener
>& xListener
,
136 const css::util::URL
& aURL
) throw( css::uno::RuntimeException
);
141 void impl_notifyResultListener(const css::uno::Reference
< css::frame::XDispatchResultListener
>& xListener
,
142 const sal_Int16 nState
);
144 }; // class SystemExec
146 } // namespace framework
148 #endif // #ifndef __FRAMEWORK_DISPATCH_SYSTEMEXEC_HXX_