Version 3.6.0.4, tag libreoffice-3.6.0.4
[LibreOffice.git] / svx / source / inc / fmtextcontrolfeature.hxx
blobc2214661b69d7aa8902ce26a8a704641fd4b1e4b
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * Copyright 2000, 2010 Oracle and/or its affiliates.
8 * OpenOffice.org - a multi-platform office productivity suite
10 * This file is part of OpenOffice.org.
12 * OpenOffice.org is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU Lesser General Public License version 3
14 * only, as published by the Free Software Foundation.
16 * OpenOffice.org is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License version 3 for more details
20 * (a copy is included in the LICENSE file that accompanied this code).
22 * You should have received a copy of the GNU Lesser General Public License
23 * version 3 along with OpenOffice.org. If not, see
24 * <http://www.openoffice.org/license.html>
25 * for a copy of the LGPLv3 License.
27 ************************************************************************/
29 #ifndef SVX_SOURCE_INC_FMTEXTCONTROLFEATURE_HXX
30 #define SVX_SOURCE_INC_FMTEXTCONTROLFEATURE_HXX
32 /** === begin UNO includes === **/
33 #include <com/sun/star/beans/PropertyValue.hpp>
34 #include <com/sun/star/frame/XDispatch.hpp>
35 #include <com/sun/star/frame/XStatusListener.hpp>
36 #include <com/sun/star/util/URL.hpp>
37 /** === end UNO includes === **/
38 #include <cppuhelper/implbase1.hxx>
39 #include "fmslotinvalidator.hxx"
41 //........................................................................
42 namespace svx
44 //........................................................................
46 //====================================================================
47 //= FmTextControlFeature
48 //====================================================================
49 typedef ::cppu::WeakImplHelper1 < ::com::sun::star::frame::XStatusListener
50 > FmTextControlFeature_Base;
52 class FmTextControlFeature : public FmTextControlFeature_Base
54 private:
55 ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch >
56 m_xDispatcher;
57 ::com::sun::star::util::URL m_aFeatureURL;
58 ::com::sun::star::uno::Any m_aFeatureState;
59 SfxSlotId m_nSlotId;
60 ISlotInvalidator* m_pInvalidator;
61 bool m_bFeatureEnabled;
63 public:
64 /** constructs an FmTextControlFeature object
65 @param _rxDispatcher
66 the dispatcher which the instance should work with
67 @param _rFeatureURL
68 the URL which the instance should be responsible for
70 FmTextControlFeature(
71 const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch >& _rxDispatcher,
72 const ::com::sun::star::util::URL& _rFeatureURL,
73 SfxSlotId _nId,
74 ISlotInvalidator* _pInvalidator
77 /// determines whether the feature we're responsible for is currently enabled
78 inline bool isFeatureEnabled( ) const { return m_bFeatureEnabled; }
79 inline const ::com::sun::star::uno::Any& getFeatureState( ) const { return m_aFeatureState; }
81 /** dispatches the feature URL to the dispatcher
83 void dispatch() const SAL_THROW(());
85 /** dispatches the feature URL to the dispatcher, with passing the given arguments
87 void dispatch( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& _rArgs ) const SAL_THROW(());
89 /// releases any resources associated with this instance
90 void dispose() SAL_THROW(());
92 protected:
93 ~FmTextControlFeature();
95 protected:
96 // XStatusListener
97 virtual void SAL_CALL statusChanged( const ::com::sun::star::frame::FeatureStateEvent& State ) throw (::com::sun::star::uno::RuntimeException);
98 virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw (::com::sun::star::uno::RuntimeException);
101 //........................................................................
102 } // namespace svx
103 //........................................................................
105 #endif // SVX_SOURCE_INC_FMTEXTCONTROLFEATURE_HXX
107 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */