bump product version to 7.6.3.2-android
[LibreOffice.git] / forms / source / component / Button.cxx
blob28cac777ea43231774deba63c91c696a267ab77e
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 .
21 #include "Button.hxx"
22 #include <property.hxx>
23 #include <services.hxx>
25 #include <com/sun/star/awt/XVclWindowPeer.hpp>
26 #include <com/sun/star/beans/PropertyAttribute.hpp>
27 #include <com/sun/star/form/FormComponentType.hpp>
29 #include <comphelper/streamsection.hxx>
30 #include <comphelper/basicio.hxx>
31 #include <comphelper/property.hxx>
32 #include <o3tl/any.hxx>
33 #include <o3tl/string_view.hxx>
34 #include <comphelper/diagnose_ex.hxx>
35 #include <tools/debug.hxx>
36 #include <tools/urlobj.hxx>
37 #include <vcl/svapp.hxx>
38 #include <osl/mutex.hxx>
40 namespace frm
44 using namespace ::com::sun::star::uno;
45 using namespace ::com::sun::star::sdb;
46 using namespace ::com::sun::star::sdbc;
47 using namespace ::com::sun::star::beans;
48 using namespace ::com::sun::star::container;
49 using namespace ::com::sun::star::form;
50 using namespace ::com::sun::star::awt;
51 using namespace ::com::sun::star::io;
52 using namespace ::com::sun::star::lang;
53 using namespace ::com::sun::star::util;
54 using ::com::sun::star::frame::XDispatchProviderInterceptor;
57 //= OButtonModel
60 OButtonModel::OButtonModel(const Reference<XComponentContext>& _rxFactory)
61 :OClickableImageBaseModel( _rxFactory, VCL_CONTROLMODEL_COMMANDBUTTON, FRM_SUN_CONTROL_COMMANDBUTTON )
62 // use the old control name for compatibility reasons
63 ,m_aResetHelper( *this, m_aMutex )
64 ,m_eDefaultState( TRISTATE_FALSE )
66 m_nClassId = FormComponentType::COMMANDBUTTON;
70 Any SAL_CALL OButtonModel::queryAggregation( const Type& _type )
72 Any aReturn = OClickableImageBaseModel::queryAggregation( _type );
73 if ( !aReturn.hasValue() )
74 aReturn = OButtonModel_Base::queryInterface( _type );
75 return aReturn;
79 Sequence< Type > OButtonModel::_getTypes()
81 return ::comphelper::concatSequences(
82 OClickableImageBaseModel::_getTypes(),
83 OButtonModel_Base::getTypes()
88 OButtonModel::OButtonModel( const OButtonModel* _pOriginal, const Reference<XComponentContext>& _rxFactory )
89 :OClickableImageBaseModel( _pOriginal, _rxFactory )
90 ,m_aResetHelper( *this, m_aMutex )
91 ,m_eDefaultState( _pOriginal->m_eDefaultState )
93 m_nClassId = FormComponentType::COMMANDBUTTON;
95 implInitializeImageURL();
99 OButtonModel::~OButtonModel()
104 void OButtonModel::describeFixedProperties( Sequence< Property >& _rProps ) const
106 OClickableImageBaseModel::describeFixedProperties( _rProps );
107 sal_Int32 nOldCount = _rProps.getLength();
108 _rProps.realloc( nOldCount + 6);
109 css::beans::Property* pProperties = _rProps.getArray() + nOldCount;
110 *pProperties++ = css::beans::Property(PROPERTY_BUTTONTYPE, PROPERTY_ID_BUTTONTYPE, cppu::UnoType<FormButtonType>::get(), css::beans::PropertyAttribute::BOUND);
111 *pProperties++ = css::beans::Property(PROPERTY_DEFAULT_STATE, PROPERTY_ID_DEFAULT_STATE, cppu::UnoType<sal_Int16>::get(), css::beans::PropertyAttribute::BOUND);
112 *pProperties++ = css::beans::Property(PROPERTY_DISPATCHURLINTERNAL, PROPERTY_ID_DISPATCHURLINTERNAL, cppu::UnoType<sal_Bool>::get(), css::beans::PropertyAttribute::BOUND);
113 *pProperties++ = css::beans::Property(PROPERTY_TARGET_URL, PROPERTY_ID_TARGET_URL, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::BOUND);
114 *pProperties++ = css::beans::Property(PROPERTY_TARGET_FRAME, PROPERTY_ID_TARGET_FRAME, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::BOUND);
115 *pProperties++ = css::beans::Property(PROPERTY_TABINDEX, PROPERTY_ID_TABINDEX, cppu::UnoType<sal_Int16>::get(), css::beans::PropertyAttribute::BOUND);
116 DBG_ASSERT( pProperties == _rProps.getArray() + _rProps.getLength(), "<...>::describeFixedProperties/getInfoHelper: forgot to adjust the count ?");
120 css::uno::Reference< css::util::XCloneable > SAL_CALL OButtonModel::createClone()
122 rtl::Reference<OButtonModel> pClone = new OButtonModel(this, getContext());
123 pClone->clonedFrom(this);
124 return pClone;
128 // XServiceInfo
130 css::uno::Sequence<OUString> OButtonModel::getSupportedServiceNames()
132 css::uno::Sequence<OUString> aSupported = OClickableImageBaseModel::getSupportedServiceNames();
133 aSupported.realloc( aSupported.getLength() + 2 );
135 OUString* pArray = aSupported.getArray();
136 pArray[ aSupported.getLength() - 2 ] = FRM_SUN_COMPONENT_COMMANDBUTTON;
137 pArray[ aSupported.getLength() - 1 ] = FRM_COMPONENT_COMMANDBUTTON;
139 return aSupported;
143 OUString OButtonModel::getServiceName()
145 return FRM_COMPONENT_COMMANDBUTTON; // old (non-sun) name for compatibility !
149 void OButtonModel::write(const Reference<XObjectOutputStream>& _rxOutStream)
151 OClickableImageBaseModel::write(_rxOutStream);
153 _rxOutStream->writeShort(0x0003); // Version
156 OStreamSection aSection( _rxOutStream );
157 // this will allow readers to skip unknown bytes in their dtor
159 _rxOutStream->writeShort( static_cast<sal_uInt16>(m_eButtonType) );
161 OUString sTmp = INetURLObject::decode( m_sTargetURL, INetURLObject::DecodeMechanism::Unambiguous);
162 _rxOutStream << sTmp;
163 _rxOutStream << m_sTargetFrame;
164 writeHelpTextCompatibly(_rxOutStream);
165 _rxOutStream << isDispatchUrlInternal();
170 void OButtonModel::read(const Reference<XObjectInputStream>& _rxInStream)
172 OClickableImageBaseModel::read(_rxInStream);
174 sal_uInt16 nVersion = _rxInStream->readShort(); // Version
175 switch (nVersion)
177 case 0x0001:
179 m_eButtonType = static_cast<FormButtonType>(_rxInStream->readShort());
181 _rxInStream >> m_sTargetURL;
182 _rxInStream >> m_sTargetFrame;
184 break;
186 case 0x0002:
188 m_eButtonType = static_cast<FormButtonType>(_rxInStream->readShort());
190 _rxInStream >> m_sTargetURL;
191 _rxInStream >> m_sTargetFrame;
192 readHelpTextCompatibly(_rxInStream);
194 break;
196 case 0x0003:
198 OStreamSection aSection( _rxInStream );
199 // this will skip any unknown bytes in its dtor
201 // button type
202 m_eButtonType = static_cast<FormButtonType>(_rxInStream->readShort());
204 // URL
205 _rxInStream >> m_sTargetURL;
207 // target frame
208 _rxInStream >> m_sTargetFrame;
210 // help text
211 readHelpTextCompatibly(_rxInStream);
213 // DispatchInternal
214 bool bDispatch;
215 _rxInStream >> bDispatch;
216 setDispatchUrlInternal(bDispatch);
218 break;
220 default:
221 OSL_FAIL("OButtonModel::read : unknown version !");
222 m_eButtonType = FormButtonType_PUSH;
223 m_sTargetURL.clear();
224 m_sTargetFrame.clear();
225 break;
230 void SAL_CALL OButtonModel::disposing()
232 m_aResetHelper.disposing();
233 OClickableImageBaseModel::disposing();
237 void SAL_CALL OButtonModel::reset()
239 if ( !m_aResetHelper.approveReset() )
240 return;
242 impl_resetNoBroadcast_nothrow();
244 m_aResetHelper.notifyResetted();
248 void SAL_CALL OButtonModel::addResetListener( const Reference< XResetListener >& _listener )
250 m_aResetHelper.addResetListener( _listener );
254 void SAL_CALL OButtonModel::removeResetListener( const Reference< XResetListener >& _listener )
256 m_aResetHelper.removeResetListener( _listener );
260 void SAL_CALL OButtonModel::getFastPropertyValue( Any& _rValue, sal_Int32 _nHandle ) const
262 switch ( _nHandle )
264 case PROPERTY_ID_DEFAULT_STATE:
265 _rValue <<= static_cast<sal_Int16>(m_eDefaultState);
266 break;
268 default:
269 OClickableImageBaseModel::getFastPropertyValue( _rValue, _nHandle );
270 break;
275 void SAL_CALL OButtonModel::setFastPropertyValue_NoBroadcast( sal_Int32 _nHandle, const Any& _rValue )
277 switch ( _nHandle )
279 case PROPERTY_ID_DEFAULT_STATE:
281 sal_Int16 nDefaultState = sal_Int16(TRISTATE_FALSE);
282 OSL_VERIFY( _rValue >>= nDefaultState );
283 m_eDefaultState = static_cast<ToggleState>(nDefaultState);
284 impl_resetNoBroadcast_nothrow();
286 break;
288 default:
289 OClickableImageBaseModel::setFastPropertyValue_NoBroadcast( _nHandle, _rValue );
290 break;
295 sal_Bool SAL_CALL OButtonModel::convertFastPropertyValue( Any& _rConvertedValue, Any& _rOldValue, sal_Int32 _nHandle, const Any& _rValue )
297 bool bModified = false;
298 switch ( _nHandle )
300 case PROPERTY_ID_DEFAULT_STATE:
301 bModified = tryPropertyValue( _rConvertedValue, _rOldValue, _rValue, static_cast<sal_Int16>(m_eDefaultState) );
302 break;
304 default:
305 bModified = OClickableImageBaseModel::convertFastPropertyValue( _rConvertedValue, _rOldValue, _nHandle, _rValue );
306 break;
308 return bModified;
312 Any OButtonModel::getPropertyDefaultByHandle( sal_Int32 _nHandle ) const
314 Any aDefault;
315 switch ( _nHandle )
317 case PROPERTY_ID_DEFAULT_STATE:
318 aDefault <<= sal_Int16(TRISTATE_FALSE);
319 break;
321 default:
322 aDefault = OClickableImageBaseModel::getPropertyDefaultByHandle( _nHandle );
323 break;
325 return aDefault;
329 void OButtonModel::impl_resetNoBroadcast_nothrow()
333 setPropertyValue( PROPERTY_STATE, getPropertyValue( PROPERTY_DEFAULT_STATE ) );
335 catch( const Exception& )
337 DBG_UNHANDLED_EXCEPTION("forms.component");
342 // OButtonControl
345 Sequence<Type> OButtonControl::_getTypes()
347 return ::comphelper::concatSequences(
348 OButtonControl_BASE::getTypes(),
349 OClickableImageBaseControl::_getTypes(),
350 OFormNavigationHelper::getTypes()
355 css::uno::Sequence<OUString> OButtonControl::getSupportedServiceNames()
357 css::uno::Sequence<OUString> aSupported = OClickableImageBaseControl::getSupportedServiceNames();
358 aSupported.realloc(aSupported.getLength() + 2);
360 OUString*pArray = aSupported.getArray();
361 pArray[aSupported.getLength()-2] = FRM_SUN_CONTROL_COMMANDBUTTON;
362 pArray[aSupported.getLength()-1] = STARDIV_ONE_FORM_CONTROL_COMMANDBUTTON;
363 return aSupported;
367 OButtonControl::OButtonControl(const Reference<XComponentContext>& _rxFactory)
368 :OClickableImageBaseControl(_rxFactory, VCL_CONTROL_COMMANDBUTTON)
369 ,OFormNavigationHelper( _rxFactory )
370 ,m_nClickEvent( nullptr )
371 ,m_nTargetUrlFeatureId( -1 )
372 ,m_bEnabledByPropertyValue( false )
374 osl_atomic_increment(&m_refCount);
376 // Register as ActionListener
377 Reference<XButton> xButton;
378 query_aggregation( m_xAggregate, xButton);
379 if (xButton.is())
380 xButton->addActionListener(this);
382 // For Listener: refcount at one
383 osl_atomic_decrement(&m_refCount);
387 OButtonControl::~OButtonControl()
389 if (m_nClickEvent)
390 Application::RemoveUserEvent(m_nClickEvent);
393 // UNO binding
395 Any SAL_CALL OButtonControl::queryAggregation(const Type& _rType)
397 // if asked for the XTypeProvider, don't let OButtonControl_BASE do this
398 Any aReturn;
399 if ( !_rType.equals( cppu::UnoType<XTypeProvider>::get() ) )
400 aReturn = OButtonControl_BASE::queryInterface( _rType );
402 if ( !aReturn.hasValue() )
403 aReturn = OClickableImageBaseControl::queryAggregation( _rType );
405 if ( !aReturn.hasValue() )
406 aReturn = OFormNavigationHelper::queryInterface( _rType );
408 return aReturn;
412 void SAL_CALL OButtonControl::disposing()
414 startOrStopModelPropertyListening( false );
416 OClickableImageBaseControl::disposing();
417 OFormNavigationHelper::dispose();
421 void SAL_CALL OButtonControl::disposing( const EventObject& _rSource )
423 OControl::disposing( _rSource );
424 OFormNavigationHelper::disposing( _rSource );
427 // ActionListener
429 void OButtonControl::actionPerformed(const ActionEvent& /*rEvent*/)
431 // Asynchronous for css::util::URL-Button
432 ImplSVEvent * n = Application::PostUserEvent( LINK(this, OButtonControl, OnClick) );
434 ::osl::MutexGuard aGuard( m_aMutex );
435 m_nClickEvent = n;
440 IMPL_LINK_NOARG(OButtonControl, OnClick, void*, void)
442 ::osl::ClearableMutexGuard aGuard( m_aMutex );
443 m_nClickEvent = nullptr;
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();
451 else
453 // Else, don't. We then must not notify the Listeners in any case,
454 // not even if added later on.
455 aGuard.clear();
457 // recognize the button type
458 Reference<XPropertySet> xSet(getModel(), UNO_QUERY);
459 if (!xSet.is())
460 return;
462 if (FormButtonType_PUSH == *o3tl::doAccess<FormButtonType>(xSet->getPropertyValue(PROPERTY_BUTTONTYPE)))
464 // notify the action listeners for a push button
465 ::comphelper::OInterfaceIteratorHelper3 aIter(m_aActionListeners);
466 ActionEvent aEvt(static_cast<XWeak*>(this), m_aActionCommand);
467 while(aIter.hasMoreElements() )
469 // catch exceptions
470 // and catch them on a per-listener basis - if one listener fails, the others still need
471 // to get notified
474 aIter.next()->actionPerformed(aEvt);
476 #ifdef DBG_UTIL
477 catch( const RuntimeException& )
479 // silence this
481 #endif
482 catch( const Exception& )
484 TOOLS_WARN_EXCEPTION( "forms.component", "OButtonControl::OnClick: caught an exception other than RuntimeException!" );
488 else
489 actionPerformed_Impl( false, css::awt::MouseEvent() );
494 void OButtonControl::actionPerformed_Impl( bool _bNotifyListener, const css::awt::MouseEvent& _rEvt )
497 sal_Int16 nFeatureId = -1;
499 ::osl::MutexGuard aGuard( m_aMutex );
500 nFeatureId = m_nTargetUrlFeatureId;
503 if ( nFeatureId != -1 )
505 if ( !approveAction() )
506 return;
508 SolarMutexGuard aGuard;
509 dispatch( nFeatureId );
510 return;
514 OClickableImageBaseControl::actionPerformed_Impl( _bNotifyListener, _rEvt );
517 // XButton
519 void OButtonControl::setLabel(const OUString& Label)
521 Reference<XButton> xButton;
522 query_aggregation( m_xAggregate, xButton );
523 if (xButton.is())
524 xButton->setLabel(Label);
528 void SAL_CALL OButtonControl::setActionCommand(const OUString& _rCommand)
531 ::osl::MutexGuard aGuard( m_aMutex );
532 m_aActionCommand = _rCommand;
535 Reference<XButton> xButton;
536 query_aggregation( m_xAggregate, xButton);
537 if (xButton.is())
538 xButton->setActionCommand(_rCommand);
542 void SAL_CALL OButtonControl::addActionListener(const Reference<XActionListener>& _rxListener)
544 m_aActionListeners.addInterface(_rxListener);
548 void SAL_CALL OButtonControl::removeActionListener(const Reference<XActionListener>& _rxListener)
550 m_aActionListeners.removeInterface(_rxListener);
553 namespace {
555 class DoPropertyListening
557 private:
558 Reference< XPropertySet > m_xProps;
559 Reference< XPropertyChangeListener > m_xListener;
560 bool m_bStartListening;
562 public:
563 DoPropertyListening(
564 const Reference< XInterface >& _rxComponent,
565 const Reference< XPropertyChangeListener >& _rxListener,
566 bool _bStart
569 void handleListening( const OUString& _rPropertyName );
574 DoPropertyListening::DoPropertyListening(
575 const Reference< XInterface >& _rxComponent, const Reference< XPropertyChangeListener >& _rxListener,
576 bool _bStart )
577 :m_xProps( _rxComponent, UNO_QUERY )
578 ,m_xListener( _rxListener )
579 ,m_bStartListening( _bStart )
581 DBG_ASSERT( m_xProps.is() || !_rxComponent.is(), "DoPropertyListening::DoPropertyListening: valid component, but no property set!" );
582 DBG_ASSERT( m_xListener.is(), "DoPropertyListening::DoPropertyListening: invalid listener!" );
586 void DoPropertyListening::handleListening( const OUString& _rPropertyName )
588 if ( m_xProps.is() )
590 if ( m_bStartListening )
591 m_xProps->addPropertyChangeListener( _rPropertyName, m_xListener );
592 else
593 m_xProps->removePropertyChangeListener( _rPropertyName, m_xListener );
598 void OButtonControl::startOrStopModelPropertyListening( bool _bStart )
600 DoPropertyListening aListeningHandler( getModel(), this, _bStart );
601 aListeningHandler.handleListening( PROPERTY_TARGET_URL );
602 aListeningHandler.handleListening( PROPERTY_BUTTONTYPE );
603 aListeningHandler.handleListening( PROPERTY_ENABLED );
607 sal_Bool SAL_CALL OButtonControl::setModel( const Reference< XControlModel >& _rxModel )
609 startOrStopModelPropertyListening( false );
610 bool bResult = OClickableImageBaseControl::setModel( _rxModel );
611 startOrStopModelPropertyListening( true );
613 m_bEnabledByPropertyValue = true;
614 Reference< XPropertySet > xModelProps( _rxModel, UNO_QUERY );
615 if ( xModelProps.is() )
616 xModelProps->getPropertyValue( PROPERTY_ENABLED ) >>= m_bEnabledByPropertyValue;
618 modelFeatureUrlPotentiallyChanged( );
620 return bResult;
624 void OButtonControl::modelFeatureUrlPotentiallyChanged( )
626 sal_Int16 nOldUrlFeatureId = m_nTargetUrlFeatureId;
628 // Do we have another TargetURL now? If so, we need to update our dispatches
629 m_nTargetUrlFeatureId = getModelUrlFeatureId( );
630 if ( nOldUrlFeatureId != m_nTargetUrlFeatureId )
632 invalidateSupportedFeaturesSet();
633 if ( !isDesignMode() )
634 updateDispatches( );
639 void SAL_CALL OButtonControl::propertyChange( const PropertyChangeEvent& _rEvent )
641 if ( _rEvent.PropertyName == PROPERTY_TARGET_URL
642 || _rEvent.PropertyName == PROPERTY_BUTTONTYPE
645 modelFeatureUrlPotentiallyChanged( );
647 else if ( _rEvent.PropertyName == PROPERTY_ENABLED )
649 _rEvent.NewValue >>= m_bEnabledByPropertyValue;
654 namespace
656 bool isFormControllerURL( std::u16string_view _rURL )
658 static constexpr std::u16string_view PREFIX = u".uno:FormController/";
659 return ( _rURL.size() > PREFIX.size() )
660 && ( o3tl::starts_with(_rURL, PREFIX ) );
665 sal_Int16 OButtonControl::getModelUrlFeatureId( ) const
667 sal_Int16 nFeatureId = -1;
669 // some URL related properties of the model
670 OUString sUrl;
671 FormButtonType eButtonType = FormButtonType_PUSH;
673 Reference< XPropertySet > xModelProps( const_cast< OButtonControl* >( this )->getModel(), UNO_QUERY );
674 if ( xModelProps.is() )
676 xModelProps->getPropertyValue( PROPERTY_TARGET_URL ) >>= sUrl;
677 xModelProps->getPropertyValue( PROPERTY_BUTTONTYPE ) >>= eButtonType;
680 // are we a URL button?
681 if ( eButtonType == FormButtonType_URL )
683 // is it a feature URL?
684 if ( isFormControllerURL( sUrl ) )
686 nFeatureId = OFormNavigationMapper::getFeatureId( sUrl );
690 return nFeatureId;
694 void SAL_CALL OButtonControl::setDesignMode( sal_Bool _bOn )
696 OClickableImageBaseControl::setDesignMode( _bOn );
698 if ( _bOn )
699 disconnectDispatchers();
700 else
701 connectDispatchers();
702 // this will connect if not already connected and just update else
706 void OButtonControl::getSupportedFeatures( ::std::vector< sal_Int16 >& /* [out] */ _rFeatureIds )
708 if ( -1 != m_nTargetUrlFeatureId )
709 _rFeatureIds.push_back( m_nTargetUrlFeatureId );
713 void OButtonControl::featureStateChanged( sal_Int16 _nFeatureId, bool _bEnabled )
715 if ( _nFeatureId == m_nTargetUrlFeatureId )
717 // enable or disable our peer, according to the new state
718 Reference< XVclWindowPeer > xPeer( getPeer(), UNO_QUERY );
719 if ( xPeer.is() )
720 xPeer->setProperty( PROPERTY_ENABLED, Any( m_bEnabledByPropertyValue && _bEnabled ) );
721 // if we're disabled according to our model's property, then
722 // we don't care for the feature state, but *are* disabled.
723 // If the model's property states that we're enabled, then we *do*
724 // care for the feature state
727 // base class
728 OFormNavigationHelper::featureStateChanged( _nFeatureId, _bEnabled );
732 void OButtonControl::allFeatureStatesChanged( )
734 if ( -1 != m_nTargetUrlFeatureId )
735 // we have only one supported feature, so simulate it has changed ...
736 featureStateChanged( m_nTargetUrlFeatureId, isEnabled( m_nTargetUrlFeatureId ) );
738 // base class
739 OFormNavigationHelper::allFeatureStatesChanged( );
743 bool OButtonControl::isEnabled( sal_Int16 _nFeatureId ) const
745 if ( const_cast< OButtonControl* >( this )->isDesignMode() )
746 // TODO: the model property?
747 return true;
749 return OFormNavigationHelper::isEnabled( _nFeatureId );
753 void SAL_CALL OButtonControl::registerDispatchProviderInterceptor( const Reference< XDispatchProviderInterceptor >& _rxInterceptor )
755 OClickableImageBaseControl::registerDispatchProviderInterceptor( _rxInterceptor );
756 OFormNavigationHelper::registerDispatchProviderInterceptor( _rxInterceptor );
760 void SAL_CALL OButtonControl::releaseDispatchProviderInterceptor( const Reference< XDispatchProviderInterceptor >& _rxInterceptor )
762 OClickableImageBaseControl::releaseDispatchProviderInterceptor( _rxInterceptor );
763 OFormNavigationHelper::releaseDispatchProviderInterceptor( _rxInterceptor );
766 } // namespace frm
768 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
769 com_sun_star_form_OButtonModel_get_implementation(css::uno::XComponentContext* component,
770 css::uno::Sequence<css::uno::Any> const &)
772 return cppu::acquire(new frm::OButtonModel(component));
775 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
776 com_sun_star_form_OButtonControl_get_implementation(css::uno::XComponentContext* component,
777 css::uno::Sequence<css::uno::Any> const &)
779 return cppu::acquire(new frm::OButtonControl(component));
782 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */