From c213e05d04f100199052ba7c781823101e3f8aa6 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Tue, 21 Jul 2020 20:22:13 +0100 Subject: move PatternField to toolkit headers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ib75cefc6ca6a289113bac2903eb807f5d43ff3df Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99175 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- include/vcl/toolkit/field.hxx | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) (limited to 'include/vcl/toolkit') diff --git a/include/vcl/toolkit/field.hxx b/include/vcl/toolkit/field.hxx index 6316c5698933..8b869033b32e 100644 --- a/include/vcl/toolkit/field.hxx +++ b/include/vcl/toolkit/field.hxx @@ -390,6 +390,46 @@ public: virtual void dispose() override; }; +#define PATTERN_FORMAT_EMPTYLITERALS (sal_uInt16(0x0001)) + +class UNLESS_MERGELIBS(VCL_DLLPUBLIC) PatternFormatter : public FormatterBase +{ +private: + OString m_aEditMask; + OUString maLiteralMask; + bool mbSameMask; + bool mbInPattKeyInput; + +protected: + PatternFormatter(Edit* pEdit); + + SAL_DLLPRIVATE bool ImplIsSameMask() const { return mbSameMask; } + SAL_DLLPRIVATE bool& ImplGetInPattKeyInput() { return mbInPattKeyInput; } + +public: + virtual ~PatternFormatter() override; + + virtual void Reformat() override; + + void SetMask(const OString& rEditMask, const OUString& rLiteralMask ); + const OString& GetEditMask() const { return m_aEditMask; } + const OUString& GetLiteralMask() const { return maLiteralMask; } + + void SetString( const OUString& rStr ); + OUString GetString() const; +}; + +class UNLESS_MERGELIBS(VCL_DLLPUBLIC) PatternField final : public SpinField, public PatternFormatter +{ +public: + explicit PatternField( vcl::Window* pParent, WinBits nWinStyle ); + + virtual bool PreNotify( NotifyEvent& rNEvt ) override; + virtual bool EventNotify( NotifyEvent& rNEvt ) override; + virtual void Modify() override; + virtual void dispose() override; +}; + class UNLESS_MERGELIBS(VCL_DLLPUBLIC) PatternBox final : public ComboBox, public PatternFormatter { public: -- cgit