26#include <com/sun/star/awt/XTextComponent.hpp>
27#include <com/sun/star/awt/XWindow.hpp>
28#include <com/sun/star/beans/PropertyAttribute.hpp>
29#include <com/sun/star/form/FormComponentType.hpp>
30#include <com/sun/star/form/XForm.hpp>
31#include <com/sun/star/form/XLoadable.hpp>
32#include <com/sun/star/form/binding/IncompatibleTypesException.hpp>
33#include <com/sun/star/io/IOException.hpp>
34#include <com/sun/star/io/XMarkableStream.hpp>
35#include <com/sun/star/lang/DisposedException.hpp>
36#include <com/sun/star/lang/WrappedTargetRuntimeException.hpp>
37#include <com/sun/star/sdb/XRowSetChangeBroadcaster.hpp>
38#include <com/sun/star/sdb/XRowSetSupplier.hpp>
39#include <com/sun/star/sdbc/ColumnValue.hpp>
40#include <com/sun/star/sdbc/DataType.hpp>
41#include <com/sun/star/sdbc/SQLException.hpp>
42#include <com/sun/star/util/VetoException.hpp>
43#include <com/sun/star/util/XModifyBroadcaster.hpp>
70using namespace ::com::sun::star::form::binding;
92class FieldChangeNotifier
102 ~FieldChangeNotifier()
104 Reference< XPropertySet > xNewField(
m_rModel.getField() );
118OControl::OControl(
const Reference< XComponentContext >& _rxContext,
const OUString& _rAggregateService,
const bool _bSetDelegator )
126 m_xAggregate.set(_rxContext->getServiceManager()->createInstanceWithContext(_rAggregateService, _rxContext), css::uno::UNO_QUERY);
131 if ( _bSetDelegator )
153 m_xAggregate->setDelegator(
static_cast< XWeak*
>(
this ) );
162 Any aReturn( OComponentHelper::queryAggregation(_rType) );
164 if (!aReturn.hasValue())
177 return css::uno::Sequence<sal_Int8>();
184 Reference< XTypeProvider > xProv;
186 aTypes.addTypes( xProv->getTypes() );
199 OComponentHelper::disposing();
203 Reference< XComponent > xComp;
216 Sequence< OUString > aAggServices;
217 Reference< XServiceInfo > xInfo;
219 aAggServices = xInfo->getSupportedServiceNames();
233 Reference< XInterface > xAggAsIface;
237 if (xAggAsIface != Reference< XInterface >(_rEvent.Source, UNO_QUERY))
239 Reference<css::lang::XEventListener> xListener;
241 xListener->disposing(_rEvent);
259 Reference< XWindow2 > xWindow;
260 Reference< XControlModel >
xModel;
263 xWindow.set(
getPeer(), UNO_QUERY );
273void SAL_CALL
OControl::createPeer(
const Reference<XToolkit>& _rxToolkit,
const Reference<XWindowPeer>& _rxParent)
277 m_xControl->createPeer( _rxToolkit, _rxParent );
324 const OUString& _rAggregateService,
const bool _bSetDelegator )
325 :
OControl( _rxContext, _rAggregateService, _bSetDelegator )
349 if ( !aReturn.hasValue() )
353 if ( !aReturn.hasValue() )
377 Reference< XWindowPeer > xPeer =
getPeer();
378 Reference< XTextComponent > xText( xPeer, UNO_QUERY );
381 xText->setEditable( !_bLock );
385 Reference< XWindow > xComp( xPeer, UNO_QUERY );
387 xComp->setEnable( !_bLock );
410 return css::uno::Sequence<sal_Int8>();
417 Reference< XTypeProvider > xProv;
420 aTypes.addTypes( xProv->getTypes() );
427 return TypeBag( OComponentHelper::getTypes(),
428 OPropertySetAggregationHelper::getTypes(),
436 Any aReturn(OComponentHelper::queryAggregation(_rType));
439 if (!aReturn.hasValue())
444 if (!aReturn.hasValue())
446 aReturn = OPropertySetAggregationHelper::queryInterface(_rType);
458 ::comphelper::operator>>( _rxInStream, sHelpText);
461 if (m_xAggregateSet.is())
467 SAL_WARN(
"forms.component",
"OControlModel::readHelpTextCompatibly: could not forward the property value to the aggregate!");
476 if (m_xAggregateSet.is())
482 SAL_WARN(
"forms.component",
"OControlModel::writeHelpTextCompatibly: could not retrieve the property value from the aggregate!");
484 ::comphelper::operator<<( _rxOutStream, sHelpText);
488 const Reference<XComponentContext>& _rxContext,
489 const OUString& _rUnoControlModelTypeName,
490 const OUString& rDefault,
const bool _bSetDelegator)
492 ,OPropertySetAggregationHelper(OComponentHelper::rBHelper)
495 ,m_aPropertyBagHelper( *this )
497 ,m_nClassId(FormComponentType::
CONTROL)
498 ,m_bNativeLook( false )
499 ,m_bStandardTheme( false )
500 ,m_bGenerateVbEvents( false )
501 ,m_nControlTypeinMSO(0)
507 if (_rUnoControlModelTypeName.isEmpty())
515 if ( m_xAggregateSet.is() )
519 if ( !rDefault.isEmpty() )
522 catch(
const Exception& )
535OControlModel::OControlModel(
const OControlModel* _pOriginal,
const Reference< XComponentContext>& _rxFactory,
const bool _bCloneAggregate,
const bool _bSetDelegator )
537 ,OPropertySetAggregationHelper( OComponentHelper::rBHelper )
540 ,m_aPropertyBagHelper( *this )
542 ,m_nClassId( FormComponentType::
CONTROL )
544 DBG_ASSERT( _pOriginal,
"OControlModel::OControlModel: invalid original!" );
548 m_aTag = _pOriginal->m_aTag;
557 if ( !_bCloneAggregate )
571 if ( _bSetDelegator )
615 Reference<XComponent> xComp(
m_xParent, UNO_QUERY);
617 xComp->removeEventListener(
static_cast<XPropertiesChangeListener*
>(
this));
620 xComp.set(
m_xParent, css::uno::UNO_QUERY);
623 xComp->addEventListener(
static_cast<XPropertiesChangeListener*
>(
this));
634 catch (
const css::beans::UnknownPropertyException&)
637 throw WrappedTargetRuntimeException(
638 "OControlModel::getName",
652 catch (
const css::beans::UnknownPropertyException&)
655 throw WrappedTargetRuntimeException(
656 "OControlModel::setName",
671 Sequence< OUString > aAggServices;
672 Reference< XServiceInfo > xInfo;
674 aAggServices = xInfo->getSupportedServiceNames();
680 return ::comphelper::concatSequences(
702 Reference<css::lang::XEventListener> xEvtLst;
706 xEvtLst->disposing(_rSource);
714 OPropertySetAggregationHelper::disposing();
716 Reference<css::lang::XComponent> xComp;
727 Reference< XPersistObject > xPersist;
729 xPersist->write( _rxOutStream );
734 Reference< XPersistObject > xPersist;
736 xPersist->read( _rxInStream );
744 Reference<css::io::XMarkableStream> xMark(_rxOutStream, UNO_QUERY);
753 sal_Int32 nMark = xMark->createMark();
756 _rxOutStream->writeLong(nLen);
761 nLen = xMark->offsetToMark(nMark) - 4;
762 xMark->jumpToMark(nMark);
763 _rxOutStream->writeLong(nLen);
764 xMark->jumpToFurthest();
765 xMark->deleteMark(nMark);
768 _rxOutStream->writeShort(0x0003);
771 ::comphelper::operator<<( _rxOutStream,
m_aName);
773 ::comphelper::operator<<( _rxOutStream,
m_aTag);
787 Reference<css::io::XMarkableStream> xMark(InStream, UNO_QUERY);
797 sal_Int32 nLen = InStream->readLong();
800 sal_Int32 nMark = xMark->createMark();
812 xMark->jumpToMark(nMark);
813 InStream->skipBytes(nLen);
814 xMark->deleteMark(nMark);
818 sal_uInt16
nVersion = InStream->readShort();
821 ::comphelper::operator>>( InStream,
m_aName);
825 ::comphelper::operator>>( InStream,
m_aTag);
842 bool bEqual = aCurrentValue == aDefaultValue;
843 return bEqual ? PropertyState_DEFAULT_VALUE : PropertyState_DIRECT_VALUE;
850 Any aConvertedValue, aOldValue;
865 aReturn <<= OUString();
868 aReturn <<= sal_Int16(FormComponentType::CONTROL);
884 aReturn <<= sal_Int16(0);
893 SAL_WARN(
"forms.component",
"OControlModel::convertFastPropertyValue: unknown handle " << _nHandle);
934 OPropertySetAggregationHelper::getFastPropertyValue( _rValue, _nHandle );
940 Any& _rConvertedValue, Any& _rOldValue, sal_Int32 _nHandle,
const Any& _rValue)
942 bool bModified(
false);
974 SAL_WARN(
"forms.component",
"OControlModel::convertFastPropertyValue: unknown handle " << _nHandle);
986 "OControlModel::setFastPropertyValue_NoBroadcast : invalid type" );
991 "OControlModel::setFastPropertyValue_NoBroadcast : invalid type" );
996 "OControlModel::setFastPropertyValue_NoBroadcast : invalid type" );
1019 SAL_WARN(
"forms.component",
"OControlModel::setFastPropertyValue_NoBroadcast: unknown handle " << _nHandle );
1027 css::beans::Property* pProperties = _rProps.getArray();
1031 css::beans::PropertyAttribute::BOUND | css::beans::PropertyAttribute::TRANSIENT);
1033 css::beans::PropertyAttribute::BOUND | css::beans::PropertyAttribute::TRANSIENT);
1038 DBG_ASSERT( pProperties == _rProps.getArray() + _rProps.getLength(),
"<...>::describeFixedProperties/getInfoHelper: forgot to adjust the count ?");
1043 if ( m_xAggregateSet.is() )
1045 Reference< XPropertySetInfo > xPSI( m_xAggregateSet->getPropertySetInfo() );
1047 _rAggregateProps = xPSI->getProperties();
1105 OSL_ENSURE(
m_lockCount > 0,
"OControlModel::unlockInstance: not locked!" );
1106 oslInterlockedCount lockCount = osl_atomic_decrement( &
m_lockCount );
1112 const std::vector< Any >& _rNewValues,
LockAccess )
1115 const_cast< std::vector< sal_Int32 >&
>( _rHandles ).data(),
1127 if (!aReturn.hasValue())
1144 const Reference< XComponentContext>& _rxFactory,
1145 const OUString& _rUnoControlModelTypeName,
const OUString& _rDefault,
1146 const bool _bCommitable,
const bool _bSupportExternalBinding,
const bool _bSupportsValidation )
1147 :
OControlModel( _rxFactory, _rUnoControlModelTypeName, _rDefault, false )
1149 ,m_nValuePropertyAggregateHandle( -1 )
1151 ,m_bValuePropertyMayBeVoid( false )
1154 ,m_aFormComponentListeners(
m_aMutex )
1155 ,m_bInputRequired( false )
1156 ,m_bFormListening( false )
1159 ,m_bCommitable(_bCommitable)
1160 ,m_bSupportsExternalBinding( _bSupportExternalBinding )
1161 ,m_bSupportsValidation( _bSupportsValidation )
1162 ,m_bForwardValueChanges(true)
1163 ,m_bTransferringValue( false )
1164 ,m_bIsCurrentValueValid( true )
1165 ,m_bBindingControlsRO( false )
1166 ,m_bBindingControlsEnable( false )
1167 ,m_eControlValueChangeInstigator( eOther )
1175 const OBoundControlModel* _pOriginal,
const Reference< XComponentContext>& _rxFactory )
1176 :OControlModel( _pOriginal, _rxFactory, true, false )
1177 ,OPropertyChangeListener(
m_aMutex )
1178 ,m_nValuePropertyAggregateHandle( _pOriginal->m_nValuePropertyAggregateHandle )
1180 ,m_bValuePropertyMayBeVoid( _pOriginal->m_bValuePropertyMayBeVoid )
1183 ,m_aFormComponentListeners(
m_aMutex )
1184 ,m_xValidator( _pOriginal->m_xValidator )
1185 ,m_bInputRequired( false )
1186 ,m_bFormListening( false )
1188 ,m_bRequired( false )
1189 ,m_bCommitable( _pOriginal->m_bCommitable )
1190 ,m_bSupportsExternalBinding( _pOriginal->m_bSupportsExternalBinding )
1191 ,m_bSupportsValidation( _pOriginal->m_bSupportsValidation )
1192 ,m_bForwardValueChanges( true )
1193 ,m_bTransferringValue( false )
1194 ,m_bIsCurrentValueValid( _pOriginal->m_bIsCurrentValueValid )
1195 ,m_bBindingControlsRO( false )
1196 ,m_bBindingControlsEnable( false )
1197 ,m_eControlValueChangeInstigator( eOther )
1218 if ( !OComponentHelper::rBHelper.bDisposed )
1225 OSL_ENSURE(
m_pAggPropMultiplexer,
"OBoundControlModel::~OBoundControlModel: what about my property multiplexer?" );
1255 if ( m_xAggregateSet.is() )
1276 OSL_ENSURE(
m_pAggPropMultiplexer,
"OBoundControlModel::implInitValuePropertyListening: no multiplexer!" );
1285 "OBoundControlModel::initOwnValueProperty: value property is already initialized!" );
1286 OSL_ENSURE( !i_rValuePropertyName.isEmpty(),
"OBoundControlModel::initOwnValueProperty: invalid property name!" );
1293 "OBoundControlModel::initValueProperty: value property is already initialized!" );
1294 OSL_ENSURE( !_rValuePropertyName.isEmpty(),
"OBoundControlModel::initValueProperty: invalid property name!" );
1295 OSL_ENSURE( _nValuePropertyExternalHandle != -1,
"OBoundControlModel::initValueProperty: invalid property handle!" );
1303 Reference< XPropertySetInfo > xPropInfo( m_xAggregateSet->getPropertySetInfo(), UNO_SET_THROW );
1315 OSL_PRECOND( !
m_sValuePropertyName.isEmpty(),
"OBoundControlModel::suspendValueListening: don't have a value property!" );
1316 OSL_PRECOND(
m_pAggPropMultiplexer,
"OBoundControlModel::suspendValueListening: I *am* not listening!" );
1324 OSL_PRECOND( !
m_sValuePropertyName.isEmpty(),
"OBoundControlModel::resumeValueListening: don't have a value property!" );
1325 OSL_PRECOND(
m_pAggPropMultiplexer,
"OBoundControlModel::resumeValueListening: I *am* not listening at all!" );
1346 return aTypes.getTypes();
1360 css::lang::EventObject aEvt(
static_cast< XWeak*
>(
this ) );
1377 xComp->removeEventListener(
static_cast< XEventListener*
>(
static_cast< XPropertyChangeListener*
>(
this ) ) );
1415 "OBoundControlModel::_propertyChanged: where did this come from (1)?" );
1417 "OBoundControlModel::_propertyChanged: where did this come from (2)?" );
1426 OSL_PRECOND(
m_pAggPropMultiplexer,
"OBoundControlModel::startAggregatePropertyListening: no multiplexer!" );
1427 OSL_ENSURE( !_rPropertyName.isEmpty(),
"OBoundControlModel::startAggregatePropertyListening: invalid property name!" );
1436 OSL_PRECOND( !
hasExternalValueBinding(),
"OBoundControlModel::doFormListening: external value binding should overrule the database binding!" );
1441 Reference< XLoadable > xParentLoadable(
getParent(), UNO_QUERY );
1442 if (
getParent().is() && !xParentLoadable.is() )
1447 Reference< XRowSetChangeBroadcaster > xRowSetBroadcaster(
getParent(), UNO_QUERY );
1448 if ( xRowSetBroadcaster.is() )
1449 _bStart ? xRowSetBroadcaster->addRowSetChangeListener(
this ) : xRowSetBroadcaster->removeRowSetChangeListener(
this );
1459 FieldChangeNotifier aBoundFieldNotifier( aLock );
1486 if ( _rEvent.Source ==
getField() )
1517 return ::comphelper::combineSequences(
1525 Sequence<OUString> aOwnServiceNames {
"com.sun.star.form.DataAwareControlModel" };
1526 return ::comphelper::concatSequences(
1538 _rxOutStream->writeShort(0x0002);
1554 xComp->removeEventListener(
static_cast<css::lang::XEventListener*
>(
static_cast<XPropertyChangeListener*
>(
this)));
1560 sal_Int32 nLen = _rxInStream->readLong();
1561 Reference<css::io::XMarkableStream> xMark(_rxInStream, UNO_QUERY);
1562 DBG_ASSERT(xMark.is(),
"OBoundControlModel::readCommonProperties : can only work with markable streams !");
1563 sal_Int32 nMark = xMark->createMark();
1565 Reference<css::io::XPersistObject> xPersist;
1566 sal_Int32 nUsedFlag;
1567 nUsedFlag = _rxInStream->readLong();
1569 xPersist = _rxInStream->readObject();
1573 xComp->addEventListener(
static_cast<css::lang::XEventListener*
>(
static_cast<XPropertyChangeListener*
>(
this)));
1576 xMark->jumpToMark(nMark);
1577 _rxInStream->skipBytes(nLen);
1578 xMark->deleteMark(nMark);
1583 Reference<css::io::XMarkableStream> xMark(_rxOutStream, UNO_QUERY);
1584 DBG_ASSERT(xMark.is(),
"OBoundControlModel::writeCommonProperties : can only work with markable streams !");
1585 sal_Int32 nMark = xMark->createMark();
1588 _rxOutStream->writeLong(nLen);
1590 Reference<css::io::XPersistObject> xPersist(
m_xLabelControl, UNO_QUERY);
1591 sal_Int32 nUsedFlag = 0;
1594 _rxOutStream->writeLong(nUsedFlag);
1596 _rxOutStream->writeObject(xPersist);
1599 nLen = xMark->offsetToMark(nMark) -
sizeof(nLen);
1600 xMark->jumpToMark(nMark);
1601 _rxOutStream->writeLong(nLen);
1602 xMark->jumpToFurthest();
1603 xMark->deleteMark(nMark);
1610 _rxInStream->readShort();
1642 Any& _rConvertedValue, Any& _rOldValue,
1646 bool bModified(
false);
1656 SAL_WARN(
"forms.component",
"OBoundControlModel::convertFastPropertyValue: BoundField should be a read-only property !" );
1657 throw css::lang::IllegalArgumentException();
1659 if (!_rValue.hasValue())
1661 _rConvertedValue =
Any();
1690 aDefault <<= OUString();
1693 aDefault <<= Reference< XPropertySet >();
1710 SAL_WARN(
"forms.component",
"OBoundControlModel::setFastPropertyValue_NoBroadcast : BoundField should be a read-only property !");
1711 throw css::lang::IllegalArgumentException();
1714 if ( rValue.hasValue() && ( rValue.getValueTypeClass() != TypeClass_INTERFACE ) )
1715 throw css::lang::IllegalArgumentException();
1716 Reference< XInterface > xNewValue( rValue, UNO_QUERY );
1717 if ( !xNewValue.is() )
1721 xComp->removeEventListener(
static_cast< XPropertyChangeListener*
>(
this ) );
1726 Reference< XControlModel > xAsModel ( xNewValue, UNO_QUERY );
1727 Reference< XServiceInfo > xAsServiceInfo ( xAsModel, UNO_QUERY );
1728 Reference< XPropertySet > xAsPropSet ( xAsServiceInfo, UNO_QUERY );
1729 Reference< XChild > xAsChild ( xAsPropSet, UNO_QUERY );
1732 throw css::lang::IllegalArgumentException();
1736 Reference<XChild> xCont(
this);
1737 Reference< XInterface > xMyTopLevel = xCont->getParent();
1738 while (xMyTopLevel.is())
1740 Reference<XForm> xAsForm(xMyTopLevel, UNO_QUERY);
1744 Reference<XChild> xLoopAsChild(xMyTopLevel, UNO_QUERY);
1745 xMyTopLevel = xLoopAsChild.is() ? xLoopAsChild->getParent() : Reference< XInterface >();
1748 Reference< XInterface > xNewTopLevel = xAsChild->getParent();
1749 while (xNewTopLevel.is())
1751 Reference<XForm> xAsForm(xNewTopLevel, UNO_QUERY);
1754 Reference<XChild> xLoopAsChild(xNewTopLevel, UNO_QUERY);
1755 xNewTopLevel = xLoopAsChild.is() ? xLoopAsChild->getParent() : Reference< XInterface >();
1758 if (xNewTopLevel != xMyTopLevel)
1761 throw css::lang::IllegalArgumentException();
1767 xComp->addEventListener(
static_cast<css::lang::XEventListener*
>(
static_cast<XPropertyChangeListener*
>(
this)));
1782 OSL_ENSURE( evt.Source ==
getField(),
"OBoundControlModel::propertyChange: value changes from components other than our database column?" );
1790 OSL_ENSURE( evt.Source ==
m_xExternalBinding,
"OBoundControlModel::propertyChange: where did this come from?" );
1792 OUString sBindingControlledProperty;
1793 bool bForwardToLabelControl =
false;
1802 bForwardToLabelControl =
true;
1811 m_xLabelControl->setPropertyValue( sBindingControlledProperty, evt.NewValue );
1817 SAL_WARN(
"forms.component",
"OBoundControlModel::propertyChange: could not adjust my binding-controlled property!");
1826 FieldChangeNotifier aBoundFieldNotifier( aLock );
1856 OSL_PRECOND(
m_bCommitable,
"OBoundControlModel::commit: invalid call (I'm not committable!) " );
1875 aEvent.Source =
static_cast< XWeak*
>( this );
1876 bool bSuccess =
true;
1880 bSuccess = aIter.
next()->approveUpdate(
aEvent );
1916 OSL_PRECOND( !
hasExternalValueBinding(),
"OBoundControlModel::connectToField: invalid call (have an external binding)!" );
1923 Reference<XPropertySet> xFieldCandidate;
1926 Reference<XColumnsSupplier> xColumnsSupplier(
m_xCursor, UNO_QUERY);
1927 DBG_ASSERT(xColumnsSupplier.is(),
"OBoundControlModel::connectToField : the row set should support the css::sdb::ResultSet service !");
1928 if (xColumnsSupplier.is())
1930 Reference<XNameAccess> xColumns = xColumnsSupplier->getColumns();
1942 sal_Int32 nFieldType = DataType::OTHER;
1943 if ( xFieldCandidate.is() )
1961 sal_Int32 nNullableFlag = ColumnValue::NO_NULLS;
1969 SAL_WARN(
"forms.component",
"OBoundControlModel::connectToField: property " <<
PROPERTY_VALUE <<
" not supported!");
1987 if ( !(
hasField() && _rxRowSet.is()) )
1990 bool shouldTransfer(!_rxRowSet->isBeforeFirst() && !_rxRowSet->isAfterLast());
1991 if (!shouldTransfer)
1993 const Reference< XPropertySet > xPS(_rxRowSet, UNO_QUERY);
1996 assert(!shouldTransfer);
1997 xPS->getPropertyValue(
"IsNew") >>= shouldTransfer;
2000 if ( shouldTransfer )
2010 OSL_PRECOND( !
hasExternalValueBinding(),
"OBoundControlModel::approveDbColumnType: invalid call (have an external binding)!" );
2011 if ((_nColumnType == DataType::BINARY) || (_nColumnType == DataType::VARBINARY)
2012 || (_nColumnType == DataType::LONGVARBINARY) || (_nColumnType == DataType::OTHER)
2013 || (_nColumnType == DataType::OBJECT) || (_nColumnType == DataType::DISTINCT)
2014 || (_nColumnType == DataType::STRUCT) || (_nColumnType == DataType::ARRAY)
2015 || (_nColumnType == DataType::BLOB)
2016 || (_nColumnType == DataType::REF) || (_nColumnType == DataType::SQLNULL))
2023 Reference< XInterface > xParent(
getParent() );
2027 Reference< XRowSetSupplier > xSupRowSet( xParent, UNO_QUERY );
2028 if ( xSupRowSet.is() )
2035 OSL_PRECOND( !
hasExternalValueBinding(),
"OBoundControlModel::impl_connectDatabaseColumn_noNotify: not to be called with an external value binding!" );
2038 "OBoundControlModel::impl_connectDatabaseColumn_noNotify: the form is just *loaded*, but we already have a field!" );
2041 OSL_ENSURE( xRowSet.is(),
"OBoundControlModel::impl_connectDatabaseColumn_noNotify: no row set!" );
2042 if ( !xRowSet.is() )
2063 OSL_PRECOND( !
hasExternalValueBinding(),
"OBoundControlModel::impl_disconnectDatabaseColumn_noNotify: not to be called with an external value binding!" );
2080 FieldChangeNotifier aBoundFieldNotifier( aLock );
2081 OSL_ENSURE( _rEvent.Source ==
m_xAmbientForm,
"OBoundControlModel::loaded: where does this come from?" );
2082 OSL_PRECOND( !
hasExternalValueBinding(),
"OBoundControlModel::loaded: we should never reach this with an external value binding!" );
2090 OSL_PRECOND( !
hasExternalValueBinding(),
"OBoundControlModel::unloaded: we should never reach this with an external value binding!" );
2095 OSL_PRECOND( !
hasExternalValueBinding(),
"OBoundControlModel::reloading: we should never reach this with an external value binding!" );
2105 FieldChangeNotifier aBoundFieldNotifier( aLock );
2106 OSL_PRECOND( !
hasExternalValueBinding(),
"OBoundControlModel::unloading: we should never reach this with an external value binding!" );
2115 FieldChangeNotifier aBoundFieldNotifier( aLock );
2116 OSL_ENSURE( _rEvent.Source ==
m_xAmbientForm,
"OBoundControlModel::reloaded: where does this come from?" );
2117 OSL_PRECOND( !
hasExternalValueBinding(),
"OBoundControlModel::reloaded: we should never reach this with an external value binding!" );
2132 OSL_PRECOND( m_xAggregateFastSet.is() && m_xAggregateSet.is(),
2133 "OBoundControlModel::doSetControlValue: invalid aggregate !" );
2135 "OBoundControlModel::doSetControlValue: please override if you have own value property handling!" );
2167 Reference< XPropertySetInfo > xAggregatePropertyInfo;
2168 if ( m_xAggregateSet.is() )
2169 xAggregatePropertyInfo = m_xAggregateSet->getPropertySetInfo();
2186 Reference< XPropertySetInfo > xAggregatePropertyInfo;
2187 if ( m_xAggregateSet.is() )
2188 xAggregatePropertyInfo = m_xAggregateSet->getPropertySetInfo();
2208 OSL_PRECOND( !
hasExternalValueBinding(),
"OBoundControlModel::onConnectedDbColumn: how this? There's an external value binding!" );
2213 OSL_PRECOND( !
hasExternalValueBinding(),
"OBoundControlModel::onDisconnectedDbColumn: how this? There's an external value binding!" );
2243 bool bIsNewRecord =
false;
2244 Reference<XPropertySet> xSet(
m_xCursor, UNO_QUERY );
2260 bool bInvalidCursorPosition =
true;
2270 catch(
const SQLException& )
2272 TOOLS_WARN_EXCEPTION(
"forms.component",
"OBoundControlModel::reset: caught an SQL exception!" );
2279 && bInvalidCursorPosition
2283 if ( !bSimpleReset )
2290 bool bIsNull =
true;
2298 sal_Int32 nFieldType = DataType::OBJECT;
2300 if ( ( nFieldType == DataType::BINARY )
2301 || ( nFieldType == DataType::VARBINARY )
2302 || ( nFieldType == DataType::LONGVARBINARY )
2303 || ( nFieldType == DataType::OBJECT )
2307 else if ( nFieldType == DataType::BLOB )
2317 SAL_WARN(
"forms.component",
"OBoundControlModel::reset: this should have succeeded in all cases!");
2320 bool bNeedValueTransfer =
true;
2329 bNeedValueTransfer =
false;
2334 if ( bNeedValueTransfer )
2361 if ( !_rxBinding.is() )
2363 Sequence< Type > aTypeCandidates;
2366 ::osl::MutexGuard aGuard(
m_aMutex );
2371 for (
auto const &
type : std::as_const(aTypeCandidates) )
2373 if ( _rxBinding->supportsType(
type ) )
2380 const Reference< XValueBinding >& _rxBinding,
ControlModelLock& _rInstanceLock )
2382 OSL_PRECOND( _rxBinding.is(),
"OBoundControlModel::connectExternalValueBinding: invalid binding instance!" );
2383 OSL_PRECOND( !
hasExternalValueBinding( ),
"OBoundControlModel::connectExternalValueBinding: precond not met (currently have a binding)!" );
2399 if ( xModifiable.is() )
2400 xModifiable->addModifyListener(
this );
2404 Reference< XPropertySetInfo > xBindingPropsInfo( xBindingProps.is() ? xBindingProps->getPropertySetInfo() : Reference< XPropertySetInfo >() );
2405 if ( xBindingPropsInfo.is() )
2437 Reference< XValidator > xAsValidator( _rxBinding, UNO_QUERY );
2438 if ( xAsValidator.is() )
2454 if ( xModifiable.is() )
2455 xModifiable->removeModifyListener(
this );
2490 throw IncompatibleTypesException(
2499 FieldChangeNotifier aBoundFieldNotifier( aLock );
2504 if ( _rxBinding.is() )
2510 ::osl::MutexGuard aGuard(
m_aMutex );
2549 aExternalValue = xExternalBinding->getValue( aValueExchangeType );
2564 "OBoundControlModel::transferControlValueToExternal: precondition not met!" );
2598 for (
auto const & typeCandidate : aTypeCandidates )
2611 "OBoundControlModel::translateExternalValueToControlValue: precondition not met!" );
2612 Any aControlValue( _rExternalValue );
2618 return aControlValue;
2628 OSL_PRECOND(
m_xValidator.is(),
"OBoundControlModel::translateControlValueToValidatableValue: no validator, so why should I?" );
2636 OSL_PRECOND( m_xAggregateFastSet.is() && m_xAggregateSet.is(),
2637 "OBoundControlModel::getControlValue: invalid aggregate !" );
2639 "OBoundControlModel::getControlValue: please override if you have own value property handling!" );
2651 return aControlValue;
2656 OSL_PRECOND( _rxValidator.is(),
"OBoundControlModel::connectValidator: invalid validator instance!" );
2657 OSL_PRECOND( !
hasValidator( ),
"OBoundControlModel::connectValidator: precond not met (have a validator currently)!" );
2677 OSL_PRECOND(
hasValidator( ),
"OBoundControlModel::connectValidator: precond not met (don't have a validator currently)!" );
2684 m_xValidator->removeValidityConstraintListener(
this );
2699 osl::MutexGuard aGuard(
m_aMutex );
2700 OSL_PRECOND(
m_bSupportsValidation,
"OBoundControlModel::setValidator: How did you reach this method?" );
2709 throw VetoException(
2719 if ( _rxValidator.is() )
2725 ::osl::MutexGuard aGuard(
m_aMutex );
2726 OSL_PRECOND(
m_bSupportsValidation,
"OBoundControlModel::getValidator: How did you reach this method?" );
2735 osl::MutexGuard aGuard(
m_aMutex );
2736 OSL_PRECOND(
m_bSupportsValidation,
"OBoundControlModel::validityConstraintChanged: How did you reach this method?" );
2757 ::osl::MutexGuard aGuard(
m_aMutex );
2763 if ( Listener.is() )
2769 if ( Listener.is() )
2777 bool bIsCurrentlyValid =
true;
2801 sal_Int32 nOldCount = _rProps.getLength();
2802 _rProps.realloc( nOldCount + 5);
2803 css::beans::Property* pProperties = _rProps.getArray() + nOldCount;
2806 css::beans::PropertyAttribute::BOUND | css::beans::PropertyAttribute::READONLY | css::beans::PropertyAttribute::TRANSIENT);
2808 css::beans::PropertyAttribute::BOUND | css::beans::PropertyAttribute::MAYBEVOID);
2811 css::beans::PropertyAttribute::BOUND);
2812 DBG_ASSERT( pProperties == _rProps.getArray() + _rProps.getLength(),
"<...>::describeFixedProperties/getInfoHelper: forgot to adjust the count ?");
Reference< XComponentContext > m_xContext
sal_Int32 addInterface(const css::uno::Reference< ListenerT > &rxIFace)
void disposeAndClear(const css::lang::EventObject &rEvt)
sal_Int32 removeInterface(const css::uno::Reference< ListenerT > &rxIFace)
void notifyEach(void(SAL_CALL ListenerT::*NotificationMethod)(const EventT &), const EventT &Event)
bool hasMoreElements() const
css::uno::Reference< ListenerT > const & next()
friend friend class OPropertyChangeMultiplexer
virtual css::uno::Any SAL_CALL getFastPropertyValue(sal_Int32 nHandle) override final
void fire(std::unique_lock< std::mutex > &rGuard, sal_Int32 *pnHandles, const css::uno::Any *pNewValues, const css::uno::Any *pOldValues, sal_Int32 nCount, bool bVetoable)
virtual css::uno::Any SAL_CALL queryInterface(css::uno::Type const &rType) SAL_OVERRIDE
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() SAL_OVERRIDE
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() SAL_OVERRIDE
virtual css::uno::Any SAL_CALL queryInterface(css::uno::Type const &rType) SAL_OVERRIDE
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() SAL_OVERRIDE
virtual css::uno::Any SAL_CALL queryInterface(css::uno::Type const &rType) SAL_OVERRIDE
virtual css::uno::Any SAL_CALL queryInterface(css::uno::Type const &rType) SAL_OVERRIDE
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() SAL_OVERRIDE
virtual css::uno::Any SAL_CALL queryInterface(css::uno::Type const &rType) SAL_OVERRIDE
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() SAL_OVERRIDE
virtual void SAL_CALL acquire() SAL_NOEXCEPT SAL_OVERRIDE
virtual void SAL_CALL dispose() SAL_OVERRIDE
oslInterlockedCount m_refCount
class whose instances lock an OControlModel
std::vector< sal_Int32 > m_aHandles
void addPropertyNotification(const sal_Int32 _nHandle, const css::uno::Any &_rOldValue, const css::uno::Any &_rNewValue)
adds a property change notification, which is to be fired when the last lock on the model (in the cur...
std::vector< css::uno::Any > m_aNewValues
void impl_notifyAll_nothrow()
std::vector< css::uno::Any > m_aOldValues
void impl_disconnectDatabaseColumn_noNotify()
disconnects from a value supplier which is a database column
virtual css::uno::Any getDefaultForReset() const
returns the default which should be used when resetting the control
void transferControlValueToExternal(ControlModelLock &_rInstanceLock)
transfers the control value to the external binding @precond our own mutex is locked,...
void writeCommonProperties(const css::uno::Reference< css::io::XObjectOutputStream > &_rxOutStream)
We can't write (new) common properties in this base class, as the file format doesn't allow this (unf...
const bool m_bSupportsValidation
virtual css::uno::Any translateControlValueToValidatableValue() const
retrieves the current value of the control, in a shape which can be used with our external validator.
sal_Int32 m_nValuePropertyAggregateHandle
virtual css::uno::Any translateDbColumnToControlValue()=0
translates a db column value into a control value.
void defaultCommonProperties()
OUString m_aLabelServiceName
bool m_bBindingControlsRO
OBoundControlModel(const css::uno::Reference< css::uno::XComponentContext > &_rxContext, const OUString &_rUnoControlModelTypeName, const OUString &_rDefault, const bool _bCommitable, const bool _bSupportExternalBinding, const bool _bSupportsValidation)
virtual void SAL_CALL unloading(const css::lang::EventObject &aEvent) override
bool hasExternalValueBinding() const
checks whether we currently have an external value binding in place
const bool m_bSupportsExternalBinding
virtual void SAL_CALL reloading(const css::lang::EventObject &aEvent) override
bool m_bForwardValueChanges
virtual void onConnectedDbColumn(const css::uno::Reference< css::uno::XInterface > &_rxForm)
called whenever a connection to a database column has been established
const css::uno::Type & getExternalValueType() const
returns the type which should be used to exchange data with our external value binding
bool hasValidator() const
void onValuePropertyChange(ControlModelLock &i_rControLock)
(to be) called when the value property changed
virtual css::uno::Any SAL_CALL queryAggregation(const css::uno::Type &_rType) override
css::uno::Reference< css::form::binding::XValueBinding > m_xExternalBinding
virtual css::uno::Reference< css::form::validation::XValidator > SAL_CALL getValidator() override
virtual void doSetControlValue(const css::uno::Any &_rValue)
bool m_bValuePropertyMayBeVoid
css::uno::Type m_aExternalValueType
virtual void onConnectedExternalValue()
called whenever a connection to an external supplier of values (XValueBinding) has been established
rtl::Reference<::comphelper::OPropertyChangeMultiplexer > m_pAggPropMultiplexer
bool impl_approveValueBinding_nolock(const css::uno::Reference< css::form::binding::XValueBinding > &_rxBinding)
called from within <member scope="css:::form::binding">XBindableValue::setValueBinding</member> to ap...
css::uno::Type m_aValuePropertyType
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
virtual void SAL_CALL removeFormComponentValidityListener(const css::uno::Reference< css::form::validation::XFormComponentValidityListener > &Listener) override
void setControlValue(const css::uno::Any &_rValue, ValueChangeInstigator _eInstigator)
sets the given value as new current value for the control
void disconnectExternalValueBinding()
disconnects from an external value binding
void initFromField(const css::uno::Reference< css::sdbc::XRowSet > &_rxForm)
initializes the control from m_xField
virtual void SAL_CALL setFastPropertyValue_NoBroadcast(sal_Int32 nHandle, const css::uno::Any &rValue) override
void connectToField(const css::uno::Reference< css::sdbc::XRowSet > &_rxForm)
virtual void SAL_CALL unloaded(const css::lang::EventObject &aEvent) override
void implInitAggMultiplexer()
initializes m_pAggPropMultiplexer
virtual void SAL_CALL disposing() override
virtual css::uno::Any translateControlValueToExternalValue() const
commits the current control value to our external value binding
css::uno::Reference< css::form::XLoadable > m_xAmbientForm
void initValueProperty(const OUString &_rValuePropertyName, sal_Int32 _nValuePropertyExternalHandle)
initializes the part of the class which is related to the control value.
void implInitValuePropertyListening() const
initializes listening at the value property
css::uno::Reference< css::sdb::XColumn > m_xColumn
virtual void describeFixedProperties(css::uno::Sequence< css::beans::Property > &_rProps) const override
describes the properties provided by this class, or its respective derived class
virtual void resetNoBroadcast()
called to reset the control to some kind of default.
css::uno::Reference< css::beans::XPropertySet > m_xField
virtual css::uno::Any translateExternalValueToControlValue(const css::uno::Any &_rExternalValue) const
translates the given value, which was obtained from the current external value binding,...
virtual css::uno::Sequence< css::uno::Type > _getTypes() override
css::uno::Reference< css::beans::XPropertySet > m_xLabelControl
virtual void SAL_CALL onRowSetChanged(const css::lang::EventObject &i_Event) override
virtual void SAL_CALL write(const css::uno::Reference< css::io::XObjectOutputStream > &OutStream) override
virtual void SAL_CALL getFastPropertyValue(css::uno::Any &rValue, sal_Int32 nHandle) const override
virtual void SAL_CALL removeUpdateListener(const css::uno::Reference< css::form::XUpdateListener > &aListener) override
virtual sal_Bool SAL_CALL convertFastPropertyValue(css::uno::Any &_rConvertedValue, css::uno::Any &_rOldValue, sal_Int32 _nHandle, const css::uno::Any &_rValue) override
virtual void clonedFrom(const OControlModel *_pOriginal) override
late ctor after cloning
virtual void SAL_CALL read(const css::uno::Reference< css::io::XObjectInputStream > &InStream) override
::comphelper::OInterfaceContainerHelper3< css::form::XUpdateListener > m_aUpdateListeners
virtual void SAL_CALL setParent(const css::uno::Reference< css::uno::XInterface > &Parent) override
void readCommonProperties(const css::uno::Reference< css::io::XObjectInputStream > &_rxInStream)
void connectExternalValueBinding(const css::uno::Reference< css::form::binding::XValueBinding > &_rxBinding, ControlModelLock &_rInstanceLock)
connects to an external value binding
virtual css::uno::Any getCurrentFormComponentValue() const
retrieves the current value of the form component
void connectValidator(const css::uno::Reference< css::form::validation::XValidator > &_rxValidator)
connects the component to an external validator
void calculateExternalValueType()
calculates the type which is to be used to communicate with the current external binding,...
virtual void SAL_CALL loaded(const css::lang::EventObject &aEvent) override
void resumeValueListening()
resumes listening at the value property
virtual void SAL_CALL addFormComponentValidityListener(const css::uno::Reference< css::form::validation::XFormComponentValidityListener > &Listener) override
void impl_setField_noNotify(const css::uno::Reference< css::beans::XPropertySet > &_rxField)
sets m_xField to the given new value, without notifying our listeners
bool m_bBindingControlsEnable
virtual void SAL_CALL addResetListener(const css::uno::Reference< css::form::XResetListener > &aListener) override
OUString m_sValuePropertyName
ResetHelper m_aResetHelper
virtual bool commitControlValueToDbColumn(bool _bPostReset)=0
commits the current control value to the database column we're bound to @precond we're properly bound...
css::uno::Reference< css::sdbc::XRowSet > m_xCursor
void impl_connectDatabaseColumn_noNotify(bool _bFromReload)
connects to a value supplier which is a database column.
void transferExternalValueToControl(ControlModelLock &_rInstanceLock)
transfers the current value of the active external binding to the control @precond we do have an acti...
virtual void SAL_CALL validityConstraintChanged(const css::lang::EventObject &Source) override
bool m_bTransferringValue
void suspendValueListening()
suspends listening at the value property
virtual css::uno::Any getPropertyDefaultByHandle(sal_Int32 nHandle) const override
const css::uno::Reference< css::beans::XPropertySet > & getField() const
virtual void SAL_CALL reset() override
css::uno::Reference< css::sdb::XColumnUpdate > m_xColumnUpdate
virtual void SAL_CALL setValidator(const css::uno::Reference< css::form::validation::XValidator > &Validator) override
void impl_determineAmbientForm_nothrow()
determines the new value of m_xAmbientForm
void onDisconnectedValidator()
called whenever an external validator has been revoked
virtual sal_Bool SAL_CALL isValid() override
static css::uno::Sequence< OUString > getSupportedServiceNames_Static()
void startAggregatePropertyListening(const OUString &_rPropertyName)
starts listening at the aggregate, for changes in the given property
void recheckValidity(bool _bForceNotification)
does a new validation of the control value
ValueChangeInstigator m_eControlValueChangeInstigator
virtual void onDisconnectedDbColumn()
called whenever a connection to a database column has been suspended
css::uno::Reference< css::form::validation::XValidator > m_xValidator
bool m_bIsCurrentValueValid
virtual css::uno::Reference< css::form::binding::XValueBinding > SAL_CALL getValueBinding() override
void doFormListening(const bool _bStart)
adds or removes the component as load listener to/from our form, and (if necessary) as RowSetChange l...
void onConnectedValidator()
called whenever an external validator has been registered
void disconnectValidator()
disconnects the component from its current an external validator
virtual void SAL_CALL setValueBinding(const css::uno::Reference< css::form::binding::XValueBinding > &_rxBinding) override
virtual css::uno::Any getControlValue() const
retrieves the current value of the control
::comphelper::OInterfaceContainerHelper3< css::form::validation::XFormComponentValidityListener > m_aFormComponentListeners
virtual css::uno::Any SAL_CALL getCurrentValue() override
virtual void SAL_CALL propertyChange(const css::beans::PropertyChangeEvent &evt) override
virtual void SAL_CALL addUpdateListener(const css::uno::Reference< css::form::XUpdateListener > &aListener) override
OUString m_aControlSource
virtual void _propertyChanged(const css::beans::PropertyChangeEvent &_rEvt) override
virtual sal_Bool SAL_CALL commit() override
virtual bool approveDbColumnType(sal_Int32 _nColumnType)
nFieldType is the type of the field, on which the model will be linked.
virtual css::uno::Sequence< css::uno::Type > getSupportedBindingTypes()
returns the data types which the control could use to exchange data with an external value binding
virtual ~OBoundControlModel() override
virtual void SAL_CALL reloaded(const css::lang::EventObject &aEvent) override
bool isFormListening() const
void transferDbValueToControl()
transfers the very current value of the db column we're bound to the control @precond our own mutex i...
virtual void SAL_CALL removeResetListener(const css::uno::Reference< css::form::XResetListener > &aListener) override
void initOwnValueProperty(const OUString &i_rValuePropertyName)
initializes the part of the class which is related to the control value.
virtual void SAL_CALL modified(const css::lang::EventObject &_rEvent) override
virtual css::uno::Any SAL_CALL queryAggregation(const css::uno::Type &_rType) override
virtual sal_Bool SAL_CALL setModel(const css::uno::Reference< css::awt::XControlModel > &Model) override
virtual ~OBoundControl() override
void _setLock(bool _bLock)
virtual void SAL_CALL disposing() override
virtual css::uno::Sequence< css::uno::Type > _getTypes() override
OBoundControl(const css::uno::Reference< css::uno::XComponentContext > &_rxContext, const OUString &_rAggregateService, const bool _bSetDelegator=true)
virtual sal_Bool SAL_CALL getLock() override
virtual void SAL_CALL setLock(sal_Bool _bLock) override
static css::uno::Reference< css::uno::XAggregation > createAggregateClone(const OCloneableAggregation *_pOriginal)
css::uno::Reference< css::uno::XAggregation > m_xAggregate
css::uno::Sequence< OUString > getAggregateServiceNames() const
virtual void describeFixedProperties(css::uno::Sequence< css::beans::Property > &_rProps) const
describes the properties provided by this class, or its respective derived class
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
virtual ::osl::Mutex & getMutex() override
virtual void SAL_CALL read(const css::uno::Reference< css::io::XObjectInputStream > &_rxInStream) override
virtual css::beans::PropertyState getPropertyStateByHandle(sal_Int32 nHandle) override
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
virtual css::uno::Reference< css::uno::XInterface > SAL_CALL getParent() override
virtual void SAL_CALL removeProperty(const OUString &Name) override
css::uno::Reference< css::uno::XComponentContext > m_xContext
virtual void SAL_CALL setParent(const css::uno::Reference< css::uno::XInterface > &Parent) override
PropertyBagHelper m_aPropertyBagHelper
virtual void readAggregate(const css::uno::Reference< css::io::XObjectInputStream > &_rxInStream)
virtual void writeAggregate(const css::uno::Reference< css::io::XObjectOutputStream > &_rxOutStream) const
virtual css::uno::Reference< css::beans::XMultiPropertySet > getPropertiesInterface() override
virtual css::uno::Sequence< css::uno::Type > _getTypes()
virtual void SAL_CALL getFastPropertyValue(css::uno::Any &rValue, sal_Int32 nHandle) const override
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
virtual void SAL_CALL addProperty(const OUString &Name, ::sal_Int16 Attributes, const css::uno::Any &DefaultValue) override
virtual void SAL_CALL disposing() override
virtual void describeFixedAndAggregateProperties(css::uno::Sequence< css::beans::Property > &_out_rFixedProperties, css::uno::Sequence< css::beans::Property > &_out_rAggregateProperties) const override
oslInterlockedCount m_lockCount
void firePropertyChanges(const std::vector< sal_Int32 > &_rHandles, const std::vector< css::uno::Any > &_rOldValues, const std::vector< css::uno::Any > &_rNewValues, LockAccess)
virtual css::uno::Any getPropertyDefaultByHandle(sal_Int32 nHandle) const override
virtual void setPropertyToDefaultByHandle(sal_Int32 nHandle) override
virtual void SAL_CALL setFastPropertyValue_NoBroadcast(sal_Int32 nHandle, const css::uno::Any &rValue) override
virtual void describeAggregateProperties(css::uno::Sequence< css::beans::Property > &_rAggregateProps) const
describes the properties of our aggregate
void writeHelpTextCompatibly(const css::uno::Reference< css::io::XObjectOutputStream > &_rxOutStream)
virtual css::uno::Any SAL_CALL queryAggregation(const css::uno::Type &_rType) override
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override
oslInterlockedCount unlockInstance(LockAccess)
virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL getPropertyValues() override
virtual void SAL_CALL setPropertyValues(const css::uno::Sequence< css::beans::PropertyValue > &aProps) override
css::uno::Reference< css::uno::XInterface > m_xParent
void lockInstance(LockAccess)
static css::uno::Sequence< OUString > getSupportedServiceNames_Static()
virtual ~OControlModel() override
virtual OUString SAL_CALL getName() override
virtual void SAL_CALL write(const css::uno::Reference< css::io::XObjectOutputStream > &_rxOutStream) override
virtual sal_Bool SAL_CALL convertFastPropertyValue(css::uno::Any &_rConvertedValue, css::uno::Any &_rOldValue, sal_Int32 _nHandle, const css::uno::Any &_rValue) override
virtual void clonedFrom(const OControlModel *_pOriginal)
to be called after an OBoundControlModel (a derivee, respectively) has been cloned
virtual void SAL_CALL setName(const OUString &aName) override
void readHelpTextCompatibly(const css::uno::Reference< css::io::XObjectInputStream > &_rxInStream)
virtual cppu::IPropertyArrayHelper &SAL_CALL getInfoHelper() override
sal_Int16 m_nControlTypeinMSO
OControlModel(const css::uno::Reference< css::uno::XComponentContext > &_rFactory, const OUString &_rUnoControlModelTypeName, const OUString &rDefault=OUString(), const bool _bSetDelegator=true)
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
css::uno::Reference< css::uno::XAggregation > m_xAggregate
virtual css::uno::Reference< css::awt::XView > SAL_CALL getView() override
void impl_resetStateGuard_nothrow()
virtual css::uno::Reference< css::uno::XInterface > SAL_CALL getContext() override
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
virtual void SAL_CALL setContext(const css::uno::Reference< css::uno::XInterface > &Context) override
virtual css::uno::Any SAL_CALL queryAggregation(const css::uno::Type &_rType) override
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
void doSetDelegator()
sets the control as delegator at the aggregate
virtual sal_Bool SAL_CALL isDesignMode() override
virtual ~OControl() override
virtual void SAL_CALL createPeer(const css::uno::Reference< css::awt::XToolkit > &Toolkit, const css::uno::Reference< css::awt::XWindowPeer > &Parent) override
virtual css::uno::Reference< css::awt::XWindowPeer > SAL_CALL getPeer() override
virtual css::uno::Reference< css::awt::XControlModel > SAL_CALL getModel() override
virtual sal_Bool SAL_CALL isTransparent() override
OControl(const css::uno::Reference< css::uno::XComponentContext > &_rFactory, const OUString &_rAggregateService, const bool _bSetDelegator=true)
constructs a control
virtual sal_Bool SAL_CALL setModel(const css::uno::Reference< css::awt::XControlModel > &Model) override
virtual void SAL_CALL disposing() override
css::uno::Reference< css::awt::XControl > m_xControl
virtual void SAL_CALL setDesignMode(sal_Bool bOn) override
virtual css::uno::Sequence< css::uno::Type > _getTypes()
WindowStateGuard m_aWindowStateGuard
css::uno::Sequence< OUString > getAggregateServiceNames() const
css::uno::Sequence< css::beans::PropertyValue > getPropertyValues()
bool convertDynamicFastPropertyValue(sal_Int32 _nHandle, const css::uno::Any &_rNewValue, css::uno::Any &_out_rConvertedValue, css::uno::Any &_out_rCurrentValue) const
void getDynamicPropertyDefaultByHandle(sal_Int32 _nHandle, css::uno::Any &_out_rValue) const
void getDynamicFastPropertyValue(sal_Int32 _nHandle, css::uno::Any &_out_rValue) const
void removeProperty(const OUString &_rName)
void addProperty(const OUString &_rName, ::sal_Int16 _nAttributes, const css::uno::Any &_rInitialValue)
void setPropertyValues(const css::uno::Sequence< css::beans::PropertyValue > &_rProps)
bool hasDynamicPropertyByHandle(sal_Int32 _nHandle) const
inline ::comphelper::OPropertyArrayAggregationHelper & getInfoHelper() const
void setDynamicFastPropertyValue(sal_Int32 _nHandle, const css::uno::Any &_rValue)
void addResetListener(const css::uno::Reference< css::form::XResetListener > &_listener)
void removeResetListener(const css::uno::Reference< css::form::XResetListener > &_listener)
a helper class which merges sequences of <type scope="css::uno">Type</type>s, so that the resulting s...
TypeSequence getTypes() const
returns the types represented by this bag
void attach(const css::uno::Reference< css::awt::XWindow2 > &_rxWindow, const css::uno::Reference< css::awt::XControlModel > &_rxModel)
#define DBG_ASSERT(sCon, aError)
#define TOOLS_WARN_EXCEPTION(area, stream)
#define DBG_UNHANDLED_EXCEPTION(...)
constexpr OUStringLiteral PROPERTY_ENFORCE_FORMAT
constexpr OUStringLiteral PROPERTY_DEFAULTCONTROL
constexpr OUStringLiteral PROPERTY_CONTROL_TYPE_IN_MSO
constexpr OUStringLiteral PROPERTY_NAME
constexpr OUStringLiteral PROPERTY_ISNULLABLE
constexpr OUStringLiteral PROPERTY_OBJ_ID_IN_MSO
constexpr OUStringLiteral PROPERTY_BOUNDFIELD
constexpr OUStringLiteral PROPERTY_NATIVE_LOOK
constexpr OUStringLiteral PROPERTY_CONTROLSOURCE
constexpr OUStringLiteral PROPERTY_READONLY
constexpr OUStringLiteral PROPERTY_STANDARD_THEME
constexpr OUStringLiteral PROPERTY_CONTROLLABEL
constexpr OUStringLiteral PROPERTY_RELEVANT
constexpr OUStringLiteral PROPERTY_GENERATEVBAEVENTS
constexpr OUStringLiteral PROPERTY_HELPTEXT
constexpr OUStringLiteral PROPERTY_CLASSID
constexpr OUStringLiteral PROPERTY_FIELDTYPE
constexpr OUStringLiteral PROPERTY_TAG
constexpr OUStringLiteral PROPERTY_ISNEW
constexpr OUStringLiteral PROPERTY_INPUT_REQUIRED
constexpr OUStringLiteral PROPERTY_CONTROLSOURCEPROPERTY
constexpr OUStringLiteral PROPERTY_VALUE
constexpr OUStringLiteral PROPERTY_ENABLED
#define SAL_WARN(area, stream)
bool query_aggregation(const css::uno::Reference< css::uno::XAggregation > &_rxAggregate, css::uno::Reference< iface > &_rxOut)
bool tryPropertyValue(Any &_rConvertedValue, Any &_rOldValue, const Any &_rValueToSet, const Any &_rCurrentValue, const Type &_rExpectedType)
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
Any SAL_CALL getCaughtException()
OUString loadString(TranslateId aResId)
loads the string with the specified resource id from the FormLayer mo file
ListBox is a bit confusing / different from other form components, so here are a few notes:
const sal_Int16 FRM_DEFAULT_TABINDEX
VBAHELPER_DLLPUBLIC bool setPropertyValue(css::uno::Sequence< css::beans::PropertyValue > &aProp, const OUString &aName, const css::uno::Any &aValue)
#define PROPERTY_ID_CONTROLSOURCEPROPERTY
#define PROPERTY_ID_BOUNDFIELD
#define PROPERTY_ID_GENERATEVBAEVENTS
#define PROPERTY_ID_CONTROL_TYPE_IN_MSO
#define PROPERTY_ID_INPUT_REQUIRED
#define PROPERTY_ID_CONTROLLABEL
#define PROPERTY_ID_STANDARD_THEME
#define PROPERTY_ID_NATIVE_LOOK
#define PROPERTY_ID_CLASSID
#define PROPERTY_ID_CONTROLSOURCE
#define PROPERTY_ID_OBJ_ID_IN_MSO
#define PROPERTY_ID_TABINDEX
constexpr OUStringLiteral FRM_SUN_FORMCOMPONENT
constexpr OUStringLiteral FRM_SUN_COMPONENT_FIXEDTEXT
Reference< XModel > xModel