fdo#74697 Add Bluez 5 support for impress remote.
[LibreOffice.git] / include / sfx2 / sfxstatuslistener.hxx
blob9e6be020db101be7ea422834c157f850ce573520
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 _SFXSTATUSLISTENER_HXX
21 #define _SFXSTATUSLISTENER_HXX
23 #include "sal/config.h"
24 #include "sfx2/dllapi.h"
25 #include <svl/poolitem.hxx>
26 #include <cppuhelper/weak.hxx>
27 #include <osl/conditn.hxx>
28 #include <com/sun/star/frame/FeatureStateEvent.hpp>
29 #include <com/sun/star/frame/XDispatchProvider.hpp>
30 #include <com/sun/star/lang/XComponent.hpp>
31 #include <com/sun/star/frame/XStatusListener.hpp>
33 #include <sfx2/sfxuno.hxx>
35 // Interface for implementations which needs to get notifications about state changes
36 class SfxStatusListenerInterface
38 public:
39 virtual void StateChanged( sal_uInt16 nSlotId, SfxItemState eState, const SfxPoolItem* pState ) = 0;
41 protected:
42 ~SfxStatusListenerInterface() {}
45 class SFX2_DLLPUBLIC SfxStatusListener :
46 public ::com::sun::star::frame::XStatusListener ,
47 public ::com::sun::star::lang::XTypeProvider ,
48 public ::com::sun::star::lang::XComponent ,
49 public ::cppu::OWeakObject
51 public:
52 SFX_DECL_XINTERFACE_XTYPEPROVIDER
54 SfxStatusListener( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProvider >& rDispatchProvider, sal_uInt16 nSlotId, const OUString& aCommand );
55 virtual ~SfxStatusListener();
57 // old methods from SfxControllerItem
58 sal_uInt16 GetId() const { return m_nSlotID; }
59 void UnBind();
60 void ReBind();
62 virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState );
64 // XComponent
65 virtual void SAL_CALL dispose() throw( ::com::sun::star::uno::RuntimeException );
66 virtual void SAL_CALL addEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
67 virtual void SAL_CALL removeEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& aListener ) throw (::com::sun::star::uno::RuntimeException);
69 // XEventListener
70 virtual void SAL_CALL disposing(const ::com::sun::star::lang::EventObject& Source) throw( ::com::sun::star::uno::RuntimeException );
72 // XStatusListener
73 virtual void SAL_CALL statusChanged(const ::com::sun::star::frame::FeatureStateEvent& Event) throw( ::com::sun::star::uno::RuntimeException );
75 private:
76 SfxStatusListener( const SfxStatusListener& );
77 SfxStatusListener();
78 SfxStatusListener& operator=( const SfxStatusListener& );
80 sal_uInt16 m_nSlotID;
81 ::com::sun::star::util::URL m_aCommand;
82 ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProvider > m_xDispatchProvider;
83 ::com::sun::star::uno::Reference< com::sun::star::frame::XDispatch > m_xDispatch;
86 #endif // _SFXSTATUSLISTENER_HXX
88 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */