diff options
author | Caolán McNamara <caolanm@redhat.com> | 2020-02-17 15:07:34 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2020-02-18 09:54:06 +0100 |
commit | 2c484d1f383970672f3062d84201109a064c5a36 (patch) | |
tree | b27cb7370f96072d1dcc80965e4e63d222c625e4 /include/toolkit/awt | |
parent | ada37301a5c133e913cebde3fcddaee947d3dafb (diff) |
move SVTXFormattedField, SVTXCurrencyField, SVTXNumericField to toolkit
Change-Id: If22200a4f342d4d779c612dbace61a4cf99471ab
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88866
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'include/toolkit/awt')
-rw-r--r-- | include/toolkit/awt/vclxwindows.hxx | 125 |
1 files changed, 125 insertions, 0 deletions
diff --git a/include/toolkit/awt/vclxwindows.hxx b/include/toolkit/awt/vclxwindows.hxx index e470b5e3a46e..dd03843c4908 100644 --- a/include/toolkit/awt/vclxwindows.hxx +++ b/include/toolkit/awt/vclxwindows.hxx @@ -51,10 +51,13 @@ #include <cppuhelper/implbase.hxx> #include <cppuhelper/weak.hxx> +#include <svl/numuno.hxx> + #include <toolkit/awt/vclxwindow.hxx> #include <toolkit/awt/vclxtopwindow.hxx> #include <toolkit/helper/listenermultiplexer.hxx> +#include <vcl/fmtfield.hxx> #include <vcl/image.hxx> class FormatterBase; @@ -1276,6 +1279,128 @@ public: virtual void GetPropertyIds( std::vector< sal_uInt16 > &aIds ) override { return ImplGetPropertyIds( aIds ); } }; +class SVTXFormattedField : public VCLXSpinField +{ +protected: + rtl::Reference<SvNumberFormatsSupplierObj> m_xCurrentSupplier; + bool bIsStandardSupplier; + + sal_Int32 nKeyToSetDelayed; + +public: + SVTXFormattedField(); + virtual ~SVTXFormattedField() override; + + // css::awt::XVclWindowPeer + void SAL_CALL setProperty( const OUString& PropertyName, const css::uno::Any& Value ) override; + css::uno::Any SAL_CALL getProperty( const OUString& PropertyName ) override; + +protected: + void setFormatsSupplier(const css::uno::Reference< css::util::XNumberFormatsSupplier > & xSupplier); + sal_Int32 getFormatKey() const; + void setFormatKey(sal_Int32 nKey); + + void SetValue(const css::uno::Any& rValue); + css::uno::Any GetValue() const; + + void SetTreatAsNumber(bool bSet); + bool GetTreatAsNumber() const; + + void SetDefaultValue(const css::uno::Any& rValue); + css::uno::Any GetDefaultValue() const; + + void SetMinValue(const css::uno::Any& rValue); + css::uno::Any GetMinValue() const; + + void SetMaxValue(const css::uno::Any& rValue); + css::uno::Any GetMaxValue() const; + + void NotifyTextListeners(); + css::uno::Any convertEffectiveValue(const css::uno::Any& rValue); + + virtual void SetWindow( const VclPtr< vcl::Window > &_pWindow) override; + + static void ImplGetPropertyIds( std::vector< sal_uInt16 > &aIds ); + virtual void GetPropertyIds( std::vector< sal_uInt16 > &aIds ) override { return ImplGetPropertyIds( aIds ); } +}; + +class SVTXCurrencyField : public css::awt::XCurrencyField, public SVTXFormattedField +{ +public: + SVTXCurrencyField(); + virtual ~SVTXCurrencyField() override; + + // css::uno::XInterface + css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override; + void SAL_CALL acquire() throw() override { SVTXFormattedField::acquire(); } + void SAL_CALL release() throw() override { SVTXFormattedField::release(); } + + // css::lang::XTypeProvider + css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override; + css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override; + + // css::awt::XVclWindowPeer + void SAL_CALL setProperty( const OUString& PropertyName, const css::uno::Any& Value ) override; + css::uno::Any SAL_CALL getProperty( const OUString& PropertyName ) override; + + // css::awt::XCurrencyField + void SAL_CALL setValue( double Value ) override; + double SAL_CALL getValue( ) override; + void SAL_CALL setMin( double Value ) override; + double SAL_CALL getMin( ) override; + void SAL_CALL setMax( double Value ) override; + double SAL_CALL getMax( ) override; + void SAL_CALL setFirst( double Value ) override; + double SAL_CALL getFirst( ) override; + void SAL_CALL setLast( double Value ) override; + double SAL_CALL getLast( ) override; + void SAL_CALL setSpinSize( double Value ) override; + double SAL_CALL getSpinSize( ) override; + void SAL_CALL setDecimalDigits( sal_Int16 nDigits ) override; + sal_Int16 SAL_CALL getDecimalDigits( ) override; + void SAL_CALL setStrictFormat( sal_Bool bStrict ) override; + sal_Bool SAL_CALL isStrictFormat( ) override; + + static void ImplGetPropertyIds( std::vector< sal_uInt16 > &aIds ); + virtual void GetPropertyIds( std::vector< sal_uInt16 > &aIds ) override { return ImplGetPropertyIds( aIds ); } +}; + +class SVTXNumericField : public css::awt::XNumericField, public SVTXFormattedField +{ +public: + SVTXNumericField(); + virtual ~SVTXNumericField() override; + + // css::uno::XInterface + css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override; + void SAL_CALL acquire() throw() override { SVTXFormattedField::acquire(); } + void SAL_CALL release() throw() override { SVTXFormattedField::release(); } + + // css::lang::XTypeProvider + css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override; + css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override; + + // css::awt::XNumericField + void SAL_CALL setValue( double Value ) override; + double SAL_CALL getValue( ) override; + void SAL_CALL setMin( double Value ) override; + double SAL_CALL getMin( ) override; + void SAL_CALL setMax( double Value ) override; + double SAL_CALL getMax( ) override; + void SAL_CALL setFirst( double Value ) override; + double SAL_CALL getFirst( ) override; + void SAL_CALL setLast( double Value ) override; + double SAL_CALL getLast( ) override; + void SAL_CALL setSpinSize( double Value ) override; + double SAL_CALL getSpinSize( ) override; + void SAL_CALL setDecimalDigits( sal_Int16 nDigits ) override; + sal_Int16 SAL_CALL getDecimalDigits( ) override; + void SAL_CALL setStrictFormat( sal_Bool bStrict ) override; + sal_Bool SAL_CALL isStrictFormat( ) override; + + virtual void GetPropertyIds( std::vector< sal_uInt16 > &aIds ) override; +}; + #endif // INCLUDED_TOOLKIT_AWT_VCLXWINDOWS_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |