Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
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/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
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 .
18 : */
19 :
20 : #ifndef _FORMS_TIME_HXX_
21 : #define _FORMS_TIME_HXX_
22 :
23 : #include "EditBase.hxx"
24 : #include "limitedformats.hxx"
25 :
26 : //.........................................................................
27 : namespace frm
28 : {
29 : //.........................................................................
30 :
31 : //==================================================================
32 : //= OTimeModel
33 : //==================================================================
34 : class OTimeModel
35 : :public OEditBaseModel
36 : ,public OLimitedFormats
37 : {
38 : private:
39 : ::com::sun::star::uno::Any m_aSaveValue;
40 : sal_Bool m_bDateTimeField;
41 :
42 : protected:
43 : virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type> _getTypes();
44 :
45 : public:
46 : DECLARE_DEFAULT_LEAF_XTOR( OTimeModel );
47 :
48 : // stario::XPersistObject
49 : virtual ::rtl::OUString SAL_CALL getServiceName() throw ( ::com::sun::star::uno::RuntimeException);
50 :
51 : // ::com::sun::star::beans::XPropertySet
52 : virtual void SAL_CALL getFastPropertyValue(::com::sun::star::uno::Any& rValue, sal_Int32 nHandle ) const;
53 : virtual sal_Bool SAL_CALL convertFastPropertyValue(::com::sun::star::uno::Any& rConvertedValue, ::com::sun::star::uno::Any& rOldValue,
54 : sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue )
55 : throw(::com::sun::star::lang::IllegalArgumentException);
56 : virtual void SAL_CALL setFastPropertyValue_NoBroadcast(sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue) throw ( ::com::sun::star::uno::Exception);
57 :
58 : // ::com::sun::star::lang::XServiceInfo
59 0 : IMPLEMENTATION_NAME(OTimeModel);
60 : virtual StringSequence SAL_CALL getSupportedServiceNames() throw();
61 :
62 : // OControlModel's property handling
63 : virtual void describeFixedProperties(
64 : ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& /* [out] */ _rProps
65 : ) const;
66 :
67 : // prevent method hiding
68 : using OBoundControlModel::getFastPropertyValue;
69 :
70 : protected:
71 : // OBoundControlModel overridables
72 : virtual ::com::sun::star::uno::Any
73 : translateDbColumnToControlValue( );
74 : virtual sal_Bool commitControlValueToDbColumn( bool _bPostReset );
75 :
76 : virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type >
77 : getSupportedBindingTypes();
78 : virtual ::com::sun::star::uno::Any
79 : translateControlValueToExternalValue( ) const;
80 : virtual ::com::sun::star::uno::Any
81 : translateExternalValueToControlValue( const ::com::sun::star::uno::Any& _rExternalValue ) const;
82 :
83 : virtual ::com::sun::star::uno::Any
84 : translateControlValueToValidatableValue( ) const;
85 :
86 : virtual ::com::sun::star::uno::Any
87 : getDefaultForReset() const;
88 : virtual void resetNoBroadcast();
89 :
90 : virtual void onConnectedDbColumn( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxForm );
91 :
92 : protected:
93 : DECLARE_XCLONEABLE();
94 :
95 : private:
96 : /** translates the control value (the VCL-internal integer representation of a date) into
97 : a UNO-Date.
98 : */
99 : void impl_translateControlValueToUNOTime(
100 : ::com::sun::star::uno::Any& _rUNOValue ) const;
101 : };
102 :
103 : //==================================================================
104 : //= OTimeControl
105 : //==================================================================
106 0 : class OTimeControl: public OBoundControl
107 : {
108 : protected:
109 : virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type> _getTypes();
110 :
111 : public:
112 : OTimeControl(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory);
113 0 : DECLARE_UNO3_AGG_DEFAULTS(OTimeControl, OBoundControl);
114 :
115 : // ::com::sun::star::lang::XServiceInfo
116 0 : IMPLEMENTATION_NAME(OTimeControl);
117 : virtual StringSequence SAL_CALL getSupportedServiceNames() throw();
118 : };
119 :
120 : //.........................................................................
121 : } // namespace frm
122 : //.........................................................................
123 :
124 : #endif // _FORMS_TIME_HXX_
125 :
126 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|