1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 FORMS_SOURCE_INC_CONTROLFEATUREINTERCEPTION_HXX
21 #define FORMS_SOURCE_INC_CONTROLFEATUREINTERCEPTION_HXX
23 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
24 #include <com/sun/star/frame/XDispatchProviderInterceptor.hpp>
28 //........................................................................
31 //........................................................................
34 //====================================================================
35 //= ControlFeatureInterception
36 //====================================================================
37 /** helper class for controls which allow some of their features to be intercepted
40 For using this class, instantiate it as member, derive yourself from
41 <type scope="com::sun::star::frame">XDispatchProviderInterception</type>, and forward all
42 respective methods to this member.
44 Additionally, don't forget to call <member>dispose</member> when your class is disposed itself.
46 class ControlFeatureInterception
49 ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XDispatchProviderInterceptor
>
50 m_xFirstDispatchInterceptor
;
51 SAL_WNODEPRECATED_DECLARATIONS_PUSH
52 ::std::auto_ptr
< UrlTransformer
> m_pUrlTransformer
;
53 SAL_WNODEPRECATED_DECLARATIONS_POP
56 /** retrieves our URL transformer, so our clients may use it, too
58 const UrlTransformer
& getTransformer() const { return *m_pUrlTransformer
; }
61 ControlFeatureInterception( const ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XMultiServiceFactory
>& _rxORB
);
63 // XDispatchProviderInterception
64 void SAL_CALL
registerDispatchProviderInterceptor( const ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XDispatchProviderInterceptor
>& Interceptor
) throw (::com::sun::star::uno::RuntimeException
);
65 void SAL_CALL
releaseDispatchProviderInterceptor( const ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XDispatchProviderInterceptor
>& Interceptor
) throw (::com::sun::star::uno::RuntimeException
);
68 void SAL_CALL
dispose();
70 /** queries the interceptor chain for the given dispatch
72 ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XDispatch
>
73 queryDispatch( const ::com::sun::star::util::URL
& _rURL
, const OUString
& _rTargetFrameName
, ::sal_Int32 _nSearchFlags
) SAL_THROW((::com::sun::star::uno::RuntimeException
));
75 /** queries the interceptor chain for the given dispatch, with a blank target frame and no frame search flags
77 ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XDispatch
>
78 queryDispatch( const ::com::sun::star::util::URL
& _rURL
) SAL_THROW((::com::sun::star::uno::RuntimeException
));
80 /** queries the interceptor chain for the URL given as ASCII string,
81 with a blank target frame and no frame search flags
83 ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XDispatch
>
84 queryDispatch( const sal_Char
* _pAsciiURL
) SAL_THROW((::com::sun::star::uno::RuntimeException
));
87 //........................................................................
89 //........................................................................
91 #endif // FORMS_SOURCE_INC_CONTROLFEATUREINTERCEPTION_HXX
93 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */