21#include <property.hxx>
25#include <com/sun/star/beans/PropertyAttribute.hpp>
26#include <com/sun/star/sdbc/DataType.hpp>
27#include <com/sun/star/util/DateTime.hpp>
28#include <com/sun/star/form/FormComponentType.hpp>
56Sequence<Type> OTimeControl::_getTypes()
58 return OBoundControl::_getTypes();
62css::uno::Sequence<OUString> SAL_CALL OTimeControl::getSupportedServiceNames()
64 css::uno::Sequence<OUString> aSupported = OBoundControl::getSupportedServiceNames();
65 aSupported.realloc(aSupported.getLength() + 2);
67 OUString*pArray = aSupported.getArray();
78css::uno::Sequence<OUString> SAL_CALL OTimeModel::getSupportedServiceNames()
80 css::uno::Sequence<OUString> aSupported = OBoundControlModel::getSupportedServiceNames();
82 sal_Int32 nOldLen = aSupported.getLength();
83 aSupported.realloc( nOldLen + 9 );
84 OUString* pStoreTo = aSupported.getArray() + nOldLen;
103Sequence<Type> OTimeModel::_getTypes()
105 return OBoundControlModel::_getTypes();
109OTimeModel::OTimeModel(
const Reference<XComponentContext>& _rxFactory)
114 , m_bDateTimeField(false)
124 : OEditBaseModel(_pOriginal, _rxFactory)
125 , OLimitedFormats(_rxFactory, FormComponentType::
TIMEFIELD)
126 , m_bDateTimeField(false)
142 pClone->clonedFrom(
this);
157 sal_Int32 nOldCount = _rProps.getLength();
158 _rProps.realloc( nOldCount + 4);
159 css::beans::Property* pProperties = _rProps.getArray() + nOldCount;
164 css::beans::PropertyAttribute::READONLY | css::beans::PropertyAttribute::TRANSIENT);
165 DBG_ASSERT( pProperties == _rProps.getArray() + _rProps.getLength(),
"<...>::describeFixedProperties/getInfoHelper: forgot to adjust the count ?");
187 sal_Int32 _nHandle,
const Any& _rValue )
209 Reference<XPropertySet> xField =
getField();
216 sal_Int32 nFieldType = 0;
232 if ( !aControlValue.hasValue() )
239 if ( !( aControlValue >>= aTime ) )
242 aControlValue >>= nAsInt;
243 aTime = DBTypeConversion::toTime(nAsInt);
250 util::DateTime aDateTime =
m_xColumn->getTimestamp();
251 if (aDateTime.Year == 0 && aDateTime.Month == 0 && aDateTime.Day == 0)
252 aDateTime = ::com::sun::star::util::DateTime(0,0,0,0,30,12,1899,
false);
253 aDateTime.NanoSeconds = aTime.NanoSeconds;
254 aDateTime.Seconds = aTime.Seconds;
255 aDateTime.Minutes = aTime.Minutes;
256 aDateTime.Hours = aTime.Hours;
278 return _rExternalValue;
320extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
322 css::uno::Sequence<css::uno::Any>
const &)
327extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
329 css::uno::Sequence<css::uno::Any>
const &)
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * com_sun_star_form_OTimeModel_get_implementation(css::uno::XComponentContext *component, css::uno::Sequence< css::uno::Any > const &)
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * com_sun_star_form_OTimeControl_get_implementation(css::uno::XComponentContext *component, css::uno::Sequence< css::uno::Any > const &)
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
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
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
OTimeControl(const css::uno::Reference< css::uno::XComponentContext > &_rxFactory)
virtual sal_Bool SAL_CALL convertFastPropertyValue(css::uno::Any &rConvertedValue, css::uno::Any &rOldValue, sal_Int32 nHandle, const css::uno::Any &rValue) override
virtual OUString SAL_CALL getServiceName() override
virtual void SAL_CALL setFastPropertyValue_NoBroadcast(sal_Int32 nHandle, const css::uno::Any &rValue) override
virtual ~OTimeModel() override
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 css::uno::Any translateControlValueToExternalValue() const override
commits the current control value to our external value binding
virtual css::uno::Any translateDbColumnToControlValue() override
translates a db column value into a control value.
css::uno::Any m_aSaveValue
virtual void SAL_CALL getFastPropertyValue(css::uno::Any &rValue, sal_Int32 nHandle) const override
OTimeModel(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 css::uno::Any getDefaultForReset() const override
returns the default which should be used when resetting the control
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 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 bool commitControlValueToDbColumn(bool _bPostReset) override
commits the current control value to the database column we're bound to @precond we're properly bound...
virtual void resetNoBroadcast() override
called to reset the control to some kind of default.
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::Reference< css::util::XCloneable > SAL_CALL createClone() override
#define DBG_ASSERT(sCon, aError)
constexpr OUStringLiteral PROPERTY_TABINDEX
constexpr OUStringLiteral PROPERTY_DEFAULT_TIME
constexpr OUStringLiteral PROPERTY_TIME
constexpr OUStringLiteral PROPERTY_FIELDTYPE
constexpr OUStringLiteral PROPERTY_FORMATKEY
constexpr OUStringLiteral PROPERTY_FORMATSSUPPLIER
ListBox is a bit confusing / different from other form components, so here are a few notes:
#define PROPERTY_ID_FORMATKEY
#define PROPERTY_ID_TIMEFORMAT
#define PROPERTY_ID_DEFAULT_TIME
#define PROPERTY_ID_FORMATSSUPPLIER
#define PROPERTY_ID_TABINDEX
constexpr OUStringLiteral FRM_SUN_CONTROL_TIMEFIELD
constexpr OUStringLiteral FRM_SUN_COMPONENT_TIMEFIELD
constexpr OUStringLiteral VALIDATABLE_BINDABLE_CONTROL_MODEL
constexpr OUStringLiteral VCL_CONTROL_TIMEFIELD
constexpr OUStringLiteral FRM_COMPONENT_TIMEFIELD
constexpr OUStringLiteral STARDIV_ONE_FORM_CONTROL_TIMEFIELD
constexpr OUStringLiteral BINDABLE_DATA_AWARE_CONTROL_MODEL
constexpr OUStringLiteral FRM_SUN_COMPONENT_DATABASE_TIMEFIELD
constexpr OUStringLiteral VCL_CONTROLMODEL_TIMEFIELD
constexpr OUStringLiteral DATA_AWARE_CONTROL_MODEL
constexpr OUStringLiteral VALIDATABLE_CONTROL_MODEL
constexpr OUStringLiteral BINDABLE_DATABASE_TIME_FIELD
constexpr OUStringLiteral BINDABLE_CONTROL_MODEL