Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
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/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
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 .
18 : */
19 :
20 : #ifndef INCLUDED_FORMS_SOURCE_INC_CONTROLFEATUREINTERCEPTION_HXX
21 : #define INCLUDED_FORMS_SOURCE_INC_CONTROLFEATUREINTERCEPTION_HXX
22 :
23 : #include <com/sun/star/lang/XMultiServiceFactory.hpp>
24 : #include <com/sun/star/frame/XDispatchProviderInterceptor.hpp>
25 : #include <com/sun/star/uno/XComponentContext.hpp>
26 :
27 : #include <memory>
28 :
29 :
30 : namespace frm
31 : {
32 :
33 :
34 : class UrlTransformer;
35 :
36 : //= ControlFeatureInterception
37 :
38 : /** helper class for controls which allow some of their features to be intercepted
39 : by external instances
40 :
41 : For using this class, instantiate it as member, derive yourself from
42 : <type scope="com::sun::star::frame">XDispatchProviderInterception</type>, and forward all
43 : respective methods to this member.
44 :
45 : Additionally, don't forget to call <member>dispose</member> when your class is disposed itself.
46 : */
47 0 : class ControlFeatureInterception
48 : {
49 : private:
50 : ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProviderInterceptor >
51 : m_xFirstDispatchInterceptor;
52 : SAL_WNODEPRECATED_DECLARATIONS_PUSH
53 : ::std::auto_ptr< UrlTransformer > m_pUrlTransformer;
54 : SAL_WNODEPRECATED_DECLARATIONS_POP
55 :
56 : public:
57 : /** retrieves our URL transformer, so our clients may use it, too
58 : */
59 0 : const UrlTransformer& getTransformer() const { return *m_pUrlTransformer; }
60 :
61 : public:
62 : ControlFeatureInterception( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxORB );
63 :
64 : // XDispatchProviderInterception
65 : void SAL_CALL registerDispatchProviderInterceptor( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProviderInterceptor >& Interceptor ) throw (::com::sun::star::uno::RuntimeException );
66 : void SAL_CALL releaseDispatchProviderInterceptor( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProviderInterceptor >& Interceptor ) throw (::com::sun::star::uno::RuntimeException );
67 :
68 : // XComponent
69 : void SAL_CALL dispose();
70 :
71 : /** queries the interceptor chain for the given dispatch
72 : */
73 : ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch >
74 : queryDispatch( const ::com::sun::star::util::URL& _rURL, const OUString& _rTargetFrameName, ::sal_Int32 _nSearchFlags ) SAL_THROW((::com::sun::star::uno::RuntimeException));
75 :
76 : /** queries the interceptor chain for the given dispatch, with a blank target frame and no frame search flags
77 : */
78 : ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch >
79 : queryDispatch( const ::com::sun::star::util::URL& _rURL ) SAL_THROW((::com::sun::star::uno::RuntimeException));
80 :
81 : /** queries the interceptor chain for the URL given as ASCII string,
82 : with a blank target frame and no frame search flags
83 : */
84 : ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch >
85 : queryDispatch( const sal_Char* _pAsciiURL ) SAL_THROW((::com::sun::star::uno::RuntimeException));
86 : };
87 :
88 :
89 : } // namespace frm
90 :
91 :
92 : #endif // INCLUDED_FORMS_SOURCE_INC_CONTROLFEATUREINTERCEPTION_HXX
93 :
94 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|