Bump version to 21.06.18.1
[LibreOffice.git] / include / sfx2 / sfxstatuslistener.hxx
blob1361f2f165a60e12602fdc20ab1f96501016a6c8
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 INCLUDED_SFX2_SFXSTATUSLISTENER_HXX
21 #define INCLUDED_SFX2_SFXSTATUSLISTENER_HXX
23 #include <config_options.h>
24 #include <sal/config.h>
25 #include <sfx2/dllapi.h>
26 #include <svl/poolitem.hxx>
27 #include <com/sun/star/lang/XComponent.hpp>
28 #include <com/sun/star/frame/XStatusListener.hpp>
30 #include <cppuhelper/implbase.hxx>
32 namespace com::sun::star::frame { class XDispatch; }
33 namespace com::sun::star::frame { class XDispatchProvider; }
34 namespace com::sun::star::frame { struct FeatureStateEvent; }
36 class UNLESS_MERGELIBS(SFX2_DLLPUBLIC) SfxStatusListener : public cppu::WeakImplHelper<
37 css::frame::XStatusListener,
38 css::lang::XComponent>
40 public:
42 SfxStatusListener( const css::uno::Reference< css::frame::XDispatchProvider >& rDispatchProvider, sal_uInt16 nSlotId, const OUString& aCommand );
43 virtual ~SfxStatusListener() override;
45 // old methods from SfxControllerItem
46 sal_uInt16 GetId() const { return m_nSlotID; }
47 void UnBind();
48 void ReBind();
50 virtual void StateChanged( SfxItemState eState, const SfxPoolItem* pState );
52 // XComponent
53 virtual void SAL_CALL dispose() override;
54 virtual void SAL_CALL addEventListener( const css::uno::Reference< css::lang::XEventListener >& xListener ) override;
55 virtual void SAL_CALL removeEventListener( const css::uno::Reference< css::lang::XEventListener >& aListener ) override;
57 // XEventListener
58 virtual void SAL_CALL disposing(const css::lang::EventObject& Source) override;
60 // XStatusListener
61 virtual void SAL_CALL statusChanged(const css::frame::FeatureStateEvent& Event) override;
63 private:
64 SfxStatusListener( const SfxStatusListener& ) = delete;
65 SfxStatusListener& operator=( const SfxStatusListener& ) = delete;
67 sal_uInt16 m_nSlotID;
68 css::util::URL m_aCommand;
69 css::uno::Reference< css::frame::XDispatchProvider > m_xDispatchProvider;
70 css::uno::Reference< css::frame::XDispatch > m_xDispatch;
73 #endif // INCLUDED_SFX2_SFXSTATUSLISTENER_HXX
75 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */