2010-10-14 08:27:31 +02:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-06-21 14:30:25 +01:00
|
|
|
/*
|
|
|
|
* This file is part of the LibreOffice project.
|
|
|
|
*
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*
|
|
|
|
* This file incorporates work covered by the following license notice:
|
|
|
|
*
|
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed
|
|
|
|
* with this work for additional information regarding copyright
|
|
|
|
* ownership. The ASF licenses this file to you under the Apache
|
|
|
|
* License, Version 2.0 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of
|
|
|
|
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
|
|
|
*/
|
2003-03-27 16:05:12 +00:00
|
|
|
|
2013-10-23 19:15:52 +02:00
|
|
|
#ifndef INCLUDED_TOOLKIT_CONTROLS_FORMATTEDCONTROL_HXX
|
|
|
|
#define INCLUDED_TOOLKIT_CONTROLS_FORMATTEDCONTROL_HXX
|
2003-03-27 16:05:12 +00:00
|
|
|
|
|
|
|
#include <toolkit/controls/unocontrols.hxx>
|
|
|
|
#include <toolkit/controls/unocontrolmodel.hxx>
|
|
|
|
|
2018-12-31 20:22:02 +01:00
|
|
|
namespace com { namespace sun { namespace star { namespace util { class XNumberFormatter; } } } }
|
2003-03-27 16:05:12 +00:00
|
|
|
|
2014-02-25 19:06:16 +01:00
|
|
|
|
2003-03-27 16:05:12 +00:00
|
|
|
namespace toolkit
|
|
|
|
{
|
|
|
|
|
2014-02-25 19:06:16 +01:00
|
|
|
|
2003-03-27 16:05:12 +00:00
|
|
|
// = UnoControlFormattedFieldModel
|
2014-02-25 19:06:16 +01:00
|
|
|
|
2017-10-20 13:44:12 +02:00
|
|
|
class UnoControlFormattedFieldModel final : public UnoControlModel
|
2003-03-27 16:05:12 +00:00
|
|
|
{
|
|
|
|
public:
|
2015-10-23 09:07:12 +02:00
|
|
|
UnoControlFormattedFieldModel( const css::uno::Reference< css::uno::XComponentContext >& rxContext );
|
2014-03-10 12:29:42 +00:00
|
|
|
UnoControlFormattedFieldModel( const UnoControlFormattedFieldModel& rModel )
|
|
|
|
: UnoControlModel(rModel)
|
|
|
|
, m_bRevokedAsClient(false)
|
|
|
|
, m_bSettingValueAndText(false)
|
|
|
|
{
|
|
|
|
}
|
2003-03-27 16:05:12 +00:00
|
|
|
|
2018-04-11 13:30:23 +02:00
|
|
|
rtl::Reference<UnoControlModel> Clone() const override { return new UnoControlFormattedFieldModel( *this ); }
|
2003-03-27 16:05:12 +00:00
|
|
|
|
2015-10-23 09:07:12 +02:00
|
|
|
// css::io::XPersistObject
|
2017-01-26 12:28:58 +01:00
|
|
|
OUString SAL_CALL getServiceName() override;
|
2003-03-27 16:05:12 +00:00
|
|
|
|
2015-10-23 09:07:12 +02:00
|
|
|
// css::beans::XMultiPropertySet
|
2017-01-26 12:28:58 +01:00
|
|
|
css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override;
|
2003-03-27 16:05:12 +00:00
|
|
|
|
|
|
|
|
2015-10-23 09:07:12 +02:00
|
|
|
// css::lang::XServiceInfo
|
2017-01-26 12:28:58 +01:00
|
|
|
OUString SAL_CALL getImplementationName() override;
|
2015-03-17 12:25:11 +01:00
|
|
|
|
2017-01-26 12:28:58 +01:00
|
|
|
css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override;
|
2007-01-15 12:40:12 +00:00
|
|
|
|
2017-10-20 13:44:12 +02:00
|
|
|
private:
|
2016-09-13 13:09:01 +02:00
|
|
|
virtual ~UnoControlFormattedFieldModel() override;
|
2007-01-15 12:40:12 +00:00
|
|
|
|
|
|
|
// XComponent
|
2017-10-20 13:44:12 +02:00
|
|
|
void SAL_CALL dispose() override;
|
2007-01-15 12:40:12 +00:00
|
|
|
|
2007-02-14 14:32:39 +00:00
|
|
|
// XPropertySet
|
2017-01-26 12:28:58 +01:00
|
|
|
void SAL_CALL setPropertyValues( const css::uno::Sequence< OUString >& PropertyNames, const css::uno::Sequence< css::uno::Any >& Values ) override;
|
2007-02-14 14:32:39 +00:00
|
|
|
|
|
|
|
// UnoControlModel
|
|
|
|
virtual void ImplNormalizePropertySequence(
|
|
|
|
const sal_Int32 _nCount, /// the number of entries in the arrays
|
|
|
|
sal_Int32* _pHandles, /// the handles of the properties to set
|
2015-10-23 09:07:12 +02:00
|
|
|
css::uno::Any* _pValues, /// the values of the properties to set
|
2007-02-14 14:32:39 +00:00
|
|
|
sal_Int32* _pValidHandles /// pointer to the valid handles, allowed to be adjusted
|
2015-10-12 16:04:04 +02:00
|
|
|
) const override;
|
2007-01-15 12:40:12 +00:00
|
|
|
void impl_updateTextFromValue_nothrow();
|
|
|
|
void impl_updateCachedFormatter_nothrow();
|
|
|
|
void impl_updateCachedFormatKey_nothrow();
|
2017-10-20 13:44:12 +02:00
|
|
|
|
|
|
|
css::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const override;
|
|
|
|
::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper() override;
|
|
|
|
sal_Bool SAL_CALL convertFastPropertyValue(
|
|
|
|
css::uno::Any& rConvertedValue,
|
|
|
|
css::uno::Any& rOldValue,
|
|
|
|
sal_Int32 nPropId,
|
|
|
|
const css::uno::Any& rValue
|
|
|
|
) override;
|
|
|
|
|
|
|
|
void SAL_CALL setFastPropertyValue_NoBroadcast(
|
|
|
|
sal_Int32 nHandle,
|
|
|
|
const css::uno::Any& rValue
|
|
|
|
) override;
|
|
|
|
|
|
|
|
css::uno::Any m_aCachedFormat;
|
|
|
|
bool m_bRevokedAsClient;
|
|
|
|
bool m_bSettingValueAndText;
|
|
|
|
css::uno::Reference< css::util::XNumberFormatter >
|
|
|
|
m_xCachedFormatter;
|
2003-03-27 16:05:12 +00:00
|
|
|
};
|
|
|
|
|
2014-02-25 19:06:16 +01:00
|
|
|
|
2003-03-27 16:05:12 +00:00
|
|
|
// = UnoFormattedFieldControl
|
2014-02-25 19:06:16 +01:00
|
|
|
|
2003-03-27 16:05:12 +00:00
|
|
|
class UnoFormattedFieldControl : public UnoSpinFieldControl
|
|
|
|
{
|
|
|
|
public:
|
2013-01-07 11:05:58 +02:00
|
|
|
UnoFormattedFieldControl();
|
2015-10-12 16:04:04 +02:00
|
|
|
OUString GetComponentServiceName() override;
|
2003-03-27 16:05:12 +00:00
|
|
|
|
2015-10-23 09:07:12 +02:00
|
|
|
// css::awt::XTextListener
|
2017-01-26 12:28:58 +01:00
|
|
|
void SAL_CALL textChanged( const css::awt::TextEvent& rEvent ) override;
|
2003-03-27 16:05:12 +00:00
|
|
|
|
2015-10-23 09:07:12 +02:00
|
|
|
// css::lang::XServiceInfo
|
2017-01-26 12:28:58 +01:00
|
|
|
OUString SAL_CALL getImplementationName() override;
|
2015-03-17 12:25:11 +01:00
|
|
|
|
2017-01-26 12:28:58 +01:00
|
|
|
css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override;
|
2003-03-27 16:05:12 +00:00
|
|
|
};
|
|
|
|
|
2014-02-25 19:06:16 +01:00
|
|
|
|
2003-03-27 16:05:12 +00:00
|
|
|
} // namespace toolkit
|
2014-02-25 19:06:16 +01:00
|
|
|
|
2003-03-27 16:05:12 +00:00
|
|
|
|
2013-10-23 19:15:52 +02:00
|
|
|
#endif // INCLUDED_TOOLKIT_CONTROLS_FORMATTEDCONTROL_HXX
|
2010-10-14 08:27:31 +02:00
|
|
|
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|