21#include <property.hxx>
26#include <com/sun/star/sdbc/DataType.hpp>
27#include <com/sun/star/beans/PropertyAttribute.hpp>
28#include <com/sun/star/form/FormComponentType.hpp>
55Sequence<Type> ODateControl::_getTypes()
57 return OBoundControl::_getTypes();
60css::uno::Sequence<OUString> SAL_CALL ODateControl::getSupportedServiceNames()
67Sequence<Type> ODateModel::_getTypes()
69 return OEditBaseModel::_getTypes();
73ODateModel::ODateModel(
const Reference<XComponentContext>& _rxFactory)
78 , m_bDateTimeField(false)
88 if ( m_xAggregateSet.is() )
91 catch(
const Exception& )
100 : OEditBaseModel(_pOriginal, _rxFactory)
101 , OLimitedFormats(_rxFactory, FormComponentType::
DATEFIELD)
102 , m_bDateTimeField(false)
118 pClone->clonedFrom(
this);
126 const css::uno::Sequence<OUString> vals {
152 sal_Int32 nOldCount = _rProps.getLength();
153 _rProps.realloc( nOldCount + 4);
154 css::beans::Property* pProperties = _rProps.getArray() + nOldCount;
159 css::beans::PropertyAttribute::READONLY | css::beans::PropertyAttribute::TRANSIENT);
160 DBG_ASSERT( pProperties == _rProps.getArray() + _rProps.getLength(),
"<...>::describeFixedProperties/getInfoHelper: forgot to adjust the count ?");
182 sal_Int32 _nHandle,
const Any& _rValue )
204 Reference<XPropertySet> xField =
getField();
211 sal_Int32 nFieldType = 0;
227 if ( !aControlValue.hasValue() )
234 if ( !( aControlValue >>= aDate ) )
237 aControlValue >>= nAsInt;
238 aDate = DBTypeConversion::toDate(nAsInt);
245 util::DateTime aDateTime =
m_xColumn->getTimestamp();
246 aDateTime.Day = aDate.Day;
247 aDateTime.Month = aDate.Month;
248 aDateTime.Year = aDate.Year;
270 return _rExternalValue;
312extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
314 css::uno::Sequence<css::uno::Any>
const &)
319extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
321 css::uno::Sequence<css::uno::Any>
const &)
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * com_sun_star_form_ODateControl_get_implementation(css::uno::XComponentContext *component, css::uno::Sequence< css::uno::Any > const &)
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * com_sun_star_form_ODateModel_get_implementation(css::uno::XComponentContext *component, css::uno::Sequence< css::uno::Any > const &)
oslInterlockedCount m_refCount
sal_Int32 getValuePropertyAggHandle() const
virtual void onConnectedDbColumn(const css::uno::Reference< css::uno::XInterface > &_rxForm)
called whenever a connection to a database column has been established
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
void initValueProperty(const OUString &_rValuePropertyName, sal_Int32 _nValuePropertyExternalHandle)
initializes the part of the class which is related to the control value.
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.
const css::uno::Reference< css::beans::XPropertySet > & getField() const
css::uno::Reference< css::sdb::XColumnUpdate > m_xColumnUpdate
virtual css::uno::Any getControlValue() const
retrieves the current value of the control
const css::uno::Reference< css::uno::XComponentContext > & getContext() const
ODateControl(const css::uno::Reference< css::uno::XComponentContext > &_rxFactory)
virtual void onConnectedDbColumn(const css::uno::Reference< css::uno::XInterface > &_rxForm) override
called whenever a connection to a database column has been established
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() override
called to reset the control to some kind of default.
virtual css::uno::Reference< css::util::XCloneable > SAL_CALL createClone() override
virtual ~ODateModel() override
ODateModel(const css::uno::Reference< css::uno::XComponentContext > &_rxFactory)
virtual css::uno::Any translateDbColumnToControlValue() override
translates a db column value into a control value.
virtual void SAL_CALL setFastPropertyValue_NoBroadcast(sal_Int32 nHandle, const css::uno::Any &rValue) override
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,...
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 SAL_CALL getFastPropertyValue(css::uno::Any &rValue, sal_Int32 nHandle) const override
virtual css::uno::Any getDefaultForReset() const override
returns the default which should be used when resetting the control
css::uno::Any m_aSaveValue
virtual css::uno::Sequence< css::uno::Type > getSupportedBindingTypes() override
returns the data types which the control could use to exchange data with an external value binding
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 css::uno::Any translateControlValueToValidatableValue() const override
retrieves the current value of the control, in a shape which can be used with our external validator.
virtual css::uno::Any translateControlValueToExternalValue() const override
commits the current control value to our external value binding
virtual OUString SAL_CALL getServiceName() 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 SAL_CALL getFastPropertyValue(css::uno::Any &rValue, sal_Int32 nHandle) const override
virtual void SAL_CALL setFastPropertyValue_NoBroadcast(sal_Int32 nHandle, const css::uno::Any &rValue) override
#define DBG_ASSERT(sCon, aError)
#define TOOLS_WARN_EXCEPTION(area, stream)
constexpr OUStringLiteral PROPERTY_TABINDEX
constexpr OUStringLiteral PROPERTY_DATE
constexpr OUStringLiteral PROPERTY_DEFAULT_DATE
constexpr OUStringLiteral PROPERTY_FIELDTYPE
constexpr OUStringLiteral PROPERTY_FORMATKEY
constexpr OUStringLiteral PROPERTY_DATEMIN
constexpr OUStringLiteral PROPERTY_FORMATSSUPPLIER
css::uno::Sequence< T > concatSequences(const css::uno::Sequence< T > &rS1, const Ss &... rSn)
ListBox is a bit confusing / different from other form components, so here are a few notes:
#define PROPERTY_ID_FORMATKEY
#define PROPERTY_ID_DATEFORMAT
#define PROPERTY_ID_DEFAULT_DATE
#define PROPERTY_ID_FORMATSSUPPLIER
#define PROPERTY_ID_TABINDEX
constexpr OUStringLiteral STARDIV_ONE_FORM_CONTROL_DATEFIELD
constexpr OUStringLiteral FRM_SUN_CONTROL_DATEFIELD
constexpr OUStringLiteral VALIDATABLE_BINDABLE_CONTROL_MODEL
constexpr OUStringLiteral BINDABLE_DATA_AWARE_CONTROL_MODEL
constexpr OUStringLiteral VCL_CONTROL_DATEFIELD
constexpr OUStringLiteral BINDABLE_DATABASE_DATE_FIELD
constexpr OUStringLiteral DATA_AWARE_CONTROL_MODEL
constexpr OUStringLiteral FRM_SUN_COMPONENT_DATABASE_DATEFIELD
constexpr OUStringLiteral VCL_CONTROLMODEL_DATEFIELD
constexpr OUStringLiteral VALIDATABLE_CONTROL_MODEL
constexpr OUStringLiteral BINDABLE_CONTROL_MODEL
constexpr OUStringLiteral FRM_COMPONENT_DATEFIELD
constexpr OUStringLiteral FRM_SUN_COMPONENT_DATEFIELD