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 //........................................................................
44 //........................................................................
46 //====================================================================
47 //= FmTextControlFeature
48 //====================================================================
49 typedef ::cppu::WeakImplHelper1
< ::com::sun::star::frame::XStatusListener
50 > FmTextControlFeature_Base
;
52 class FmTextControlFeature
: public FmTextControlFeature_Base
55 ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XDispatch
>
57 ::com::sun::star::util::URL m_aFeatureURL
;
58 ::com::sun::star::uno::Any m_aFeatureState
;
60 ISlotInvalidator
* m_pInvalidator
;
61 bool m_bFeatureEnabled
;
64 /** constructs an FmTextControlFeature object
66 the dispatcher which the instance should work with
68 the URL which the instance should be responsible for
71 const ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XDispatch
>& _rxDispatcher
,
72 const ::com::sun::star::util::URL
& _rFeatureURL
,
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(());
93 ~FmTextControlFeature();
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 //........................................................................
103 //........................................................................
105 #endif // SVX_SOURCE_INC_FMTEXTCONTROLFEATURE_HXX
107 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */