27#include <com/sun/star/beans/PropertyAttribute.hpp>
28#include <com/sun/star/container/XIndexAccess.hpp>
29#include <com/sun/star/form/FormComponentType.hpp>
43using namespace ::com::sun::star::form::binding;
49 aSupported.realloc(aSupported.getLength() + 2);
51 OUString* pArray = aSupported.getArray();
69 m_nClassId = FormComponentType::RADIOBUTTON;
77 :OReferenceValueComponent( _pOriginal, _rxFactory )
91 pClone->clonedFrom(
this);
101 sal_Int32 nOldLen = aSupported.getLength();
102 aSupported.realloc( nOldLen + 9 );
103 OUString* pStoreTo = aSupported.getArray() + nOldLen;
128 if (sMyGroup.isEmpty())
132 Reference<XIndexAccess> xIndexAccess(
getParent(), UNO_QUERY);
133 if (!xIndexAccess.is())
136 Reference<XPropertySet> xMyProps =
this;
137 OUString sCurrentGroup;
138 sal_Int32 nNumSiblings = xIndexAccess->getCount();
139 for (sal_Int32
i=0;
i<nNumSiblings; ++
i)
141 Reference<XPropertySet> xSiblingProperties(xIndexAccess->getByIndex(
i), UNO_QUERY);
142 if (!xSiblingProperties.is())
144 if (xMyProps == xSiblingProperties)
152 if (
nType != FormComponentType::RADIOBUTTON)
157 if (sCurrentGroup == sMyGroup)
158 xSiblingProperties->setPropertyValue(rPropName, rValue);
202 Reference<XIndexAccess> xIndexAccess(
getParent(), UNO_QUERY);
203 if (!xIndexAccess.is())
206 OUString
sName, sGroupName;
212 Reference<XPropertySet> xMyProps =
this;
213 for (sal_Int32
i=0;
i<xIndexAccess->getCount(); ++
i)
215 Reference<XPropertySet> xSiblingProperties(xIndexAccess->getByIndex(
i), UNO_QUERY);
216 if (!xSiblingProperties.is())
219 if (xMyProps == xSiblingProperties)
225 if (
nType != FormComponentType::RADIOBUTTON)
229 OUString sSiblingName, sSiblingGroupName;
232 xSiblingProperties->getPropertyValue(
PROPERTY_NAME) >>= sSiblingName;
234 if ((sGroupName.isEmpty() && sSiblingGroupName.isEmpty() &&
235 sName == sSiblingName) ||
236 (!sGroupName.isEmpty() && !sSiblingGroupName.isEmpty() &&
237 sGroupName == sSiblingGroupName))
249 sal_Int32 nOldCount = _rProps.getLength();
250 _rProps.realloc( nOldCount + 1);
251 css::beans::Property* pProperties = _rProps.getArray() + nOldCount;
253 DBG_ASSERT( pProperties == _rProps.getArray() + _rProps.getLength(),
"<...>::describeFixedProperties/getInfoHelper: forgot to adjust the count ?");
268 _rxOutStream->writeShort(0x0003);
286 sal_uInt16
nVersion = _rxInStream->readShort();
288 OUString sReferenceValue;
289 sal_Int16 nDefaultChecked( 0 );
293 _rxInStream >> sReferenceValue;
294 _rxInStream >> nDefaultChecked;
297 _rxInStream >> sReferenceValue;
298 _rxInStream >> nDefaultChecked;
302 _rxInStream >> sReferenceValue;
303 _rxInStream >> nDefaultChecked;
308 OSL_FAIL(
"ORadioButtonModel::read : unknown version !");
327 if ( _rEvent.NewValue == sal_Int16(1) )
331 aZero <<= sal_Int16(0);
361 return aControlValue;
367 Reference< XPropertySet > xField(
getField() );
368 OSL_PRECOND( xField.is(),
"ORadioButtonModel::commitControlValueToDbColumn: not bound!" );
380 OSL_FAIL(
"ORadioButtonModel::commitControlValueToDbColumn: could not commit !");
388extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
390 css::uno::Sequence<css::uno::Any>
const &)
395extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
397 css::uno::Sequence<css::uno::Any>
const &)
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...
void defaultCommonProperties()
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
css::uno::Reference< css::sdb::XColumn > m_xColumn
virtual void resetNoBroadcast()
called to reset the control to some kind of default.
const OUString & getControlSource() const
virtual void SAL_CALL write(const css::uno::Reference< css::io::XObjectOutputStream > &OutStream) override
virtual void SAL_CALL read(const css::uno::Reference< css::io::XObjectInputStream > &InStream) override
void readCommonProperties(const css::uno::Reference< css::io::XObjectInputStream > &_rxInStream)
const css::uno::Reference< css::beans::XPropertySet > & getField() const
virtual void _propertyChanged(const css::beans::PropertyChangeEvent &_rEvt) override
virtual css::uno::Reference< css::uno::XInterface > SAL_CALL getParent() override
const css::uno::Reference< css::uno::XComponentContext > & getContext() const
void writeHelpTextCompatibly(const css::uno::Reference< css::io::XObjectOutputStream > &_rxOutStream)
void readHelpTextCompatibly(const css::uno::Reference< css::io::XObjectInputStream > &_rxInStream)
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
static OUString GetGroupName(const css::uno::Reference< css::beans::XPropertySet > &xComponent)
an OBoundControlModel which features the exchange of a reference value
void setDefaultChecked(ToggleState _eChecked)
virtual void SAL_CALL setFastPropertyValue_NoBroadcast(sal_Int32 nHandle, const css::uno::Any &rValue) override
const OUString & getReferenceValue() const
ToggleState getDefaultChecked() const
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 css::uno::Any translateExternalValueToControlValue(const css::uno::Any &_rExternalValue) const override
translates the given value, which was obtained from the current external value binding,...
void setReferenceValue(const OUString &_rRefValue)
#define DBG_ASSERT(sCon, aError)
constexpr OUStringLiteral PROPERTY_TABINDEX
constexpr OUStringLiteral PROPERTY_NAME
constexpr OUStringLiteral PROPERTY_GROUP_NAME
constexpr OUStringLiteral PROPERTY_CONTROLSOURCE
constexpr OUStringLiteral PROPERTY_CONTROLLABEL
constexpr OUStringLiteral PROPERTY_STATE
constexpr OUStringLiteral PROPERTY_DEFAULT_STATE
constexpr OUStringLiteral PROPERTY_CLASSID
constexpr OUStringLiteral PROPERTY_VALUE
bool hasProperty(const OUString &_rName, const Reference< XPropertySet > &_rxSet)
ListBox is a bit confusing / different from other form components, so here are a few notes:
VBAHELPER_DLLPUBLIC bool setPropertyValue(css::uno::Sequence< css::beans::PropertyValue > &aProp, const OUString &aName, const css::uno::Any &aValue)
bool getPropertyValue(ValueType &rValue, css::uno::Reference< css::beans::XPropertySet > const &xPropSet, OUString const &propName)
#define PROPERTY_ID_DEFAULT_STATE
#define PROPERTY_ID_CONTROLLABEL
#define PROPERTY_ID_STATE
#define PROPERTY_ID_CONTROLSOURCE
#define PROPERTY_ID_TABINDEX
constexpr OUStringLiteral VCL_CONTROL_RADIOBUTTON
constexpr OUStringLiteral FRM_SUN_COMPONENT_DATABASE_RADIOBUTTON
constexpr OUStringLiteral FRM_SUN_COMPONENT_RADIOBUTTON
constexpr OUStringLiteral BINDABLE_DATABASE_RADIO_BUTTON
constexpr OUStringLiteral VALIDATABLE_BINDABLE_CONTROL_MODEL
constexpr OUStringLiteral BINDABLE_DATA_AWARE_CONTROL_MODEL
constexpr OUStringLiteral DATA_AWARE_CONTROL_MODEL
constexpr OUStringLiteral FRM_SUN_COMPONENT_GROUPBOX
constexpr OUStringLiteral VALIDATABLE_CONTROL_MODEL
constexpr OUStringLiteral FRM_SUN_CONTROL_RADIOBUTTON
constexpr OUStringLiteral FRM_COMPONENT_RADIOBUTTON
constexpr OUStringLiteral STARDIV_ONE_FORM_CONTROL_RADIOBUTTON
constexpr OUStringLiteral BINDABLE_CONTROL_MODEL
constexpr OUStringLiteral VCL_CONTROLMODEL_RADIOBUTTON