diff options
Diffstat (limited to 'forms/source/component/Button.hxx')
-rw-r--r-- | forms/source/component/Button.hxx | 66 |
1 files changed, 54 insertions, 12 deletions
diff --git a/forms/source/component/Button.hxx b/forms/source/component/Button.hxx index e23a397e4..0038a719a 100644 --- a/forms/source/component/Button.hxx +++ b/forms/source/component/Button.hxx @@ -2,9 +2,9 @@ * * $RCSfile: Button.hxx,v $ * - * $Revision: 1.5 $ + * $Revision: 1.6 $ * - * last change: $Author: fs $ $Date: 2002-12-02 09:56:26 $ + * last change: $Author: hr $ $Date: 2004-04-13 11:12:18 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -84,6 +84,9 @@ #ifndef _COM_SUN_STAR_BEANS_PROPERTYCHANGEEVENT_HPP_ #include <com/sun/star/beans/PropertyChangeEvent.hpp> #endif +#ifndef FORMS_FORM_NAVIGATION_HXX +#include "formnavigation.hxx" +#endif //......................................................................... namespace frm @@ -128,10 +131,16 @@ protected: //================================================================== typedef ::cppu::ImplHelper2< ::com::sun::star::awt::XButton, ::com::sun::star::awt::XActionListener> OButtonControl_BASE; -class OButtonControl : public OButtonControl_BASE, - public OImageControl + +class OButtonControl :public OButtonControl_BASE + ,public OImageControl + ,public OFormNavigationHelper { - sal_uInt32 nClickEvent; +private: + sal_uInt32 m_nClickEvent; + sal_Int32 m_nTargetUrlFeatureId; + /// caches the value of the "Enabled" property of our model + sal_Bool m_bEnabledByPropertyValue; protected: @@ -142,28 +151,61 @@ public: OButtonControl(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory); virtual ~OButtonControl(); -// ::com::sun::star::lang::XServiceInfo + // XServiceInfo IMPLEMENTATION_NAME(OButtonControl); virtual StringSequence SAL_CALL getSupportedServiceNames() throw(); -// UNO Anbindung + // UNO Anbindung DECLARE_UNO3_AGG_DEFAULTS(OButtonControl, OImageControl); virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation(const ::com::sun::star::uno::Type& _rType) throw(::com::sun::star::uno::RuntimeException); -// ::com::sun::star::awt::XActionListener + // XActionListener virtual void SAL_CALL actionPerformed(const ::com::sun::star::awt::ActionEvent& rEvent) throw ( ::com::sun::star::uno::RuntimeException); -// ::com::sun::star::awt::XButton + // XButton virtual void SAL_CALL addActionListener(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XActionListener>& _rxListener) throw(::com::sun::star::uno::RuntimeException); virtual void SAL_CALL removeActionListener(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XActionListener>& _rxListener) throw(::com::sun::star::uno::RuntimeException); virtual void SAL_CALL setLabel(const ::rtl::OUString& Label) throw(::com::sun::star::uno::RuntimeException); virtual void SAL_CALL setActionCommand(const ::rtl::OUString& _rCommand) throw(::com::sun::star::uno::RuntimeException); -// ::com::sun::star::lang::XEventListener - virtual void SAL_CALL disposing(const ::com::sun::star::lang::EventObject& _rSource) throw(::com::sun::star::uno::RuntimeException) - { OControl::disposing(_rSource); } + // OComponentHelper + virtual void SAL_CALL disposing(); + + // XPropertyChangeListener + virtual void SAL_CALL propertyChange( const ::com::sun::star::beans::PropertyChangeEvent& evt ) throw(::com::sun::star::uno::RuntimeException); + + // XEventListener + virtual void SAL_CALL disposing(const ::com::sun::star::lang::EventObject& _rSource) throw(::com::sun::star::uno::RuntimeException); + + // XControl + virtual sal_Bool SAL_CALL setModel( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& _rxModel ) throw ( ::com::sun::star::uno::RuntimeException ); + void SAL_CALL setDesignMode(sal_Bool bOn) throw (::com::sun::star::uno::RuntimeException); + +protected: + // OFormNavigationHelper overriables + virtual void getSupportedFeatures( ::std::vector< sal_Int32 >& /* [out] */ _rFeatureIds ); + virtual void featureStateChanged( sal_Int32 _nFeatureId, sal_Bool _bEnabled ); + virtual void allFeatureStatesChanged( ); + virtual bool isEnabled( sal_Int32 _nFeatureId ) const; + + // OImageControl overridables + virtual void actionPerformed_Impl( sal_Bool bNotifyListener, const ::com::sun::star::awt::MouseEvent& _rEvt ); + private: DECL_LINK( OnClick, void* ); + + /** to be called whenever the feature URL represented by our model has potentially changed + */ + void modelFeatureUrlPotentiallyChanged( ); + + /** retrieves the feature id (see OFormNavigationHelper) of the TargetURL of + the model. + */ + sal_Int32 getModelUrlFeatureId( ) const; + + /** starts or stops listening for changes in model properties we're interested in + */ + void startOrStopModelPropertyListening( bool _bStart ); }; //......................................................................... |