LibreOffice Module forms (master) 1
Time.hxx
Go to the documentation of this file.
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#pragma once
21
22#include "EditBase.hxx"
23#include <limitedformats.hxx>
24
25
26namespace frm
27{
28
30 :public OEditBaseModel
31 ,public OLimitedFormats
32{
33private:
34 css::uno::Any m_aSaveValue;
36
37protected:
38 virtual css::uno::Sequence< css::uno::Type> _getTypes() override;
39
40public:
42 const css::uno::Reference< css::uno::XComponentContext>& _rxFactory
43 );
45 const OTimeModel* _pOriginal,
46 const css::uno::Reference< css::uno::XComponentContext>& _rxFactory
47 );
48 virtual ~OTimeModel() override;
49
50 // css::io::XPersistObject
51 virtual OUString SAL_CALL getServiceName() override;
52
53 // css::beans::XPropertySet
54 virtual void SAL_CALL getFastPropertyValue(css::uno::Any& rValue, sal_Int32 nHandle ) const override;
55 virtual sal_Bool SAL_CALL convertFastPropertyValue(css::uno::Any& rConvertedValue, css::uno::Any& rOldValue,
56 sal_Int32 nHandle, const css::uno::Any& rValue ) override;
57 virtual void SAL_CALL setFastPropertyValue_NoBroadcast(sal_Int32 nHandle, const css::uno::Any& rValue) override;
58
59 // css::lang::XServiceInfo
60 OUString SAL_CALL getImplementationName() override
61 { return "com.sun.star.form.OTimeModel"; }
62
63 virtual css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override;
64
65 // OControlModel's property handling
66 virtual void describeFixedProperties(
67 css::uno::Sequence< css::beans::Property >& /* [out] */ _rProps
68 ) const override;
69
70 // prevent method hiding
72
73protected:
74 // OBoundControlModel overridables
75 virtual css::uno::Any
77 virtual bool commitControlValueToDbColumn( bool _bPostReset ) override;
78
79 virtual css::uno::Sequence< css::uno::Type >
80 getSupportedBindingTypes() override;
81 virtual css::uno::Any translateControlValueToExternalValue( ) const override;
82 virtual css::uno::Any translateExternalValueToControlValue( const css::uno::Any& _rExternalValue ) const override;
83
84 virtual css::uno::Any translateControlValueToValidatableValue( ) const override;
85
86 virtual css::uno::Any getDefaultForReset() const override;
87 virtual void resetNoBroadcast() override;
88
89 virtual void onConnectedDbColumn( const css::uno::Reference< css::uno::XInterface >& _rxForm ) override;
90
91protected:
92 virtual css::uno::Reference< css::util::XCloneable > SAL_CALL createClone( ) override;
93};
94
96{
97protected:
98 virtual css::uno::Sequence< css::uno::Type> _getTypes() override;
99
100public:
101 explicit OTimeControl(const css::uno::Reference< css::uno::XComponentContext>& _rxFactory);
103
104 // css::lang::XServiceInfo
105 OUString SAL_CALL getImplementationName() override
106 { return "com.sun.star.form.OTimeControl"; }
107
108 virtual css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override;
109};
110
111
112} // namespace frm
113
114
115/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual void SAL_CALL getFastPropertyValue(css::uno::Any &rValue, sal_Int32 nHandle) const override
maintains translation tables format key <-> enum value
virtual css::uno::Sequence< css::uno::Type > _getTypes() override
Definition: Time.cxx:56
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: Time.cxx:62
OTimeControl(const css::uno::Reference< css::uno::XComponentContext > &_rxFactory)
OUString SAL_CALL getImplementationName() override
Definition: Time.hxx:105
virtual sal_Bool SAL_CALL convertFastPropertyValue(css::uno::Any &rConvertedValue, css::uno::Any &rOldValue, sal_Int32 nHandle, const css::uno::Any &rValue) override
Definition: Time.cxx:186
virtual OUString SAL_CALL getServiceName() override
Definition: Time.cxx:147
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: Time.cxx:78
virtual void SAL_CALL setFastPropertyValue_NoBroadcast(sal_Int32 nHandle, const css::uno::Any &rValue) override
Definition: Time.cxx:196
virtual ~OTimeModel() override
Definition: Time.cxx:132
bool m_bDateTimeField
Definition: Time.hxx:35
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
Definition: Time.cxx:313
virtual css::uno::Any translateControlValueToExternalValue() const override
commits the current control value to our external value binding
Definition: Time.cxx:270
virtual css::uno::Any translateDbColumnToControlValue() override
translates a db column value into a control value.
Definition: Time.cxx:288
virtual css::uno::Sequence< css::uno::Type > _getTypes() override
Definition: Time.cxx:103
css::uno::Any m_aSaveValue
Definition: Time.hxx:34
virtual void SAL_CALL getFastPropertyValue(css::uno::Any &rValue, sal_Int32 nHandle) const override
Definition: Time.cxx:169
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
Definition: Time.cxx:206
virtual css::uno::Any getDefaultForReset() const override
returns the default which should be used when resetting the control
Definition: Time.cxx:300
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,...
Definition: Time.cxx:276
OTimeModel(const OTimeModel *_pOriginal, const css::uno::Reference< css::uno::XComponentContext > &_rxFactory)
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.
Definition: Time.cxx:282
OUString SAL_CALL getImplementationName() override
Definition: Time.hxx:60
virtual bool commitControlValueToDbColumn(bool _bPostReset) override
commits the current control value to the database column we're bound to @precond we're properly bound...
Definition: Time.cxx:226
virtual void resetNoBroadcast() override
called to reset the control to some kind of default.
Definition: Time.cxx:306
virtual void describeFixedProperties(css::uno::Sequence< css::beans::Property > &_rProps) const override
describes the properties provided by this class, or its respective derived class
Definition: Time.cxx:154
virtual css::uno::Reference< css::util::XCloneable > SAL_CALL createClone() override
Definition: Time.cxx:139
ListBox is a bit confusing / different from other form components, so here are a few notes:
Definition: BaseListBox.hxx:25
unsigned char sal_Bool
#define DECLARE_UNO3_AGG_DEFAULTS(classname, baseclass)