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 .
22 #include <toolkit/controls/unocontrols.hxx>
23 #include <toolkit/controls/unocontrolmodel.hxx>
25 namespace com::sun::star::util
{ class XNumberFormatter
; }
32 // = UnoControlFormattedFieldModel
34 class UnoControlFormattedFieldModel final
: public UnoControlModel
37 UnoControlFormattedFieldModel( const css::uno::Reference
< css::uno::XComponentContext
>& rxContext
);
38 UnoControlFormattedFieldModel( const UnoControlFormattedFieldModel
& rModel
)
39 : UnoControlModel(rModel
)
40 , m_bRevokedAsClient(false)
41 , m_bSettingValueAndText(false)
45 rtl::Reference
<UnoControlModel
> Clone() const override
{ return new UnoControlFormattedFieldModel( *this ); }
47 // css::io::XPersistObject
48 OUString SAL_CALL
getServiceName() override
;
50 // css::beans::XMultiPropertySet
51 css::uno::Reference
< css::beans::XPropertySetInfo
> SAL_CALL
getPropertySetInfo( ) override
;
54 // css::lang::XServiceInfo
55 OUString SAL_CALL
getImplementationName() override
;
57 css::uno::Sequence
<OUString
> SAL_CALL
getSupportedServiceNames() override
;
60 virtual ~UnoControlFormattedFieldModel() override
;
63 void SAL_CALL
dispose() override
;
66 void SAL_CALL
setPropertyValues( const css::uno::Sequence
< OUString
>& PropertyNames
, const css::uno::Sequence
< css::uno::Any
>& Values
) override
;
69 virtual void ImplNormalizePropertySequence(
70 const sal_Int32 _nCount
, /// the number of entries in the arrays
71 sal_Int32
* _pHandles
, /// the handles of the properties to set
72 css::uno::Any
* _pValues
, /// the values of the properties to set
73 sal_Int32
* _pValidHandles
/// pointer to the valid handles, allowed to be adjusted
75 void impl_updateTextFromValue_nothrow(std::unique_lock
<std::mutex
>& rGuard
);
76 void impl_updateCachedFormatter_nothrow(std::unique_lock
<std::mutex
>& rGuard
);
77 void impl_updateCachedFormatKey_nothrow(std::unique_lock
<std::mutex
>& rGuard
);
79 css::uno::Any
ImplGetDefaultValue( sal_uInt16 nPropId
) const override
;
80 ::cppu::IPropertyArrayHelper
& getInfoHelper() override
;
81 bool convertFastPropertyValue(
82 std::unique_lock
<std::mutex
>& rGuard
,
83 css::uno::Any
& rConvertedValue
,
84 css::uno::Any
& rOldValue
,
86 const css::uno::Any
& rValue
89 void setFastPropertyValue_NoBroadcast(
90 std::unique_lock
<std::mutex
>& rGuard
,
92 const css::uno::Any
& rValue
95 css::uno::Any m_aCachedFormat
;
96 bool m_bRevokedAsClient
;
97 bool m_bSettingValueAndText
;
98 css::uno::Reference
< css::util::XNumberFormatter
>
103 // = UnoFormattedFieldControl
105 class UnoFormattedFieldControl final
: public UnoSpinFieldControl
108 UnoFormattedFieldControl();
109 OUString
GetComponentServiceName() const override
;
111 // css::awt::XTextListener
112 void SAL_CALL
textChanged( const css::awt::TextEvent
& rEvent
) override
;
114 // css::lang::XServiceInfo
115 OUString SAL_CALL
getImplementationName() override
;
117 css::uno::Sequence
<OUString
> SAL_CALL
getSupportedServiceNames() override
;
121 } // namespace toolkit
124 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */