2010-10-27 12:45:03 +01:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-11-21 22:06:52 +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 .
|
|
|
|
*/
|
2004-11-16 09:44:51 +00:00
|
|
|
|
2013-11-05 02:31:05 +01:00
|
|
|
#ifndef INCLUDED_FORMS_SOURCE_INC_CONTROLFEATUREINTERCEPTION_HXX
|
|
|
|
#define INCLUDED_FORMS_SOURCE_INC_CONTROLFEATUREINTERCEPTION_HXX
|
2004-11-16 09:44:51 +00:00
|
|
|
|
|
|
|
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
|
|
|
|
#include <com/sun/star/frame/XDispatchProviderInterceptor.hpp>
|
2013-06-03 08:34:09 +02:00
|
|
|
#include <com/sun/star/uno/XComponentContext.hpp>
|
2004-11-16 09:44:51 +00:00
|
|
|
|
|
|
|
#include <memory>
|
|
|
|
|
2014-02-25 18:50:02 +01:00
|
|
|
|
2004-11-16 09:44:51 +00:00
|
|
|
namespace frm
|
|
|
|
{
|
2014-02-25 18:50:02 +01:00
|
|
|
|
2004-11-16 09:44:51 +00:00
|
|
|
|
|
|
|
class UrlTransformer;
|
2014-02-25 18:50:02 +01:00
|
|
|
|
2004-11-16 09:44:51 +00:00
|
|
|
//= ControlFeatureInterception
|
2014-02-25 18:50:02 +01:00
|
|
|
|
2004-11-16 09:44:51 +00:00
|
|
|
/** helper class for controls which allow some of their features to be intercepted
|
|
|
|
by external instances
|
|
|
|
|
|
|
|
For using this class, instantiate it as member, derive yourself from
|
2015-10-01 15:32:00 +02:00
|
|
|
<type scope="css::frame">XDispatchProviderInterception</type>, and forward all
|
2004-11-16 09:44:51 +00:00
|
|
|
respective methods to this member.
|
|
|
|
|
|
|
|
Additionally, don't forget to call <member>dispose</member> when your class is disposed itself.
|
|
|
|
*/
|
|
|
|
class ControlFeatureInterception
|
|
|
|
{
|
|
|
|
private:
|
2015-10-01 15:32:00 +02:00
|
|
|
css::uno::Reference< css::frame::XDispatchProviderInterceptor >
|
|
|
|
m_xFirstDispatchInterceptor;
|
2014-09-30 12:26:55 +02:00
|
|
|
::std::unique_ptr< UrlTransformer > m_pUrlTransformer;
|
2004-11-16 09:44:51 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
/** retrieves our URL transformer, so our clients may use it, too
|
|
|
|
*/
|
|
|
|
const UrlTransformer& getTransformer() const { return *m_pUrlTransformer; }
|
|
|
|
|
|
|
|
public:
|
2015-10-01 15:32:00 +02:00
|
|
|
ControlFeatureInterception( const css::uno::Reference< css::uno::XComponentContext >& _rxORB );
|
2004-11-16 09:44:51 +00:00
|
|
|
|
|
|
|
// XDispatchProviderInterception
|
2017-01-19 17:57:25 +01:00
|
|
|
/// @throws css::uno::RuntimeException
|
2017-01-26 12:28:58 +01:00
|
|
|
void SAL_CALL registerDispatchProviderInterceptor( const css::uno::Reference< css::frame::XDispatchProviderInterceptor >& Interceptor );
|
2017-01-19 17:57:25 +01:00
|
|
|
/// @throws css::uno::RuntimeException
|
2017-01-26 12:28:58 +01:00
|
|
|
void SAL_CALL releaseDispatchProviderInterceptor( const css::uno::Reference< css::frame::XDispatchProviderInterceptor >& Interceptor );
|
2004-11-16 09:44:51 +00:00
|
|
|
|
|
|
|
// XComponent
|
|
|
|
void SAL_CALL dispose();
|
|
|
|
|
|
|
|
/** queries the interceptor chain for the given dispatch
|
|
|
|
*/
|
2015-10-01 15:32:00 +02:00
|
|
|
css::uno::Reference< css::frame::XDispatch >
|
2016-03-23 10:04:32 +02:00
|
|
|
queryDispatch( const css::util::URL& _rURL, const OUString& _rTargetFrameName );
|
2004-11-16 09:44:51 +00:00
|
|
|
|
|
|
|
/** queries the interceptor chain for the given dispatch, with a blank target frame and no frame search flags
|
|
|
|
*/
|
2015-10-01 15:32:00 +02:00
|
|
|
css::uno::Reference< css::frame::XDispatch >
|
|
|
|
queryDispatch( const css::util::URL& _rURL );
|
2004-11-16 09:44:51 +00:00
|
|
|
|
|
|
|
/** queries the interceptor chain for the URL given as ASCII string,
|
|
|
|
with a blank target frame and no frame search flags
|
|
|
|
*/
|
2015-10-01 15:32:00 +02:00
|
|
|
css::uno::Reference< css::frame::XDispatch >
|
2014-06-05 08:15:21 +02:00
|
|
|
queryDispatch( const sal_Char* _pAsciiURL );
|
2004-11-16 09:44:51 +00:00
|
|
|
};
|
|
|
|
|
2014-02-25 18:50:02 +01:00
|
|
|
|
2004-11-16 09:44:51 +00:00
|
|
|
} // namespace frm
|
2014-02-25 18:50:02 +01:00
|
|
|
|
2004-11-16 09:44:51 +00:00
|
|
|
|
2013-11-05 02:31:05 +01:00
|
|
|
#endif // INCLUDED_FORMS_SOURCE_INC_CONTROLFEATUREINTERCEPTION_HXX
|
2004-11-16 09:44:51 +00:00
|
|
|
|
2010-10-27 12:45:03 +01:00
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|