diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-06-16 15:08:31 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-06-16 16:59:09 +0100 |
commit | fc2a0de9368db335f03461d76491d7fd733697e8 (patch) | |
tree | 9ee0c0304f90805afc5f281bb3b1a2cf4d68b88d /include | |
parent | 4e4a350dff08ef1393cd87d48e095e18bf423821 (diff) |
turn the no-space edit widgets into a editwidget feature
especially because most of them don't handle intercepting text getting *pasted*
into them right, so start with the one which does that right.
Change-Id: If6770798872ed3c72c469656ebf0d4fd76d2171d
Diffstat (limited to 'include')
-rw-r--r-- | include/vcl/edit.hxx | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/include/vcl/edit.hxx b/include/vcl/edit.hxx index e0d968950b6c..391e825437c0 100644 --- a/include/vcl/edit.hxx +++ b/include/vcl/edit.hxx @@ -41,24 +41,34 @@ struct Impl_IMEInfos; // - Edit-Types - - - #define EDIT_NOLIMIT SAL_MAX_INT32 #define EDIT_UPDATEDATA_TIMEOUT 350 typedef OUString (*FncGetSpecialChars)( Window* pWin, const Font& rFont ); +class VCL_DLLPUBLIC TextFilter +{ +private: + OUString sForbiddenChars; +public: + void SetForbiddenChars(const OUString& rSet) { sForbiddenChars = rSet; } + const OUString& GetForbiddenChars() { return sForbiddenChars; } -// - Edit - + virtual OUString filter(const OUString &rText); + TextFilter(const OUString &rForbiddenChars = OUString(" ")); + virtual ~TextFilter(); +}; enum AutocompleteAction{ AUTOCOMPLETE_KEYINPUT, AUTOCOMPLETE_TABFORWARD, AUTOCOMPLETE_TABBACKWARD }; +// - Edit - class VCL_DLLPUBLIC Edit : public Control, public vcl::unohelper::DragAndDropClient { private: Edit* mpSubEdit; Timer* mpUpdateDataTimer; + TextFilter* mpFilterText; DDInfo* mpDDInfo; Impl_IMEInfos* mpIMEInfos; OUStringBuffer maText; @@ -116,6 +126,7 @@ private: SAL_DLLPRIVATE long ImplGetTextYPosition() const; SAL_DLLPRIVATE ::com::sun::star::uno::Reference < ::com::sun::star::i18n::XExtendedInputSequenceChecker > ImplGetInputSequenceChecker(); SAL_DLLPRIVATE ::com::sun::star::uno::Reference < ::com::sun::star::i18n::XBreakIterator > ImplGetBreakIterator() const; + SAL_DLLPRIVATE void filterText(); protected: using Control::ImplInitSettings; @@ -252,6 +263,8 @@ public: virtual Selection GetSurroundingTextSelection() const SAL_OVERRIDE; virtual bool set_property(const OString &rKey, const OString &rValue) SAL_OVERRIDE; + void SetTextFilter(TextFilter* pFilter) { mpFilterText = pFilter; } + // returns the minimum size a bordered Edit should have given the current // global style settings (needed by sc's inputwin.cxx) static Size GetMinimumEditSize(); |