summaryrefslogtreecommitdiff
path: root/include/vcl/toolkit
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-07-21 20:22:13 +0100
committerCaolán McNamara <caolanm@redhat.com>2020-07-22 12:24:46 +0200
commitc213e05d04f100199052ba7c781823101e3f8aa6 (patch)
treefb823c71f227b23d37fb9223f7b753f9486865c7 /include/vcl/toolkit
parent9ebe58f0437bbb5714e629bd22e004ac895086d6 (diff)
move PatternField to toolkit headers
Change-Id: Ib75cefc6ca6a289113bac2903eb807f5d43ff3df Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99175 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'include/vcl/toolkit')
-rw-r--r--include/vcl/toolkit/field.hxx40
1 files changed, 40 insertions, 0 deletions
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: