merge the formfield patch from ooo-build
[ooovba.git] / svx / source / inc / fmtextcontrolfeature.hxx
blob3195987dd4ffe2fe6af6c09ac5763936c5fd819f
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: fmtextcontrolfeature.hxx,v $
10 * $Revision: 1.4 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef SVX_SOURCE_INC_FMTEXTCONTROLFEATURE_HXX
32 #define SVX_SOURCE_INC_FMTEXTCONTROLFEATURE_HXX
34 /** === begin UNO includes === **/
35 #include <com/sun/star/beans/PropertyValue.hpp>
36 #include <com/sun/star/frame/XDispatch.hpp>
37 #include <com/sun/star/frame/XStatusListener.hpp>
38 #include <com/sun/star/util/URL.hpp>
39 /** === end UNO includes === **/
40 #include <cppuhelper/implbase1.hxx>
41 #include "fmslotinvalidator.hxx"
43 //........................................................................
44 namespace svx
46 //........................................................................
48 //====================================================================
49 //= FmTextControlFeature
50 //====================================================================
51 typedef ::cppu::WeakImplHelper1 < ::com::sun::star::frame::XStatusListener
52 > FmTextControlFeature_Base;
54 class FmTextControlFeature : public FmTextControlFeature_Base
56 private:
57 ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch >
58 m_xDispatcher;
59 ::com::sun::star::util::URL m_aFeatureURL;
60 ::com::sun::star::uno::Any m_aFeatureState;
61 SfxSlotId m_nSlotId;
62 ISlotInvalidator* m_pInvalidator;
63 bool m_bFeatureEnabled;
65 public:
66 /** constructs an FmTextControlFeature object
67 @param _rxDispatcher
68 the dispatcher which the instance should work with
69 @param _rFeatureURL
70 the URL which the instance should be responsible for
72 FmTextControlFeature(
73 const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch >& _rxDispatcher,
74 const ::com::sun::star::util::URL& _rFeatureURL,
75 SfxSlotId _nId,
76 ISlotInvalidator* _pInvalidator
79 /// determines whether the feature we're responsible for is currently enabled
80 inline bool isFeatureEnabled( ) const { return m_bFeatureEnabled; }
81 inline const ::com::sun::star::uno::Any& getFeatureState( ) const { return m_aFeatureState; }
83 /** dispatches the feature URL to the dispatcher
85 void dispatch() const SAL_THROW(());
87 /** dispatches the feature URL to the dispatcher, with passing the given arguments
89 void dispatch( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& _rArgs ) const SAL_THROW(());
91 /// releases any resources associated with this instance
92 void dispose() SAL_THROW(());
94 protected:
95 ~FmTextControlFeature();
97 protected:
98 // XStatusListener
99 virtual void SAL_CALL statusChanged( const ::com::sun::star::frame::FeatureStateEvent& State ) throw (::com::sun::star::uno::RuntimeException);
100 virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw (::com::sun::star::uno::RuntimeException);
103 //........................................................................
104 } // namespace svx
105 //........................................................................
107 #endif // SVX_SOURCE_INC_FMTEXTCONTROLFEATURE_HXX