1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 <sal/config.h>
24 #include <sfx2/dllapi.h>
25 #include <svl/poolitem.hxx>
26 #include <com/sun/star/lang/XComponent.hpp>
27 #include <com/sun/star/frame/XStatusListener.hpp>
29 #include <cppuhelper/implbase.hxx>
31 namespace com::sun::star::frame
{ class XDispatch
; }
32 namespace com::sun::star::frame
{ class XDispatchProvider
; }
33 namespace com::sun::star::frame
{ struct FeatureStateEvent
; }
35 class SFX2_DLLPUBLIC SfxStatusListener
: public cppu::WeakImplHelper
<
36 css::frame::XStatusListener
,
37 css::lang::XComponent
>
41 SfxStatusListener( const css::uno::Reference
< css::frame::XDispatchProvider
>& rDispatchProvider
, sal_uInt16 nSlotId
, const OUString
& aCommand
);
42 virtual ~SfxStatusListener() override
;
44 // old methods from SfxControllerItem
45 sal_uInt16
GetId() const { return m_nSlotID
; }
49 virtual void StateChanged( SfxItemState eState
, const SfxPoolItem
* pState
);
52 virtual void SAL_CALL
dispose() override
;
53 virtual void SAL_CALL
addEventListener( const css::uno::Reference
< css::lang::XEventListener
>& xListener
) override
;
54 virtual void SAL_CALL
removeEventListener( const css::uno::Reference
< css::lang::XEventListener
>& aListener
) override
;
57 virtual void SAL_CALL
disposing(const css::lang::EventObject
& Source
) override
;
60 virtual void SAL_CALL
statusChanged(const css::frame::FeatureStateEvent
& Event
) override
;
63 SfxStatusListener( const SfxStatusListener
& ) = delete;
64 SfxStatusListener
& operator=( const SfxStatusListener
& ) = delete;
66 sal_uInt16
const m_nSlotID
;
67 css::util::URL m_aCommand
;
68 css::uno::Reference
< css::frame::XDispatchProvider
> m_xDispatchProvider
;
69 css::uno::Reference
< css::frame::XDispatch
> m_xDispatch
;
72 #endif // INCLUDED_SFX2_SFXSTATUSLISTENER_HXX
74 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */