diff options
author | Caolán McNamara <caolanm@redhat.com> | 2020-01-27 20:22:05 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2020-01-28 13:50:42 +0100 |
commit | f9eecb48bf675e77d15a9d926d1dd47f22835d67 (patch) | |
tree | fd57c767122b135c9710c5018d41878dc0e88bfa | |
parent | be9c6deb43175149e75f4cf57d6b74234aa95d7f (diff) |
move private TimeBox to toolkit-only headers
move private DateBox to toolkit-only headers
move private CurrencyBox to toolkit-only headers
move private PatternBox to toolkit-only headers
move private CurrencyField to toolkit-only headers
move private CurrencyFormatter to toolkit-only headers
Change-Id: If5ba9e07b20cdc69ca554af388ec9d9e362cbf9a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87555
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | include/vcl/field.hxx | 105 | ||||
-rw-r--r-- | include/vcl/toolkit/field.hxx | 125 | ||||
-rw-r--r-- | solenv/clang-format/blacklist | 1 | ||||
-rw-r--r-- | toolkit/source/awt/vclxtoolkit.cxx | 2 | ||||
-rw-r--r-- | toolkit/source/awt/vclxwindows.cxx | 2 | ||||
-rw-r--r-- | vcl/source/control/field.cxx | 2 | ||||
-rw-r--r-- | vcl/source/control/field2.cxx | 2 | ||||
-rw-r--r-- | vcl/source/window/builder.cxx | 2 |
8 files changed, 131 insertions, 110 deletions
diff --git a/include/vcl/field.hxx b/include/vcl/field.hxx index 4e0b0a04d9ff..81fd9e5b8023 100644 --- a/include/vcl/field.hxx +++ b/include/vcl/field.hxx @@ -236,24 +236,6 @@ private: OUString maCustomUnitText; }; - -class VCL_DLLPUBLIC CurrencyFormatter : public NumericFormatter -{ -protected: - CurrencyFormatter(Edit* pEdit); - SAL_DLLPRIVATE void ImplCurrencyReformat( const OUString& rStr, OUString& rOutStr ); - virtual sal_Int64 GetValueFromString(const OUString& rStr) const override; - -public: - virtual ~CurrencyFormatter() override; - - virtual void Reformat() override; - - virtual void SetValue( sal_Int64 nNewValue ) override; - virtual OUString CreateFieldText( sal_Int64 nValue ) const override; -}; - - class VCL_DLLPUBLIC DateFormatter : public FormatterBase { private: @@ -331,7 +313,6 @@ public: bool IsEnforceValidValue( ) const { return mbEnforceValidValue; } }; - class VCL_DLLPUBLIC TimeFormatter : public FormatterBase { private: @@ -499,26 +480,6 @@ public: virtual boost::property_tree::ptree DumpAsPropertyTree() override; }; - -class VCL_DLLPUBLIC CurrencyField final : public SpinField, public CurrencyFormatter -{ -public: - CurrencyField( vcl::Window* pParent, WinBits nWinStyle ); - - virtual bool PreNotify( NotifyEvent& rNEvt ) override; - virtual bool EventNotify( NotifyEvent& rNEvt ) override; - virtual void DataChanged( const DataChangedEvent& rDCEvt ) override; - - virtual void Modify() override; - - virtual void Up() override; - virtual void Down() override; - virtual void First() override; - virtual void Last() override; - virtual void dispose() override; -}; - - class VCL_DLLPUBLIC DateField : public SpinField, public DateFormatter { private: @@ -549,7 +510,6 @@ public: virtual void dispose() override; }; - class VCL_DLLPUBLIC TimeField final : public SpinField, public TimeFormatter { private: @@ -581,22 +541,6 @@ public: virtual void dispose() override; }; - -class VCL_DLLPUBLIC PatternBox final : public ComboBox, public PatternFormatter -{ -public: - PatternBox( vcl::Window* pParent, WinBits nWinStyle ); - - virtual bool PreNotify( NotifyEvent& rNEvt ) override; - virtual bool EventNotify( NotifyEvent& rNEvt ) override; - - virtual void Modify() override; - - virtual void ReformatAll() override; - virtual void dispose() override; -}; - - class VCL_DLLPUBLIC NumericBox : public ComboBox, public NumericFormatter { SAL_DLLPRIVATE void ImplNumericReformat( const OUString& rStr, sal_Int64& rValue, OUString& rOutStr ); @@ -642,55 +586,6 @@ public: virtual void dispose() override; }; - -class VCL_DLLPUBLIC CurrencyBox final : public ComboBox, public CurrencyFormatter -{ -public: - explicit CurrencyBox( vcl::Window* pParent, WinBits nWinStyle ); - - virtual bool PreNotify( NotifyEvent& rNEvt ) override; - virtual bool EventNotify( NotifyEvent& rNEvt ) override; - virtual void DataChanged( const DataChangedEvent& rDCEvt ) override; - - virtual void Modify() override; - - virtual void ReformatAll() override; - - virtual void dispose() override; -}; - - -class VCL_DLLPUBLIC DateBox final : public ComboBox, public DateFormatter -{ -public: - explicit DateBox( vcl::Window* pParent, WinBits nWinStyle ); - - virtual bool PreNotify( NotifyEvent& rNEvt ) override; - virtual bool EventNotify( NotifyEvent& rNEvt ) override; - virtual void DataChanged( const DataChangedEvent& rDCEvt ) override; - - virtual void Modify() override; - - virtual void ReformatAll() override; - virtual void dispose() override; -}; - - -class VCL_DLLPUBLIC TimeBox final : public ComboBox, public TimeFormatter -{ -public: - explicit TimeBox( vcl::Window* pParent, WinBits nWinStyle ); - - virtual bool PreNotify( NotifyEvent& rNEvt ) override; - virtual bool EventNotify( NotifyEvent& rNEvt ) override; - virtual void DataChanged( const DataChangedEvent& rDCEvt ) override; - - virtual void Modify() override; - - virtual void ReformatAll() override; - virtual void dispose() override; -}; - #endif // INCLUDED_VCL_FIELD_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/vcl/toolkit/field.hxx b/include/vcl/toolkit/field.hxx new file mode 100644 index 000000000000..d5f466199653 --- /dev/null +++ b/include/vcl/toolkit/field.hxx @@ -0,0 +1,125 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * 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 . + */ + +#ifndef INCLUDED_VCL_TOOLKIT_FIELD_HXX +#define INCLUDED_VCL_TOOLKIT_FIELD_HXX + +#if !defined(VCL_DLLIMPLEMENTATION) && !defined(TOOLKIT_DLLIMPLEMENTATION) +#error "don't use this in new code" +#endif + +#include <vcl/field.hxx> + +class VCL_DLLPUBLIC CurrencyFormatter : public NumericFormatter +{ +protected: + CurrencyFormatter(Edit* pEdit); + SAL_DLLPRIVATE void ImplCurrencyReformat( const OUString& rStr, OUString& rOutStr ); + virtual sal_Int64 GetValueFromString(const OUString& rStr) const override; + +public: + virtual ~CurrencyFormatter() override; + + virtual void Reformat() override; + + virtual void SetValue( sal_Int64 nNewValue ) override; + virtual OUString CreateFieldText( sal_Int64 nValue ) const override; +}; + +class VCL_DLLPUBLIC CurrencyField final : public SpinField, public CurrencyFormatter +{ +public: + CurrencyField( vcl::Window* pParent, WinBits nWinStyle ); + + virtual bool PreNotify( NotifyEvent& rNEvt ) override; + virtual bool EventNotify( NotifyEvent& rNEvt ) override; + virtual void DataChanged( const DataChangedEvent& rDCEvt ) override; + + virtual void Modify() override; + + virtual void Up() override; + virtual void Down() override; + virtual void First() override; + virtual void Last() override; + virtual void dispose() override; +}; + +class VCL_DLLPUBLIC PatternBox final : public ComboBox, public PatternFormatter +{ +public: + PatternBox( vcl::Window* pParent, WinBits nWinStyle ); + + virtual bool PreNotify( NotifyEvent& rNEvt ) override; + virtual bool EventNotify( NotifyEvent& rNEvt ) override; + + virtual void Modify() override; + + virtual void ReformatAll() override; + virtual void dispose() override; +}; + +class VCL_DLLPUBLIC CurrencyBox final : public ComboBox, public CurrencyFormatter +{ +public: + explicit CurrencyBox( vcl::Window* pParent, WinBits nWinStyle ); + + virtual bool PreNotify( NotifyEvent& rNEvt ) override; + virtual bool EventNotify( NotifyEvent& rNEvt ) override; + virtual void DataChanged( const DataChangedEvent& rDCEvt ) override; + + virtual void Modify() override; + + virtual void ReformatAll() override; + + virtual void dispose() override; +}; + +class VCL_DLLPUBLIC DateBox final : public ComboBox, public DateFormatter +{ +public: + explicit DateBox( vcl::Window* pParent, WinBits nWinStyle ); + + virtual bool PreNotify( NotifyEvent& rNEvt ) override; + virtual bool EventNotify( NotifyEvent& rNEvt ) override; + virtual void DataChanged( const DataChangedEvent& rDCEvt ) override; + + virtual void Modify() override; + + virtual void ReformatAll() override; + virtual void dispose() override; +}; + +class VCL_DLLPUBLIC TimeBox final : public ComboBox, public TimeFormatter +{ +public: + explicit TimeBox( vcl::Window* pParent, WinBits nWinStyle ); + + virtual bool PreNotify( NotifyEvent& rNEvt ) override; + virtual bool EventNotify( NotifyEvent& rNEvt ) override; + virtual void DataChanged( const DataChangedEvent& rDCEvt ) override; + + virtual void Modify() override; + + virtual void ReformatAll() override; + virtual void dispose() override; +}; + +#endif // INCLUDED_VCL_FIELD_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/solenv/clang-format/blacklist b/solenv/clang-format/blacklist index 050b7ad51a56..6823ec4187a5 100644 --- a/solenv/clang-format/blacklist +++ b/solenv/clang-format/blacklist @@ -7876,6 +7876,7 @@ include/vcl/textview.hxx include/vcl/threadex.hxx include/vcl/timer.hxx include/vcl/toolbox.hxx +include/vcl/toolkit/field.hxx include/vcl/toolkit/fixedhyper.hxx include/vcl/toolkit/group.hxx include/vcl/toolkit/imgctrl.hxx diff --git a/toolkit/source/awt/vclxtoolkit.cxx b/toolkit/source/awt/vclxtoolkit.cxx index de6ab2c55659..76a8e497abbc 100644 --- a/toolkit/source/awt/vclxtoolkit.cxx +++ b/toolkit/source/awt/vclxtoolkit.cxx @@ -86,7 +86,7 @@ #include <vcl/dockwin.hxx> #include <vcl/edit.hxx> #include <vcl/event.hxx> -#include <vcl/field.hxx> +#include <vcl/toolkit/field.hxx> #include <vcl/fixed.hxx> #include <vcl/toolkit/fixedhyper.hxx> #include <vcl/floatwin.hxx> diff --git a/toolkit/source/awt/vclxwindows.cxx b/toolkit/source/awt/vclxwindows.cxx index 4b2aaf8cde90..5789fe5ebf80 100644 --- a/toolkit/source/awt/vclxwindows.cxx +++ b/toolkit/source/awt/vclxwindows.cxx @@ -44,7 +44,7 @@ #include <vcl/graph.hxx> #include <vcl/lstbox.hxx> #include <vcl/combobox.hxx> -#include <vcl/field.hxx> +#include <vcl/toolkit/field.hxx> #include <vcl/toolkit/fixedhyper.hxx> #include <vcl/longcurr.hxx> #include <vcl/toolkit/imgctrl.hxx> diff --git a/vcl/source/control/field.cxx b/vcl/source/control/field.cxx index 86a9a38b8887..da2218a684e4 100644 --- a/vcl/source/control/field.cxx +++ b/vcl/source/control/field.cxx @@ -27,7 +27,7 @@ #include <comphelper/string.hxx> #include <vcl/builder.hxx> -#include <vcl/field.hxx> +#include <vcl/toolkit/field.hxx> #include <vcl/event.hxx> #include <vcl/svapp.hxx> #include <vcl/settings.hxx> diff --git a/vcl/source/control/field2.cxx b/vcl/source/control/field2.cxx index 347dbc05f6bd..8b706b513f41 100644 --- a/vcl/source/control/field2.cxx +++ b/vcl/source/control/field2.cxx @@ -27,7 +27,7 @@ #include <comphelper/string.hxx> #include <vcl/svapp.hxx> #include <vcl/event.hxx> -#include <vcl/field.hxx> +#include <vcl/toolkit/field.hxx> #include <vcl/unohelp.hxx> #include <vcl/settings.hxx> diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx index ecf3d135d811..3e9c2add65a8 100644 --- a/vcl/source/window/builder.cxx +++ b/vcl/source/window/builder.cxx @@ -25,7 +25,7 @@ #include <vcl/calendar.hxx> #include <vcl/dialog.hxx> #include <vcl/edit.hxx> -#include <vcl/field.hxx> +#include <vcl/toolkit/field.hxx> #include <vcl/fmtfield.hxx> #include <vcl/fixed.hxx> #include <vcl/toolkit/fixedhyper.hxx> |