summaryrefslogtreecommitdiff
path: root/indra/llui/lllineeditor.h
diff options
context:
space:
mode:
authorOz Linden <oz@lindenlab.com>2012-05-31 14:26:15 -0400
committerOz Linden <oz@lindenlab.com>2012-05-31 14:26:15 -0400
commit925db41711bc319e870aa35f74b58f4e7a74420c (patch)
tree69bac61403e5e432c073fb3e7ea29b6c3107a142 /indra/llui/lllineeditor.h
parentf09bd7669fcf976edf82c3ce70b26ea044019c67 (diff)
parent5cad51594dc583c63bf88376feedb0b170868d3d (diff)
merge changes for storm-276
Diffstat (limited to 'indra/llui/lllineeditor.h')
-rw-r--r--indra/llui/lllineeditor.h30
1 files changed, 29 insertions, 1 deletions
diff --git a/indra/llui/lllineeditor.h b/indra/llui/lllineeditor.h
index cd4be17f37..71dd53f608 100644
--- a/indra/llui/lllineeditor.h
+++ b/indra/llui/lllineeditor.h
@@ -40,6 +40,7 @@
#include "llframetimer.h"
#include "lleditmenuhandler.h"
+#include "llspellcheckmenuhandler.h"
#include "lluictrl.h"
#include "lluiimage.h"
#include "lluistring.h"
@@ -54,7 +55,7 @@ class LLButton;
class LLContextMenu;
class LLLineEditor
-: public LLUICtrl, public LLEditMenuHandler, protected LLPreeditor
+: public LLUICtrl, public LLEditMenuHandler, protected LLPreeditor, public LLSpellCheckMenuHandler
{
public:
@@ -86,6 +87,7 @@ public:
Optional<bool> select_on_focus,
revert_on_esc,
+ spellcheck,
commit_on_focus_lost,
ignore_tab,
is_password;
@@ -146,6 +148,24 @@ public:
virtual void deselect();
virtual BOOL canDeselect() const;
+ // LLSpellCheckMenuHandler overrides
+ /*virtual*/ bool getSpellCheck() const;
+
+ /*virtual*/ const std::string& getSuggestion(U32 index) const;
+ /*virtual*/ U32 getSuggestionCount() const;
+ /*virtual*/ void replaceWithSuggestion(U32 index);
+
+ /*virtual*/ void addToDictionary();
+ /*virtual*/ bool canAddToDictionary() const;
+
+ /*virtual*/ void addToIgnore();
+ /*virtual*/ bool canAddToIgnore() const;
+
+ // Spell checking helper functions
+ std::string getMisspelledWord(U32 pos) const;
+ bool isMisspelledWord(U32 pos) const;
+ void onSpellCheckSettingsChange();
+
// view overrides
virtual void draw();
virtual void reshape(S32 width,S32 height,BOOL called_from_parent=TRUE);
@@ -226,6 +246,7 @@ public:
void setSelectAllonFocusReceived(BOOL b);
void setSelectAllonCommit(BOOL b) { mSelectAllonCommit = b; }
+ void onKeystroke();
typedef boost::function<void (LLLineEditor* caller, void* user_data)> callback_t;
void setKeystrokeCallback(callback_t callback, void* user_data);
@@ -325,6 +346,13 @@ protected:
S32 mLastSelectionStart;
S32 mLastSelectionEnd;
+ bool mSpellCheck;
+ S32 mSpellCheckStart;
+ S32 mSpellCheckEnd;
+ LLTimer mSpellCheckTimer;
+ std::list<std::pair<U32, U32> > mMisspellRanges;
+ std::vector<std::string> mSuggestionList;
+
LLTextValidate::validate_func_t mPrevalidateFunc;
LLTextValidate::validate_func_t mPrevalidateInputFunc;