1*3334a7e6SAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*3334a7e6SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*3334a7e6SAndrew Rist * or more contributor license agreements. See the NOTICE file 5*3334a7e6SAndrew Rist * distributed with this work for additional information 6*3334a7e6SAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*3334a7e6SAndrew Rist * to you under the Apache License, Version 2.0 (the 8*3334a7e6SAndrew Rist * "License"); you may not use this file except in compliance 9*3334a7e6SAndrew Rist * with the License. You may obtain a copy of the License at 10*3334a7e6SAndrew Rist * 11*3334a7e6SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12*3334a7e6SAndrew Rist * 13*3334a7e6SAndrew Rist * Unless required by applicable law or agreed to in writing, 14*3334a7e6SAndrew Rist * software distributed under the License is distributed on an 15*3334a7e6SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*3334a7e6SAndrew Rist * KIND, either express or implied. See the License for the 17*3334a7e6SAndrew Rist * specific language governing permissions and limitations 18*3334a7e6SAndrew Rist * under the License. 19*3334a7e6SAndrew Rist * 20*3334a7e6SAndrew Rist *************************************************************/ 21*3334a7e6SAndrew Rist 22*3334a7e6SAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir #ifndef SVX_SOURCE_INC_FMTEXTCONTROLFEATURE_HXX 25cdf0e10cSrcweir #define SVX_SOURCE_INC_FMTEXTCONTROLFEATURE_HXX 26cdf0e10cSrcweir 27cdf0e10cSrcweir /** === begin UNO includes === **/ 28cdf0e10cSrcweir #include <com/sun/star/beans/PropertyValue.hpp> 29cdf0e10cSrcweir #include <com/sun/star/frame/XDispatch.hpp> 30cdf0e10cSrcweir #include <com/sun/star/frame/XStatusListener.hpp> 31cdf0e10cSrcweir #include <com/sun/star/util/URL.hpp> 32cdf0e10cSrcweir /** === end UNO includes === **/ 33cdf0e10cSrcweir #include <cppuhelper/implbase1.hxx> 34cdf0e10cSrcweir #include "fmslotinvalidator.hxx" 35cdf0e10cSrcweir 36cdf0e10cSrcweir //........................................................................ 37cdf0e10cSrcweir namespace svx 38cdf0e10cSrcweir { 39cdf0e10cSrcweir //........................................................................ 40cdf0e10cSrcweir 41cdf0e10cSrcweir //==================================================================== 42cdf0e10cSrcweir //= FmTextControlFeature 43cdf0e10cSrcweir //==================================================================== 44cdf0e10cSrcweir typedef ::cppu::WeakImplHelper1 < ::com::sun::star::frame::XStatusListener 45cdf0e10cSrcweir > FmTextControlFeature_Base; 46cdf0e10cSrcweir 47cdf0e10cSrcweir class FmTextControlFeature : public FmTextControlFeature_Base 48cdf0e10cSrcweir { 49cdf0e10cSrcweir private: 50cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch > 51cdf0e10cSrcweir m_xDispatcher; 52cdf0e10cSrcweir ::com::sun::star::util::URL m_aFeatureURL; 53cdf0e10cSrcweir ::com::sun::star::uno::Any m_aFeatureState; 54cdf0e10cSrcweir SfxSlotId m_nSlotId; 55cdf0e10cSrcweir ISlotInvalidator* m_pInvalidator; 56cdf0e10cSrcweir bool m_bFeatureEnabled; 57cdf0e10cSrcweir 58cdf0e10cSrcweir public: 59cdf0e10cSrcweir /** constructs an FmTextControlFeature object 60cdf0e10cSrcweir @param _rxDispatcher 61cdf0e10cSrcweir the dispatcher which the instance should work with 62cdf0e10cSrcweir @param _rFeatureURL 63cdf0e10cSrcweir the URL which the instance should be responsible for 64cdf0e10cSrcweir */ 65cdf0e10cSrcweir FmTextControlFeature( 66cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch >& _rxDispatcher, 67cdf0e10cSrcweir const ::com::sun::star::util::URL& _rFeatureURL, 68cdf0e10cSrcweir SfxSlotId _nId, 69cdf0e10cSrcweir ISlotInvalidator* _pInvalidator 70cdf0e10cSrcweir ); 71cdf0e10cSrcweir 72cdf0e10cSrcweir /// determines whether the feature we're responsible for is currently enabled isFeatureEnabled() const73cdf0e10cSrcweir inline bool isFeatureEnabled( ) const { return m_bFeatureEnabled; } getFeatureState() const74cdf0e10cSrcweir inline const ::com::sun::star::uno::Any& getFeatureState( ) const { return m_aFeatureState; } 75cdf0e10cSrcweir 76cdf0e10cSrcweir /** dispatches the feature URL to the dispatcher 77cdf0e10cSrcweir */ 78cdf0e10cSrcweir void dispatch() const SAL_THROW(()); 79cdf0e10cSrcweir 80cdf0e10cSrcweir /** dispatches the feature URL to the dispatcher, with passing the given arguments 81cdf0e10cSrcweir */ 82cdf0e10cSrcweir void dispatch( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& _rArgs ) const SAL_THROW(()); 83cdf0e10cSrcweir 84cdf0e10cSrcweir /// releases any resources associated with this instance 85cdf0e10cSrcweir void dispose() SAL_THROW(()); 86cdf0e10cSrcweir 87cdf0e10cSrcweir protected: 88cdf0e10cSrcweir ~FmTextControlFeature(); 89cdf0e10cSrcweir 90cdf0e10cSrcweir protected: 91cdf0e10cSrcweir // XStatusListener 92cdf0e10cSrcweir virtual void SAL_CALL statusChanged( const ::com::sun::star::frame::FeatureStateEvent& State ) throw (::com::sun::star::uno::RuntimeException); 93cdf0e10cSrcweir virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw (::com::sun::star::uno::RuntimeException); 94cdf0e10cSrcweir }; 95cdf0e10cSrcweir 96cdf0e10cSrcweir //........................................................................ 97cdf0e10cSrcweir } // namespace svx 98cdf0e10cSrcweir //........................................................................ 99cdf0e10cSrcweir 100cdf0e10cSrcweir #endif // SVX_SOURCE_INC_FMTEXTCONTROLFEATURE_HXX 101cdf0e10cSrcweir 102