update credits
[LibreOffice.git] / framework / inc / dispatch / systemexec.hxx
blobc343b7661a63be9471ea660b413e62abe74732f6
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef __FRAMEWORK_DISPATCH_SYSTEMEXEC_HXX_
21 #define __FRAMEWORK_DISPATCH_SYSTEMEXEC_HXX_
23 #include <macros/generic.hxx>
24 #include <macros/xinterface.hxx>
25 #include <macros/xtypeprovider.hxx>
26 #include <macros/xserviceinfo.hxx>
27 #include <macros/debug.hxx>
28 #include <threadhelp/threadhelpbase.hxx>
29 #include <general.h>
30 #include <stdtypes.h>
32 #include <com/sun/star/lang/XTypeProvider.hpp>
33 #include <com/sun/star/frame/XNotifyingDispatch.hpp>
34 #include <com/sun/star/frame/XDispatch.hpp>
35 #include <com/sun/star/frame/XDispatchProvider.hpp>
36 #include <com/sun/star/util/URL.hpp>
37 #include <com/sun/star/beans/PropertyValue.hpp>
38 #include <com/sun/star/frame/XStatusListener.hpp>
40 #include <cppuhelper/weak.hxx>
42 namespace framework{
44 /**
45 @short protocol handler for "systemexec:*" URLs
46 @descr It's a special dispatch/provider object which is registered for such URL pattern and will
47 be automaticly used by the framework dispatch mechanism if such URL occurred.
48 It forwards all URL's to the underlying operating system.
49 So it would e.g. be possible to open HTML files outside the office within a web browser.
51 @base ThreadHelpBase
52 exports a lock member to guarantee right initialize value of it
53 @base OWeakObject
54 provides XWeak and ref count mechanism
56 @devstatus ready to use
58 class SystemExec : // interfaces
59 public css::lang::XTypeProvider ,
60 public css::lang::XServiceInfo ,
61 public css::frame::XDispatchProvider ,
62 public css::frame::XNotifyingDispatch, // => XDispatch
63 // baseclasses
64 // Order is necessary for right initialization!
65 private ThreadHelpBase ,
66 public cppu::OWeakObject
68 /* member */
69 private:
71 /// reference to global uno service manager which had created us
72 css::uno::Reference< css::uno::XComponentContext > m_xContext;
74 /* interface */
75 public:
77 // ctor/dtor
78 SystemExec( const css::uno::Reference< css::uno::XComponentContext >& rxContext );
79 virtual ~SystemExec( );
81 // XInterface, XTypeProvider, XServiceInfo
82 FWK_DECLARE_XINTERFACE
83 FWK_DECLARE_XTYPEPROVIDER
84 DECLARE_XSERVICEINFO
86 // XDispatchProvider
87 virtual css::uno::Reference< css::frame::XDispatch > SAL_CALL queryDispatch ( const css::util::URL& aURL ,
88 const OUString& sTarget ,
89 sal_Int32 nFlags ) throw( css::uno::RuntimeException );
90 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 );
92 // XNotifyingDispatch
93 virtual void SAL_CALL dispatchWithNotification( const css::util::URL& aURL ,
94 const css::uno::Sequence< css::beans::PropertyValue >& lArguments,
95 const css::uno::Reference< css::frame::XDispatchResultListener >& xListener ) throw( css::uno::RuntimeException );
97 // XDispatch
98 virtual void SAL_CALL dispatch ( const css::util::URL& aURL ,
99 const css::uno::Sequence< css::beans::PropertyValue >& lArguments ) throw( css::uno::RuntimeException );
100 virtual void SAL_CALL addStatusListener ( const css::uno::Reference< css::frame::XStatusListener >& xListener ,
101 const css::util::URL& aURL ) throw( css::uno::RuntimeException );
102 virtual void SAL_CALL removeStatusListener( const css::uno::Reference< css::frame::XStatusListener >& xListener ,
103 const css::util::URL& aURL ) throw( css::uno::RuntimeException );
105 /* internal */
106 private:
108 void impl_notifyResultListener(const css::uno::Reference< css::frame::XDispatchResultListener >& xListener,
109 const sal_Int16 nState );
111 }; // class SystemExec
113 } // namespace framework
115 #endif // #ifndef __FRAMEWORK_DISPATCH_SYSTEMEXEC_HXX_
117 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */