Update ooo320-m1
[ooovba.git] / forms / source / inc / controlfeatureinterception.hxx
blob8e803c88631bddc39ca3de70558893ad60f45a5b
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: controlfeatureinterception.hxx,v $
10 * $Revision: 1.4 $
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 FORMS_SOURCE_INC_CONTROLFEATUREINTERCEPTION_HXX
32 #define FORMS_SOURCE_INC_CONTROLFEATUREINTERCEPTION_HXX
34 /** === begin UNO includes === **/
35 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
36 #include <com/sun/star/frame/XDispatchProviderInterceptor.hpp>
37 /** === end UNO includes === **/
39 #include <memory>
41 //........................................................................
42 namespace frm
44 //........................................................................
46 class UrlTransformer;
47 //====================================================================
48 //= ControlFeatureInterception
49 //====================================================================
50 /** helper class for controls which allow some of their features to be intercepted
51 by external instances
53 For using this class, instantiate it as member, derive yourself from
54 <type scope="com::sun::star::frame">XDispatchProviderInterception</type>, and forward all
55 respective methods to this member.
57 Additionally, don't forget to call <member>dispose</member> when your class is disposed itself.
59 class ControlFeatureInterception
61 private:
62 ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProviderInterceptor >
63 m_xFirstDispatchInterceptor;
64 ::std::auto_ptr< UrlTransformer > m_pUrlTransformer;
66 public:
67 /** retrieves our URL transformer, so our clients may use it, too
69 const UrlTransformer& getTransformer() const { return *m_pUrlTransformer; }
71 public:
72 ControlFeatureInterception( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB );
74 // XDispatchProviderInterception
75 void SAL_CALL registerDispatchProviderInterceptor( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProviderInterceptor >& Interceptor ) throw (::com::sun::star::uno::RuntimeException );
76 void SAL_CALL releaseDispatchProviderInterceptor( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProviderInterceptor >& Interceptor ) throw (::com::sun::star::uno::RuntimeException );
78 // XComponent
79 void SAL_CALL dispose();
81 /** queries the interceptor chain for the given dispatch
83 ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch >
84 queryDispatch( const ::com::sun::star::util::URL& _rURL, const ::rtl::OUString& _rTargetFrameName, ::sal_Int32 _nSearchFlags ) SAL_THROW((::com::sun::star::uno::RuntimeException));
86 /** queries the interceptor chain for the given dispatch, with a blank target frame and no frame search flags
88 ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch >
89 queryDispatch( const ::com::sun::star::util::URL& _rURL ) SAL_THROW((::com::sun::star::uno::RuntimeException));
91 /** queries the interceptor chain for the URL given as ASCII string,
92 with a blank target frame and no frame search flags
94 ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch >
95 queryDispatch( const sal_Char* _pAsciiURL ) SAL_THROW((::com::sun::star::uno::RuntimeException));
98 //........................................................................
99 } // namespace frm
100 //........................................................................
102 #endif // FORMS_SOURCE_INC_CONTROLFEATUREINTERCEPTION_HXX