bump product version to 4.1.6.2
[LibreOffice.git] / forms / source / component / Date.hxx
blob1160945550fb2f8c0a2ab3d1b39b56376202f5a6
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef _FORMS_DATE_HXX_
21 #define _FORMS_DATE_HXX_
23 #include "EditBase.hxx"
24 #include "limitedformats.hxx"
26 //.........................................................................
27 namespace frm
29 //.........................................................................
31 //==================================================================
32 //= ODateModel
33 //==================================================================
34 class ODateModel
35 :public OEditBaseModel
36 ,public OLimitedFormats
38 ::com::sun::star::uno::Any m_aSaveValue;
39 sal_Bool m_bDateTimeField;
41 protected:
42 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type> _getTypes();
44 public:
45 DECLARE_DEFAULT_LEAF_XTOR( ODateModel );
47 // XPersistObject
48 virtual OUString SAL_CALL getServiceName() throw ( ::com::sun::star::uno::RuntimeException );
50 // ::com::sun::star::beans::XPropertySet
51 virtual void SAL_CALL getFastPropertyValue(::com::sun::star::uno::Any& rValue, sal_Int32 nHandle ) const;
52 virtual sal_Bool SAL_CALL convertFastPropertyValue(::com::sun::star::uno::Any& rConvertedValue, ::com::sun::star::uno::Any& rOldValue,
53 sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue )
54 throw(::com::sun::star::lang::IllegalArgumentException);
55 virtual void SAL_CALL setFastPropertyValue_NoBroadcast(sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue) throw ( ::com::sun::star::uno::Exception);
57 // XServiceInfo
58 IMPLEMENTATION_NAME(ODateModel);
59 virtual StringSequence SAL_CALL getSupportedServiceNames() throw();
61 // XPropertySet
62 using OEditBaseModel::getFastPropertyValue;
64 // OControlModel's property handling
65 virtual void describeFixedProperties(
66 ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& /* [out] */ _rProps
67 ) const;
69 protected:
70 // OBoundControlModel overridables
71 virtual ::com::sun::star::uno::Any
72 translateDbColumnToControlValue( );
73 virtual sal_Bool commitControlValueToDbColumn( bool _bPostReset );
75 virtual ::com::sun::star::uno::Any
76 translateControlValueToExternalValue( ) const;
77 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type >
78 getSupportedBindingTypes();
79 virtual ::com::sun::star::uno::Any
80 translateExternalValueToControlValue( const ::com::sun::star::uno::Any& _rExternalValue ) const;
82 virtual ::com::sun::star::uno::Any
83 translateControlValueToValidatableValue( ) const;
85 virtual ::com::sun::star::uno::Any
86 getDefaultForReset() const;
88 virtual void resetNoBroadcast();
90 virtual void onConnectedDbColumn( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxForm );
92 protected:
93 DECLARE_XCLONEABLE();
95 private:
96 /** translates the control value (the VCL-internal integer representation of a date) into
97 a UNO-Date.
99 void impl_translateControlValueToUNODate(
100 ::com::sun::star::uno::Any& _rUNOValue ) const;
103 //==================================================================
104 //= ODateControl
105 //==================================================================
106 class ODateControl: public OBoundControl
108 protected:
109 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type> _getTypes();
111 public:
112 ODateControl(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory);
113 DECLARE_UNO3_AGG_DEFAULTS(ODateControl, OBoundControl);
115 // ::com::sun::star::lang::XServiceInfo
116 IMPLEMENTATION_NAME(ODateControl);
117 virtual StringSequence SAL_CALL getSupportedServiceNames() throw();
120 //.........................................................................
121 } // namespace frm
122 //.........................................................................
124 #endif // _FORMS_DATE_HXX_
126 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */