Fix GNU C++ version check
[LibreOffice.git] / forms / source / inc / controlfeatureinterception.hxx
blob8603a4594e2dd59f465c37640c95fc4312df6c70
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 #pragma once
22 #include <com/sun/star/frame/XDispatchProviderInterceptor.hpp>
23 #include <com/sun/star/uno/XComponentContext.hpp>
25 #include <memory>
27 #include "urltransformer.hxx"
30 namespace frm
34 class UrlTransformer;
36 //= ControlFeatureInterception
38 /** helper class for controls which allow some of their features to be intercepted
39 by external instances
41 For using this class, instantiate it as member, derive yourself from
42 <type scope="css::frame">XDispatchProviderInterception</type>, and forward all
43 respective methods to this member.
45 Additionally, don't forget to call <member>dispose</member> when your class is disposed itself.
47 class ControlFeatureInterception
49 private:
50 css::uno::Reference< css::frame::XDispatchProviderInterceptor >
51 m_xFirstDispatchInterceptor;
52 ::std::unique_ptr< UrlTransformer > m_pUrlTransformer;
54 public:
55 /** retrieves our URL transformer, so our clients may use it, too
57 const UrlTransformer& getTransformer() const { return *m_pUrlTransformer; }
59 public:
60 ControlFeatureInterception( const css::uno::Reference< css::uno::XComponentContext >& _rxORB );
62 // XDispatchProviderInterception
63 /// @throws css::uno::RuntimeException
64 void registerDispatchProviderInterceptor( const css::uno::Reference< css::frame::XDispatchProviderInterceptor >& Interceptor );
65 /// @throws css::uno::RuntimeException
66 void releaseDispatchProviderInterceptor( const css::uno::Reference< css::frame::XDispatchProviderInterceptor >& Interceptor );
68 // XComponent
69 void dispose();
71 /** queries the interceptor chain for the given dispatch, with a blank target frame and no frame search flags
73 css::uno::Reference< css::frame::XDispatch >
74 queryDispatch( const css::util::URL& _rURL );
76 /** queries the interceptor chain for the URL given as ASCII string,
77 with a blank target frame and no frame search flags
79 css::uno::Reference< css::frame::XDispatch >
80 queryDispatch( const OUString& _rURL );
84 } // namespace frm
87 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */