2010-10-27 13:11:31 +01:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-11-12 17:21:24 +00:00
|
|
|
/*
|
|
|
|
* This file is part of the LibreOffice project.
|
|
|
|
*
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*
|
|
|
|
* This file incorporates work covered by the following license notice:
|
|
|
|
*
|
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed
|
|
|
|
* with this work for additional information regarding copyright
|
|
|
|
* ownership. The ASF licenses this file to you under the Apache
|
|
|
|
* License, Version 2.0 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of
|
|
|
|
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
|
|
|
*/
|
2005-11-11 13:13:04 +00:00
|
|
|
|
2013-11-05 02:25:45 +01:00
|
|
|
#ifndef INCLUDED_FRAMEWORK_INC_DISPATCH_SYSTEMEXEC_HXX
|
|
|
|
#define INCLUDED_FRAMEWORK_INC_DISPATCH_SYSTEMEXEC_HXX
|
2005-11-11 13:13:04 +00:00
|
|
|
|
|
|
|
#include <macros/xinterface.hxx>
|
|
|
|
#include <macros/xtypeprovider.hxx>
|
|
|
|
#include <macros/xserviceinfo.hxx>
|
|
|
|
#include <general.h>
|
|
|
|
#include <stdtypes.h>
|
|
|
|
|
|
|
|
#include <com/sun/star/lang/XTypeProvider.hpp>
|
|
|
|
#include <com/sun/star/frame/XNotifyingDispatch.hpp>
|
|
|
|
#include <com/sun/star/frame/XDispatch.hpp>
|
|
|
|
#include <com/sun/star/frame/XDispatchProvider.hpp>
|
|
|
|
#include <com/sun/star/util/URL.hpp>
|
|
|
|
#include <com/sun/star/beans/PropertyValue.hpp>
|
|
|
|
#include <com/sun/star/frame/XStatusListener.hpp>
|
|
|
|
|
2015-08-14 10:23:57 +09:00
|
|
|
#include <cppuhelper/implbase.hxx>
|
2005-11-11 13:13:04 +00:00
|
|
|
|
|
|
|
namespace framework{
|
|
|
|
|
|
|
|
/**
|
|
|
|
@short protocol handler for "systemexec:*" URLs
|
|
|
|
@descr It's a special dispatch/provider object which is registered for such URL pattern and will
|
2014-04-26 19:28:59 +02:00
|
|
|
be automatically used by the framework dispatch mechanism if such URL occurred.
|
2005-11-11 13:13:04 +00:00
|
|
|
It forwards all URL's to the underlying operating system.
|
|
|
|
So it would e.g. be possible to open HTML files outside the office within a web browser.
|
|
|
|
|
|
|
|
@base OWeakObject
|
|
|
|
provides XWeak and ref count mechanism
|
|
|
|
|
|
|
|
@devstatus ready to use
|
|
|
|
*/
|
2015-08-14 10:23:57 +09:00
|
|
|
class SystemExec : public ::cppu::WeakImplHelper<
|
2013-07-19 13:38:53 +02:00
|
|
|
css::lang::XServiceInfo ,
|
|
|
|
css::frame::XDispatchProvider ,
|
|
|
|
css::frame::XNotifyingDispatch > // => XDispatch
|
2005-11-11 13:13:04 +00:00
|
|
|
{
|
|
|
|
/* member */
|
|
|
|
private:
|
|
|
|
|
|
|
|
/// reference to global uno service manager which had created us
|
2012-10-17 13:54:31 +02:00
|
|
|
css::uno::Reference< css::uno::XComponentContext > m_xContext;
|
2005-11-11 13:13:04 +00:00
|
|
|
|
|
|
|
/* interface */
|
|
|
|
public:
|
|
|
|
|
|
|
|
// ctor/dtor
|
2012-10-17 13:54:31 +02:00
|
|
|
SystemExec( const css::uno::Reference< css::uno::XComponentContext >& rxContext );
|
2016-09-13 13:09:01 +02:00
|
|
|
virtual ~SystemExec( ) override;
|
2005-11-11 13:13:04 +00:00
|
|
|
|
|
|
|
// XInterface, XTypeProvider, XServiceInfo
|
2017-01-19 17:57:03 +01:00
|
|
|
DECLARE_XSERVICEINFO_NOFACTORY
|
|
|
|
/* Helper for registry */
|
|
|
|
/// @throws css::uno::Exception
|
2017-01-26 12:28:58 +01:00
|
|
|
static css::uno::Reference< css::uno::XInterface > SAL_CALL impl_createInstance ( const css::uno::Reference< css::lang::XMultiServiceFactory >& xServiceManager );
|
2017-01-19 17:57:03 +01:00
|
|
|
static css::uno::Reference< css::lang::XSingleServiceFactory > SAL_CALL impl_createFactory ( const css::uno::Reference< css::lang::XMultiServiceFactory >& xServiceManager );
|
2005-11-11 13:13:04 +00:00
|
|
|
|
|
|
|
// XDispatchProvider
|
|
|
|
virtual css::uno::Reference< css::frame::XDispatch > SAL_CALL queryDispatch ( const css::util::URL& aURL ,
|
2013-04-07 12:06:47 +02:00
|
|
|
const OUString& sTarget ,
|
2017-01-26 12:28:58 +01:00
|
|
|
sal_Int32 nFlags ) override;
|
|
|
|
virtual css::uno::Sequence< css::uno::Reference< css::frame::XDispatch > > SAL_CALL queryDispatches( const css::uno::Sequence< css::frame::DispatchDescriptor >& lDescriptor ) override;
|
2005-11-11 13:13:04 +00:00
|
|
|
|
|
|
|
// XNotifyingDispatch
|
|
|
|
virtual void SAL_CALL dispatchWithNotification( const css::util::URL& aURL ,
|
|
|
|
const css::uno::Sequence< css::beans::PropertyValue >& lArguments,
|
2017-01-26 12:28:58 +01:00
|
|
|
const css::uno::Reference< css::frame::XDispatchResultListener >& xListener ) override;
|
2005-11-11 13:13:04 +00:00
|
|
|
|
|
|
|
// XDispatch
|
|
|
|
virtual void SAL_CALL dispatch ( const css::util::URL& aURL ,
|
2017-01-26 12:28:58 +01:00
|
|
|
const css::uno::Sequence< css::beans::PropertyValue >& lArguments ) override;
|
2005-11-11 13:13:04 +00:00
|
|
|
virtual void SAL_CALL addStatusListener ( const css::uno::Reference< css::frame::XStatusListener >& xListener ,
|
2017-01-26 12:28:58 +01:00
|
|
|
const css::util::URL& aURL ) override;
|
2005-11-11 13:13:04 +00:00
|
|
|
virtual void SAL_CALL removeStatusListener( const css::uno::Reference< css::frame::XStatusListener >& xListener ,
|
2017-01-26 12:28:58 +01:00
|
|
|
const css::util::URL& aURL ) override;
|
2005-11-11 13:13:04 +00:00
|
|
|
|
|
|
|
/* internal */
|
|
|
|
private:
|
|
|
|
|
|
|
|
void impl_notifyResultListener(const css::uno::Reference< css::frame::XDispatchResultListener >& xListener,
|
|
|
|
const sal_Int16 nState );
|
|
|
|
|
|
|
|
}; // class SystemExec
|
|
|
|
|
|
|
|
} // namespace framework
|
|
|
|
|
2013-11-05 02:25:45 +01:00
|
|
|
#endif // INCLUDED_FRAMEWORK_INC_DISPATCH_SYSTEMEXEC_HXX
|
2010-10-27 13:11:31 +01:00
|
|
|
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|