diff options
author | Henry Castro <hcastro@collabora.com> | 2020-04-22 18:22:33 -0400 |
---|---|---|
committer | Henry Castro <hcastro@collabora.com> | 2020-05-10 17:36:18 +0200 |
commit | cb3e249e4dbc851f39bd80dfc7fd076543734c6d (patch) | |
tree | 9537438c1459385acecad71429375ddb8b6069c2 /include | |
parent | d6ab59ef40b546ec62df2a7dbe389492a1159fe0 (diff) |
lok: add MetricFieldUIObject class
Add new action "VALUE" to set the value number
for metric input controls
Change-Id: I5058260c2e1562cfc6d10508d5981d185c5f2212
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92738
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Henry Castro <hcastro@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93070
Tested-by: Jenkins
Diffstat (limited to 'include')
-rw-r--r-- | include/vcl/field.hxx | 2 | ||||
-rw-r--r-- | include/vcl/toolkit/field.hxx | 1 | ||||
-rw-r--r-- | include/vcl/uitest/metricfielduiobject.hxx | 35 | ||||
-rw-r--r-- | include/vcl/uitest/uiobject.hxx | 3 |
4 files changed, 39 insertions, 2 deletions
diff --git a/include/vcl/field.hxx b/include/vcl/field.hxx index d9b76c56680d..beb3a30c356f 100644 --- a/include/vcl/field.hxx +++ b/include/vcl/field.hxx @@ -150,6 +150,8 @@ public: sal_Int64 Normalize( sal_Int64 nValue ) const; sal_Int64 Denormalize( sal_Int64 nValue ) const; + virtual void SetValueFromString(const OUString& rStr); + protected: sal_Int64 mnLastValue; sal_Int64 mnMin; diff --git a/include/vcl/toolkit/field.hxx b/include/vcl/toolkit/field.hxx index bd3e92e13dcc..76c998b22c11 100644 --- a/include/vcl/toolkit/field.hxx +++ b/include/vcl/toolkit/field.hxx @@ -101,6 +101,7 @@ public: virtual void dispose() override; virtual boost::property_tree::ptree DumpAsPropertyTree() override; + virtual FactoryFunction GetUITestFactory() const override; }; class VCL_DLLPUBLIC MetricBox : public ComboBox, public MetricFormatter diff --git a/include/vcl/uitest/metricfielduiobject.hxx b/include/vcl/uitest/metricfielduiobject.hxx new file mode 100644 index 000000000000..a23c555225a0 --- /dev/null +++ b/include/vcl/uitest/metricfielduiobject.hxx @@ -0,0 +1,35 @@ +/* -*- 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/. + */ + +#ifndef INCLUDED_VCL_UITEST_METRICFIELDUIOBJECT_HXX +#define INCLUDED_VCL_UITEST_METRICFIELDUIOBJECT_HXX + +#include <vcl/uitest/uiobject.hxx> + +class MetricField; + +class UITEST_DLLPUBLIC MetricFieldUIObject : public SpinFieldUIObject +{ + VclPtr<MetricField> mxMetricField; + +public: + MetricFieldUIObject(const VclPtr<MetricField>& xEdit); + virtual ~MetricFieldUIObject() override; + + virtual void execute(const OUString& rAction, const StringMap& rParameters) override; + + static std::unique_ptr<UIObject> create(vcl::Window* pWindow); + +protected: + virtual OUString get_name() const override; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/vcl/uitest/uiobject.hxx b/include/vcl/uitest/uiobject.hxx index 3de90891015e..2c9a3e36cc60 100644 --- a/include/vcl/uitest/uiobject.hxx +++ b/include/vcl/uitest/uiobject.hxx @@ -15,7 +15,6 @@ #include <memory> #include <vcl/window.hxx> - #include <vcl/dllapi.h> #include <set> @@ -364,7 +363,7 @@ private: virtual OUString get_name() const override; }; -class SpinFieldUIObject final : public EditUIObject +class SpinFieldUIObject : public EditUIObject { VclPtr<SpinField> mxSpinField; |