1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: Date.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _FORMS_DATE_HXX_
32 #define _FORMS_DATE_HXX_
34 #include "EditBase.hxx"
35 #include "limitedformats.hxx"
37 //.........................................................................
40 //.........................................................................
42 //==================================================================
44 //==================================================================
46 :public OEditBaseModel
47 ,public OLimitedFormats
49 ::com::sun::star::uno::Any m_aSaveValue
;
50 sal_Bool m_bDateTimeField
;
53 virtual ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Type
> _getTypes();
56 DECLARE_DEFAULT_LEAF_XTOR( ODateModel
);
59 virtual ::rtl::OUString SAL_CALL
getServiceName() throw ( ::com::sun::star::uno::RuntimeException
);
61 // ::com::sun::star::beans::XPropertySet
62 virtual void SAL_CALL
getFastPropertyValue(::com::sun::star::uno::Any
& rValue
, sal_Int32 nHandle
) const;
63 virtual sal_Bool SAL_CALL
convertFastPropertyValue(::com::sun::star::uno::Any
& rConvertedValue
, ::com::sun::star::uno::Any
& rOldValue
,
64 sal_Int32 nHandle
, const ::com::sun::star::uno::Any
& rValue
)
65 throw(::com::sun::star::lang::IllegalArgumentException
);
66 virtual void SAL_CALL
setFastPropertyValue_NoBroadcast(sal_Int32 nHandle
, const ::com::sun::star::uno::Any
& rValue
) throw ( ::com::sun::star::uno::Exception
);
69 IMPLEMENTATION_NAME(ODateModel
);
70 virtual StringSequence SAL_CALL
getSupportedServiceNames() throw();
73 using OEditBaseModel::getFastPropertyValue
;
75 // OControlModel's property handling
76 virtual void describeFixedProperties(
77 ::com::sun::star::uno::Sequence
< ::com::sun::star::beans::Property
>& /* [out] */ _rProps
81 // OBoundControlModel overridables
82 virtual ::com::sun::star::uno::Any
83 translateDbColumnToControlValue( );
84 virtual sal_Bool
commitControlValueToDbColumn( bool _bPostReset
);
86 virtual ::com::sun::star::uno::Any
87 translateControlValueToExternalValue( ) const;
88 virtual ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Type
>
89 getSupportedBindingTypes();
90 virtual ::com::sun::star::uno::Any
91 translateExternalValueToControlValue( const ::com::sun::star::uno::Any
& _rExternalValue
) const;
93 virtual ::com::sun::star::uno::Any
94 translateControlValueToValidatableValue( ) const;
96 virtual ::com::sun::star::uno::Any
97 getDefaultForReset() const;
99 virtual void onConnectedDbColumn( const ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XInterface
>& _rxForm
);
102 DECLARE_XCLONEABLE();
105 /** translates the control value (the VCL-internal integer representation of a date) into
108 void impl_translateControlValueToUNODate(
109 ::com::sun::star::uno::Any
& _rUNOValue
) const;
112 //==================================================================
114 //==================================================================
115 class ODateControl
: public OBoundControl
118 virtual ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Type
> _getTypes();
121 ODateControl(const ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XMultiServiceFactory
>& _rxFactory
);
122 DECLARE_UNO3_AGG_DEFAULTS(ODateControl
, OBoundControl
);
124 // ::com::sun::star::lang::XServiceInfo
125 IMPLEMENTATION_NAME(ODateControl
);
126 virtual StringSequence SAL_CALL
getSupportedServiceNames() throw();
129 //.........................................................................
131 //.........................................................................
133 #endif // _FORMS_DATE_HXX_