1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: fmtextcontrolfeature.hxx,v $
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 //........................................................................
46 //........................................................................
48 //====================================================================
49 //= FmTextControlFeature
50 //====================================================================
51 typedef ::cppu::WeakImplHelper1
< ::com::sun::star::frame::XStatusListener
52 > FmTextControlFeature_Base
;
54 class FmTextControlFeature
: public FmTextControlFeature_Base
57 ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XDispatch
>
59 ::com::sun::star::util::URL m_aFeatureURL
;
60 ::com::sun::star::uno::Any m_aFeatureState
;
62 ISlotInvalidator
* m_pInvalidator
;
63 bool m_bFeatureEnabled
;
66 /** constructs an FmTextControlFeature object
68 the dispatcher which the instance should work with
70 the URL which the instance should be responsible for
73 const ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XDispatch
>& _rxDispatcher
,
74 const ::com::sun::star::util::URL
& _rFeatureURL
,
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(());
95 ~FmTextControlFeature();
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 //........................................................................
105 //........................................................................
107 #endif // SVX_SOURCE_INC_FMTEXTCONTROLFEATURE_HXX