21#include <property.hxx>
25#include <com/sun/star/beans/PropertyAttribute.hpp>
26#include <com/sun/star/form/FormComponentType.hpp>
40using namespace ::com::sun::star::form::binding;
51 aSupported.realloc(aSupported.getLength() + 2);
53 OUString* pArray = aSupported.getArray();
67 m_nClassId = FormComponentType::CHECKBOX;
73 :OReferenceValueComponent( _pOriginal, _rxFactory )
86 pClone->clonedFrom(
this);
97 sal_Int32 nOldLen = aSupported.getLength();
98 aSupported.realloc( nOldLen + 9 );
99 OUString* pStoreTo = aSupported.getArray() + nOldLen;
121 sal_Int32 nOldCount = _rProps.getLength();
122 _rProps.realloc( nOldCount + 1);
123 css::beans::Property* pProperties = _rProps.getArray() + nOldCount;
125 DBG_ASSERT( pProperties == _rProps.getArray() + _rProps.getLength(),
"<...>::describeFixedProperties/getInfoHelper: forgot to adjust the count ?");
140 _rxOutStream->writeShort(0x0003);
156 sal_uInt16
nVersion = _rxInStream->readShort();
158 OUString sReferenceValue;
159 sal_Int16 nDefaultChecked( 0 );
163 _rxInStream >> sReferenceValue;
164 nDefaultChecked = _rxInStream->readShort();
167 _rxInStream >> sReferenceValue;
168 _rxInStream >> nDefaultChecked;
172 _rxInStream >> sReferenceValue;
173 _rxInStream >> nDefaultChecked;
178 OSL_FAIL(
"OCheckBoxModel::read : unknown version !");
203 bool bValue = bool();
210 const OUString sVal(
m_xColumn->getString());
220 bool bTriState =
true;
221 if ( m_xAggregateSet.is() )
225 else if ( !aValue.hasValue() )
240 OSL_PRECOND(
m_xColumnUpdate.is(),
"OCheckBoxModel::commitControlValueToDbColumn: not bound!" );
267 OSL_FAIL(
"OCheckBoxModel::commitControlValueToDbColumn: invalid value !");
272 OSL_FAIL(
"OCheckBoxModel::commitControlValueToDbColumn: could not commit !");
279extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
281 css::uno::Sequence<css::uno::Any>
const &)
286extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
288 css::uno::Sequence<css::uno::Any>
const &)
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * com_sun_star_form_OCheckBoxControl_get_implementation(css::uno::XComponentContext *component, css::uno::Sequence< css::uno::Any > const &)
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * com_sun_star_form_OCheckBoxModel_get_implementation(css::uno::XComponentContext *component, 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)
css::uno::Reference< css::sdb::XColumnUpdate > m_xColumnUpdate
OCheckBoxControl(const css::uno::Reference< css::uno::XComponentContext > &_rxContext)
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
virtual ~OCheckBoxModel() override
virtual css::uno::Any translateDbColumnToControlValue() override
translates a db column value into a control value.
virtual bool commitControlValueToDbColumn(bool _bPostReset) override
commits the current control value to the database column we're bound to @precond we're properly bound...
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
virtual void SAL_CALL write(const css::uno::Reference< css::io::XObjectOutputStream > &_rxOutStream) override
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 SAL_CALL read(const css::uno::Reference< css::io::XObjectInputStream > &_rxInStream) override
virtual css::uno::Reference< css::util::XCloneable > SAL_CALL createClone() override
OCheckBoxModel(const css::uno::Reference< css::uno::XComponentContext > &_rxFactory)
virtual OUString SAL_CALL getServiceName() 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
an OBoundControlModel which features the exchange of a reference value
void setDefaultChecked(ToggleState _eChecked)
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
const OUString & getNoCheckReferenceValue() const
void setReferenceValue(const OUString &_rRefValue)
#define DBG_ASSERT(sCon, aError)
constexpr OUStringLiteral PROPERTY_TABINDEX
constexpr OUStringLiteral PROPERTY_STATE
constexpr OUStringLiteral PROPERTY_TRISTATE
ListBox is a bit confusing / different from other form components, so here are a few notes:
#define PROPERTY_ID_STATE
#define PROPERTY_ID_TABINDEX
constexpr OUStringLiteral BINDABLE_DATABASE_CHECK_BOX
constexpr OUStringLiteral VCL_CONTROLMODEL_CHECKBOX
constexpr OUStringLiteral FRM_COMPONENT_CHECKBOX
constexpr OUStringLiteral VALIDATABLE_BINDABLE_CONTROL_MODEL
constexpr OUStringLiteral VCL_CONTROL_CHECKBOX
constexpr OUStringLiteral BINDABLE_DATA_AWARE_CONTROL_MODEL
constexpr OUStringLiteral FRM_SUN_COMPONENT_CHECKBOX
constexpr OUStringLiteral DATA_AWARE_CONTROL_MODEL
constexpr OUStringLiteral VALIDATABLE_CONTROL_MODEL
constexpr OUStringLiteral FRM_SUN_COMPONENT_DATABASE_CHECKBOX
constexpr OUStringLiteral BINDABLE_CONTROL_MODEL
constexpr OUStringLiteral STARDIV_ONE_FORM_CONTROL_CHECKBOX
constexpr OUStringLiteral FRM_SUN_CONTROL_CHECKBOX