1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
23 #include <com/sun/star/awt/XVclWindowPeer.hpp>
25 #include <comphelper/streamsection.hxx>
26 #include <comphelper/basicio.hxx>
27 #include <tools/diagnose_ex.h>
28 #include <tools/debug.hxx>
29 #include <tools/urlobj.hxx>
30 #include <vcl/svapp.hxx>
31 #include <osl/mutex.hxx>
33 //.........................................................................
36 //.........................................................................
38 using namespace ::com::sun::star::uno
;
39 using namespace ::com::sun::star::sdb
;
40 using namespace ::com::sun::star::sdbc
;
41 using namespace ::com::sun::star::sdbcx
;
42 using namespace ::com::sun::star::beans
;
43 using namespace ::com::sun::star::container
;
44 using namespace ::com::sun::star::form
;
45 using namespace ::com::sun::star::awt
;
46 using namespace ::com::sun::star::io
;
47 using namespace ::com::sun::star::lang
;
48 using namespace ::com::sun::star::util
;
49 using ::com::sun::star::frame::XDispatchProviderInterceptor
;
51 //==================================================================
53 //==================================================================
54 DBG_NAME(OButtonModel
)
55 //------------------------------------------------------------------
56 InterfaceRef SAL_CALL
OButtonModel_CreateInstance(const Reference
<XMultiServiceFactory
>& _rxFactory
)
58 return *(new OButtonModel(_rxFactory
));
61 //------------------------------------------------------------------
62 OButtonModel::OButtonModel(const Reference
<XMultiServiceFactory
>& _rxFactory
)
63 :OClickableImageBaseModel( _rxFactory
, VCL_CONTROLMODEL_COMMANDBUTTON
, FRM_SUN_CONTROL_COMMANDBUTTON
)
64 // use the old control name for compatibility reasons
65 ,m_aResetHelper( *this, m_aMutex
)
66 ,m_eDefaultState( STATE_NOCHECK
)
68 DBG_CTOR( OButtonModel
, NULL
);
69 m_nClassId
= FormComponentType::COMMANDBUTTON
;
72 //------------------------------------------------------------------
73 Any SAL_CALL
OButtonModel::queryAggregation( const Type
& _type
) throw(RuntimeException
)
75 Any aReturn
= OClickableImageBaseModel::queryAggregation( _type
);
76 if ( !aReturn
.hasValue() )
77 aReturn
= OButtonModel_Base::queryInterface( _type
);
81 //------------------------------------------------------------------
82 Sequence
< Type
> OButtonModel::_getTypes()
84 return ::comphelper::concatSequences(
85 OClickableImageBaseModel::_getTypes(),
86 OButtonModel_Base::getTypes()
90 //------------------------------------------------------------------
91 OButtonModel::OButtonModel( const OButtonModel
* _pOriginal
, const Reference
<XMultiServiceFactory
>& _rxFactory
)
92 :OClickableImageBaseModel( _pOriginal
, _rxFactory
)
93 ,m_aResetHelper( *this, m_aMutex
)
94 ,m_eDefaultState( _pOriginal
->m_eDefaultState
)
96 DBG_CTOR( OButtonModel
, NULL
);
97 m_nClassId
= FormComponentType::COMMANDBUTTON
;
99 implInitializeImageURL();
102 //------------------------------------------------------------------------------
103 OButtonModel::~OButtonModel()
105 DBG_DTOR(OButtonModel
, NULL
);
108 //------------------------------------------------------------------------------
109 void OButtonModel::describeFixedProperties( Sequence
< Property
>& _rProps
) const
111 BEGIN_DESCRIBE_PROPERTIES( 6, OClickableImageBaseModel
)
112 DECL_PROP1( BUTTONTYPE
, FormButtonType
, BOUND
);
113 DECL_PROP1( DEFAULT_STATE
, sal_Int16
, BOUND
);
114 DECL_PROP1( DISPATCHURLINTERNAL
, sal_Bool
, BOUND
);
115 DECL_PROP1( TARGET_URL
, OUString
, BOUND
);
116 DECL_PROP1( TARGET_FRAME
, OUString
, BOUND
);
117 DECL_PROP1( TABINDEX
, sal_Int16
, BOUND
);
118 END_DESCRIBE_PROPERTIES();
121 //------------------------------------------------------------------------------
122 IMPLEMENT_DEFAULT_CLONING( OButtonModel
)
125 //------------------------------------------------------------------------------
126 StringSequence
OButtonModel::getSupportedServiceNames() throw()
128 StringSequence aSupported
= OClickableImageBaseModel::getSupportedServiceNames();
129 aSupported
.realloc( aSupported
.getLength() + 1 );
131 OUString
* pArray
= aSupported
.getArray();
132 pArray
[ aSupported
.getLength() - 1 ] = FRM_SUN_COMPONENT_COMMANDBUTTON
;
137 //------------------------------------------------------------------------------
138 OUString
OButtonModel::getServiceName() throw ( ::com::sun::star::uno::RuntimeException
)
140 return OUString(FRM_COMPONENT_COMMANDBUTTON
); // old (non-sun) name for compatibility !
143 //------------------------------------------------------------------------------
144 void OButtonModel::write(const Reference
<XObjectOutputStream
>& _rxOutStream
) throw (::com::sun::star::io::IOException
, ::com::sun::star::uno::RuntimeException
)
146 OClickableImageBaseModel::write(_rxOutStream
);
148 _rxOutStream
->writeShort(0x0003); // Version
151 OStreamSection
aSection( _rxOutStream
.get() );
152 // this will allow readers to skip unknown bytes in their dtor
154 _rxOutStream
->writeShort( (sal_uInt16
)m_eButtonType
);
156 OUString sTmp
= INetURLObject::decode( m_sTargetURL
, '%', INetURLObject::DECODE_UNAMBIGUOUS
);
157 _rxOutStream
<< sTmp
;
158 _rxOutStream
<< m_sTargetFrame
;
159 writeHelpTextCompatibly(_rxOutStream
);
160 _rxOutStream
<< isDispatchUrlInternal();
164 //------------------------------------------------------------------------------
165 void OButtonModel::read(const Reference
<XObjectInputStream
>& _rxInStream
) throw (::com::sun::star::io::IOException
, ::com::sun::star::uno::RuntimeException
)
167 OClickableImageBaseModel::read(_rxInStream
);
169 sal_uInt16 nVersion
= _rxInStream
->readShort(); // Version
174 m_eButtonType
= (FormButtonType
)_rxInStream
->readShort();
176 _rxInStream
>> m_sTargetURL
;
177 _rxInStream
>> m_sTargetFrame
;
183 m_eButtonType
= (FormButtonType
)_rxInStream
->readShort();
185 _rxInStream
>> m_sTargetURL
;
186 _rxInStream
>> m_sTargetFrame
;
187 readHelpTextCompatibly(_rxInStream
);
193 OStreamSection
aSection( _rxInStream
.get() );
194 // this will skip any unknown bytes in it's dtor
197 m_eButtonType
= (FormButtonType
)_rxInStream
->readShort();
200 _rxInStream
>> m_sTargetURL
;
203 _rxInStream
>> m_sTargetFrame
;
206 readHelpTextCompatibly(_rxInStream
);
210 _rxInStream
>> bDispath
;
211 setDispatchUrlInternal(bDispath
);
216 OSL_FAIL("OButtonModel::read : unknown version !");
217 m_eButtonType
= FormButtonType_PUSH
;
218 m_sTargetURL
= OUString();
219 m_sTargetFrame
= OUString();
224 //--------------------------------------------------------------------
225 void SAL_CALL
OButtonModel::disposing()
227 m_aResetHelper
.disposing();
228 OClickableImageBaseModel::disposing();
231 //--------------------------------------------------------------------
232 void SAL_CALL
OButtonModel::reset() throw (RuntimeException
)
234 if ( !m_aResetHelper
.approveReset() )
237 impl_resetNoBroadcast_nothrow();
239 m_aResetHelper
.notifyResetted();
242 //--------------------------------------------------------------------
243 void SAL_CALL
OButtonModel::addResetListener( const Reference
< XResetListener
>& _listener
) throw (RuntimeException
)
245 m_aResetHelper
.addResetListener( _listener
);
248 //--------------------------------------------------------------------
249 void SAL_CALL
OButtonModel::removeResetListener( const Reference
< XResetListener
>& _listener
) throw (RuntimeException
)
251 m_aResetHelper
.removeResetListener( _listener
);
254 //--------------------------------------------------------------------
255 void SAL_CALL
OButtonModel::getFastPropertyValue( Any
& _rValue
, sal_Int32 _nHandle
) const
259 case PROPERTY_ID_DEFAULT_STATE
:
260 _rValue
<<= (sal_Int16
)m_eDefaultState
;
264 OClickableImageBaseModel::getFastPropertyValue( _rValue
, _nHandle
);
269 //--------------------------------------------------------------------
270 void SAL_CALL
OButtonModel::setFastPropertyValue_NoBroadcast( sal_Int32 _nHandle
, const Any
& _rValue
) throw (Exception
)
274 case PROPERTY_ID_DEFAULT_STATE
:
276 sal_Int16
nDefaultState( (sal_Int16
)STATE_NOCHECK
);
277 OSL_VERIFY( _rValue
>>= nDefaultState
);
278 m_eDefaultState
= (ToggleState
)nDefaultState
;
279 impl_resetNoBroadcast_nothrow();
284 OClickableImageBaseModel::setFastPropertyValue_NoBroadcast( _nHandle
, _rValue
);
289 //--------------------------------------------------------------------
290 sal_Bool SAL_CALL
OButtonModel::convertFastPropertyValue( Any
& _rConvertedValue
, Any
& _rOldValue
, sal_Int32 _nHandle
, const Any
& _rValue
) throw (IllegalArgumentException
)
292 sal_Bool bModified
= sal_False
;
295 case PROPERTY_ID_DEFAULT_STATE
:
296 bModified
= tryPropertyValue( _rConvertedValue
, _rOldValue
, _rValue
, (sal_Int16
)m_eDefaultState
);
300 bModified
= OClickableImageBaseModel::convertFastPropertyValue( _rConvertedValue
, _rOldValue
, _nHandle
, _rValue
);
306 //--------------------------------------------------------------------
307 Any
OButtonModel::getPropertyDefaultByHandle( sal_Int32 _nHandle
) const
312 case PROPERTY_ID_DEFAULT_STATE
:
313 aDefault
<<= (sal_Int16
)STATE_NOCHECK
;
317 aDefault
= OClickableImageBaseModel::getPropertyDefaultByHandle( _nHandle
);
323 //--------------------------------------------------------------------
324 void OButtonModel::impl_resetNoBroadcast_nothrow()
328 setPropertyValue( PROPERTY_STATE
, getPropertyValue( PROPERTY_DEFAULT_STATE
) );
330 catch( const Exception
& )
332 DBG_UNHANDLED_EXCEPTION();
336 //==================================================================
338 //==================================================================
339 //------------------------------------------------------------------
340 InterfaceRef SAL_CALL
OButtonControl_CreateInstance(const Reference
<XMultiServiceFactory
>& _rxFactory
)
342 return *(new OButtonControl(_rxFactory
));
345 //------------------------------------------------------------------------------
346 Sequence
<Type
> OButtonControl::_getTypes()
348 return ::comphelper::concatSequences(
349 OButtonControl_BASE::getTypes(),
350 OClickableImageBaseControl::_getTypes(),
351 OFormNavigationHelper::getTypes()
355 //------------------------------------------------------------------------------
356 StringSequence
OButtonControl::getSupportedServiceNames() throw()
358 StringSequence aSupported
= OClickableImageBaseControl::getSupportedServiceNames();
359 aSupported
.realloc(aSupported
.getLength() + 1);
361 OUString
*pArray
= aSupported
.getArray();
362 pArray
[aSupported
.getLength()-1] = FRM_SUN_CONTROL_COMMANDBUTTON
;
366 //------------------------------------------------------------------------------
367 OButtonControl::OButtonControl(const Reference
<XMultiServiceFactory
>& _rxFactory
)
368 :OClickableImageBaseControl(_rxFactory
, VCL_CONTROL_COMMANDBUTTON
)
369 ,OFormNavigationHelper( _rxFactory
)
371 ,m_nTargetUrlFeatureId( -1 )
372 ,m_bEnabledByPropertyValue( sal_False
)
374 increment(m_refCount
);
376 // Register as ActionListener
377 Reference
<XButton
> xButton
;
378 query_aggregation( m_xAggregate
, xButton
);
380 xButton
->addActionListener(this);
382 // For Listener: refcount at one
383 decrement(m_refCount
);
386 //------------------------------------------------------------------------------
387 OButtonControl::~OButtonControl()
390 Application::RemoveUserEvent(m_nClickEvent
);
394 //------------------------------------------------------------------------------
395 Any SAL_CALL
OButtonControl::queryAggregation(const Type
& _rType
) throw (RuntimeException
)
397 // if asked for the XTypeProvider, don't let OButtonControl_BASE do this
399 if ( !_rType
.equals( ::getCppuType( static_cast< Reference
< XTypeProvider
>* >( NULL
) ) ) )
400 aReturn
= OButtonControl_BASE::queryInterface( _rType
);
402 if ( !aReturn
.hasValue() )
403 aReturn
= OClickableImageBaseControl::queryAggregation( _rType
);
405 if ( !aReturn
.hasValue() )
406 aReturn
= OFormNavigationHelper::queryInterface( _rType
);
411 //------------------------------------------------------------------------------
412 void SAL_CALL
OButtonControl::disposing()
414 startOrStopModelPropertyListening( false );
416 OClickableImageBaseControl::disposing();
417 OFormNavigationHelper::dispose();
420 //------------------------------------------------------------------------------
421 void SAL_CALL
OButtonControl::disposing( const EventObject
& _rSource
) throw( RuntimeException
)
423 OControl::disposing( _rSource
);
424 OFormNavigationHelper::disposing( _rSource
);
428 //------------------------------------------------------------------------------
429 void OButtonControl::actionPerformed(const ActionEvent
& /*rEvent*/) throw ( ::com::sun::star::uno::RuntimeException
)
431 // Asynchronous for starutil::URL-Button
432 sal_uLong n
= Application::PostUserEvent( LINK(this, OButtonControl
,OnClick
) );
434 ::osl::MutexGuard
aGuard( m_aMutex
);
439 //------------------------------------------------------------------------------
440 IMPL_LINK_NOARG(OButtonControl
, OnClick
)
442 ::osl::ClearableMutexGuard
aGuard( m_aMutex
);
445 if (m_aApproveActionListeners
.getLength())
447 // if there are listeners, start the action in an own thread, to not allow
448 // them to block us here (we're in the application's main thread)
449 getImageProducerThread()->addEvent();
453 // Else, don't. We then must not notify the Listeners in any case,
454 // not even if added later on.
457 // recognize the button type
458 Reference
<XPropertySet
> xSet(getModel(), UNO_QUERY
);
462 if (FormButtonType_PUSH
== *(FormButtonType
*)xSet
->getPropertyValue(PROPERTY_BUTTONTYPE
).getValue())
464 // notify the action listeners for a push button
465 ::cppu::OInterfaceIteratorHelper
aIter(m_aActionListeners
);
466 ActionEvent
aEvt(static_cast<XWeak
*>(this), m_aActionCommand
);
467 while(aIter
.hasMoreElements() )
470 // and catch them on a per-listener basis - if one listener fails, the others still need
474 static_cast< XActionListener
* >( aIter
.next() )->actionPerformed(aEvt
);
477 catch( const RuntimeException
& )
482 catch( const Exception
& )
484 OSL_FAIL( "OButtonControl::OnClick: caught a exception other than RuntimeException!" );
489 actionPerformed_Impl( sal_False
, ::com::sun::star::awt::MouseEvent() );
494 //------------------------------------------------------------------------------
495 void OButtonControl::actionPerformed_Impl( sal_Bool _bNotifyListener
, const ::com::sun::star::awt::MouseEvent
& _rEvt
)
498 sal_Int16 nFeatureId
= -1;
500 ::osl::MutexGuard
aGuard( m_aMutex
);
501 nFeatureId
= m_nTargetUrlFeatureId
;
504 if ( nFeatureId
!= -1 )
506 if ( !approveAction() )
509 SolarMutexGuard aGuard
;
510 dispatch( nFeatureId
);
515 OClickableImageBaseControl::actionPerformed_Impl( _bNotifyListener
, _rEvt
);
519 //------------------------------------------------------------------------------
520 void OButtonControl::setLabel(const OUString
& Label
) throw( RuntimeException
)
522 Reference
<XButton
> xButton
;
523 query_aggregation( m_xAggregate
, xButton
);
525 xButton
->setLabel(Label
);
528 //------------------------------------------------------------------------------
529 void SAL_CALL
OButtonControl::setActionCommand(const OUString
& _rCommand
) throw( RuntimeException
)
532 ::osl::MutexGuard
aGuard( m_aMutex
);
533 m_aActionCommand
= _rCommand
;
536 Reference
<XButton
> xButton
;
537 query_aggregation( m_xAggregate
, xButton
);
539 xButton
->setActionCommand(_rCommand
);
542 //------------------------------------------------------------------------------
543 void SAL_CALL
OButtonControl::addActionListener(const Reference
<XActionListener
>& _rxListener
) throw( RuntimeException
)
545 m_aActionListeners
.addInterface(_rxListener
);
548 //------------------------------------------------------------------------------
549 void SAL_CALL
OButtonControl::removeActionListener(const Reference
<XActionListener
>& _rxListener
) throw( RuntimeException
)
551 m_aActionListeners
.removeInterface(_rxListener
);
554 //------------------------------------------------------------------------------
555 class DoPropertyListening
558 Reference
< XPropertySet
> m_xProps
;
559 Reference
< XPropertyChangeListener
> m_xListener
;
560 bool m_bStartListening
;
564 const Reference
< XInterface
>& _rxComponent
,
565 const Reference
< XPropertyChangeListener
>& _rxListener
,
569 void handleListening( const OUString
& _rPropertyName
);
572 //..............................................................................
573 DoPropertyListening::DoPropertyListening(
574 const Reference
< XInterface
>& _rxComponent
, const Reference
< XPropertyChangeListener
>& _rxListener
,
576 :m_xProps( _rxComponent
, UNO_QUERY
)
577 ,m_xListener( _rxListener
)
578 ,m_bStartListening( _bStart
)
580 DBG_ASSERT( m_xProps
.is() || !_rxComponent
.is(), "DoPropertyListening::DoPropertyListening: valid component, but no property set!" );
581 DBG_ASSERT( m_xListener
.is(), "DoPropertyListening::DoPropertyListening: invalid listener!" );
584 //..............................................................................
585 void DoPropertyListening::handleListening( const OUString
& _rPropertyName
)
589 if ( m_bStartListening
)
590 m_xProps
->addPropertyChangeListener( _rPropertyName
, m_xListener
);
592 m_xProps
->removePropertyChangeListener( _rPropertyName
, m_xListener
);
596 //------------------------------------------------------------------------------
597 void OButtonControl::startOrStopModelPropertyListening( bool _bStart
)
599 DoPropertyListening
aListeningHandler( getModel(), this, _bStart
);
600 aListeningHandler
.handleListening( PROPERTY_TARGET_URL
);
601 aListeningHandler
.handleListening( PROPERTY_BUTTONTYPE
);
602 aListeningHandler
.handleListening( PROPERTY_ENABLED
);
605 //------------------------------------------------------------------------------
606 sal_Bool SAL_CALL
OButtonControl::setModel( const Reference
< XControlModel
>& _rxModel
) throw ( RuntimeException
)
608 startOrStopModelPropertyListening( false );
609 sal_Bool bResult
= OClickableImageBaseControl::setModel( _rxModel
);
610 startOrStopModelPropertyListening( true );
612 m_bEnabledByPropertyValue
= sal_True
;
613 Reference
< XPropertySet
> xModelProps( _rxModel
, UNO_QUERY
);
614 if ( xModelProps
.is() )
615 xModelProps
->getPropertyValue( PROPERTY_ENABLED
) >>= m_bEnabledByPropertyValue
;
617 modelFeatureUrlPotentiallyChanged( );
622 //------------------------------------------------------------------------------
623 void OButtonControl::modelFeatureUrlPotentiallyChanged( )
625 sal_Int16 nOldUrlFeatureId
= m_nTargetUrlFeatureId
;
627 // doe we have another TargetURL now? If so, we need to update our dispatches
628 m_nTargetUrlFeatureId
= getModelUrlFeatureId( );
629 if ( nOldUrlFeatureId
!= m_nTargetUrlFeatureId
)
631 invalidateSupportedFeaturesSet();
632 if ( !isDesignMode() )
637 //------------------------------------------------------------------------------
638 void SAL_CALL
OButtonControl::propertyChange( const PropertyChangeEvent
& _rEvent
) throw ( RuntimeException
)
640 if ( _rEvent
.PropertyName
.equals( PROPERTY_TARGET_URL
)
641 || _rEvent
.PropertyName
.equals( PROPERTY_BUTTONTYPE
)
644 modelFeatureUrlPotentiallyChanged( );
646 else if ( _rEvent
.PropertyName
.equals( PROPERTY_ENABLED
) )
648 _rEvent
.NewValue
>>= m_bEnabledByPropertyValue
;
652 //------------------------------------------------------------------------------
655 bool isFormControllerURL( const OUString
& _rURL
)
657 return ( _rURL
.getLength() > RTL_CONSTASCII_LENGTH( ".uno:FormController/" ) )
658 && ( _rURL
.startsWith( ".uno:FormController/" ) );
662 //------------------------------------------------------------------------------
663 sal_Int16
OButtonControl::getModelUrlFeatureId( ) const
665 sal_Int16 nFeatureId
= -1;
667 // some URL related properties of the model
669 FormButtonType eButtonType
= FormButtonType_PUSH
;
671 Reference
< XPropertySet
> xModelProps( const_cast< OButtonControl
* >( this )->getModel(), UNO_QUERY
);
672 if ( xModelProps
.is() )
674 xModelProps
->getPropertyValue( PROPERTY_TARGET_URL
) >>= sUrl
;
675 xModelProps
->getPropertyValue( PROPERTY_BUTTONTYPE
) >>= eButtonType
;
678 // are we a URL button?
679 if ( eButtonType
== FormButtonType_URL
)
681 // is it a feature URL?
682 if ( isFormControllerURL( sUrl
) )
684 OFormNavigationMapper
aMapper( m_aContext
.getLegacyServiceFactory() );
685 nFeatureId
= aMapper
.getFeatureId( sUrl
);
692 //------------------------------------------------------------------
693 void SAL_CALL
OButtonControl::setDesignMode( sal_Bool _bOn
) throw( RuntimeException
)
695 OClickableImageBaseControl::setDesignMode( _bOn
);
698 disconnectDispatchers();
700 connectDispatchers();
701 // this will connect if not already connected and just update else
704 //------------------------------------------------------------------------------
705 void OButtonControl::getSupportedFeatures( ::std::vector
< sal_Int16
>& /* [out] */ _rFeatureIds
)
707 if ( -1 != m_nTargetUrlFeatureId
)
708 _rFeatureIds
.push_back( m_nTargetUrlFeatureId
);
711 //------------------------------------------------------------------
712 void OButtonControl::featureStateChanged( sal_Int16 _nFeatureId
, sal_Bool _bEnabled
)
714 if ( _nFeatureId
== m_nTargetUrlFeatureId
)
716 // enable or disable our peer, according to the new state
717 Reference
< XVclWindowPeer
> xPeer( getPeer(), UNO_QUERY
);
719 xPeer
->setProperty( PROPERTY_ENABLED
, makeAny( m_bEnabledByPropertyValue
? _bEnabled
: sal_False
) );
720 // if we're disabled according to our model's property, then
721 // we don't care for the feature state, but *are* disabled.
722 // If the model's property states that we're enabled, then we *do*
723 // care for the feature state
727 OFormNavigationHelper::featureStateChanged( _nFeatureId
, _bEnabled
);
730 //------------------------------------------------------------------
731 void OButtonControl::allFeatureStatesChanged( )
733 if ( -1 != m_nTargetUrlFeatureId
)
734 // we have only one supported feature, so simulate it has changed ...
735 featureStateChanged( m_nTargetUrlFeatureId
, isEnabled( m_nTargetUrlFeatureId
) );
738 OFormNavigationHelper::allFeatureStatesChanged( );
741 //------------------------------------------------------------------
742 bool OButtonControl::isEnabled( sal_Int16 _nFeatureId
) const
744 if ( const_cast< OButtonControl
* >( this )->isDesignMode() )
745 // TODO: the model property?
748 return OFormNavigationHelper::isEnabled( _nFeatureId
);
751 //--------------------------------------------------------------------
752 void SAL_CALL
OButtonControl::registerDispatchProviderInterceptor( const Reference
< XDispatchProviderInterceptor
>& _rxInterceptor
) throw (RuntimeException
)
754 OClickableImageBaseControl::registerDispatchProviderInterceptor( _rxInterceptor
);
755 OFormNavigationHelper::registerDispatchProviderInterceptor( _rxInterceptor
);
758 //--------------------------------------------------------------------
759 void SAL_CALL
OButtonControl::releaseDispatchProviderInterceptor( const Reference
< XDispatchProviderInterceptor
>& _rxInterceptor
) throw (RuntimeException
)
761 OClickableImageBaseControl::releaseDispatchProviderInterceptor( _rxInterceptor
);
762 OFormNavigationHelper::releaseDispatchProviderInterceptor( _rxInterceptor
);
765 //.........................................................................
767 //.........................................................................
769 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */