1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 INCLUDED_FORMS_SOURCE_COMPONENT_TIME_HXX
21 #define INCLUDED_FORMS_SOURCE_COMPONENT_TIME_HXX
23 #include "EditBase.hxx"
24 #include "limitedformats.hxx"
31 :public OEditBaseModel
32 ,public OLimitedFormats
35 ::com::sun::star::uno::Any m_aSaveValue
;
36 bool m_bDateTimeField
;
39 virtual ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Type
> _getTypes() SAL_OVERRIDE
;
42 DECLARE_DEFAULT_LEAF_XTOR( OTimeModel
);
44 // css::io::XPersistObject
45 virtual OUString SAL_CALL
getServiceName() throw ( ::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
47 // ::com::sun::star::beans::XPropertySet
48 virtual void SAL_CALL
getFastPropertyValue(::com::sun::star::uno::Any
& rValue
, sal_Int32 nHandle
) const SAL_OVERRIDE
;
49 virtual sal_Bool SAL_CALL
convertFastPropertyValue(::com::sun::star::uno::Any
& rConvertedValue
, ::com::sun::star::uno::Any
& rOldValue
,
50 sal_Int32 nHandle
, const ::com::sun::star::uno::Any
& rValue
)
51 throw(::com::sun::star::lang::IllegalArgumentException
) SAL_OVERRIDE
;
52 virtual void SAL_CALL
setFastPropertyValue_NoBroadcast(sal_Int32 nHandle
, const ::com::sun::star::uno::Any
& rValue
) throw ( ::com::sun::star::uno::Exception
, std::exception
) SAL_OVERRIDE
;
54 // ::com::sun::star::lang::XServiceInfo
55 OUString SAL_CALL
getImplementationName()
56 throw (css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
57 { return OUString("com.sun.star.form.OTimeModel"); }
59 virtual StringSequence SAL_CALL
getSupportedServiceNames() throw(std::exception
) SAL_OVERRIDE
;
61 // OControlModel's property handling
62 virtual void describeFixedProperties(
63 ::com::sun::star::uno::Sequence
< ::com::sun::star::beans::Property
>& /* [out] */ _rProps
66 // prevent method hiding
67 using OBoundControlModel::getFastPropertyValue
;
70 // OBoundControlModel overridables
71 virtual ::com::sun::star::uno::Any
72 translateDbColumnToControlValue( ) SAL_OVERRIDE
;
73 virtual bool commitControlValueToDbColumn( bool _bPostReset
) SAL_OVERRIDE
;
75 virtual ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Type
>
76 getSupportedBindingTypes() SAL_OVERRIDE
;
77 virtual ::com::sun::star::uno::Any
78 translateControlValueToExternalValue( ) const SAL_OVERRIDE
;
79 virtual ::com::sun::star::uno::Any
80 translateExternalValueToControlValue( const ::com::sun::star::uno::Any
& _rExternalValue
) const SAL_OVERRIDE
;
82 virtual ::com::sun::star::uno::Any
83 translateControlValueToValidatableValue( ) const SAL_OVERRIDE
;
85 virtual ::com::sun::star::uno::Any
86 getDefaultForReset() const SAL_OVERRIDE
;
87 virtual void resetNoBroadcast() SAL_OVERRIDE
;
89 virtual void onConnectedDbColumn( const ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XInterface
>& _rxForm
) SAL_OVERRIDE
;
92 virtual css::uno::Reference
< css::util::XCloneable
> SAL_CALL
createClone( ) throw (css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
95 /** translates the control value (the VCL-internal integer representation of a date) into
98 void impl_translateControlValueToUNOTime(
99 ::com::sun::star::uno::Any
& _rUNOValue
) const;
102 class OTimeControl
: public OBoundControl
105 virtual ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Type
> _getTypes() SAL_OVERRIDE
;
108 OTimeControl(const ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XComponentContext
>& _rxFactory
);
109 DECLARE_UNO3_AGG_DEFAULTS(OTimeControl
, OBoundControl
)
111 // ::com::sun::star::lang::XServiceInfo
112 OUString SAL_CALL
getImplementationName()
113 throw (css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
114 { return OUString("com.sun.star.form.OTimeControl"); }
116 virtual StringSequence SAL_CALL
getSupportedServiceNames() throw(std::exception
) SAL_OVERRIDE
;
123 #endif // INCLUDED_FORMS_SOURCE_COMPONENT_TIME_HXX
125 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */