bump product version to 4.1.6.2
[LibreOffice.git] / forms / source / inc / controlfeatureinterception.hxx
blob0981c6a2ace30fb55627401bbdcb38a4fbfead32
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 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>
26 #include <memory>
28 //........................................................................
29 namespace frm
31 //........................................................................
33 class UrlTransformer;
34 //====================================================================
35 //= ControlFeatureInterception
36 //====================================================================
37 /** helper class for controls which allow some of their features to be intercepted
38 by external instances
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
48 private:
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
55 public:
56 /** retrieves our URL transformer, so our clients may use it, too
58 const UrlTransformer& getTransformer() const { return *m_pUrlTransformer; }
60 public:
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 );
67 // XComponent
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 //........................................................................
88 } // namespace frm
89 //........................................................................
91 #endif // FORMS_SOURCE_INC_CONTROLFEATUREINTERCEPTION_HXX
93 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */