summaryrefslogtreecommitdiff
path: root/indra/llui/lltexteditor.h
diff options
context:
space:
mode:
authorDon Kjer <don@lindenlab.com>2007-12-05 23:43:56 +0000
committerDon Kjer <don@lindenlab.com>2007-12-05 23:43:56 +0000
commitfacf67ae3226105910c983a8fa8760414bf703e9 (patch)
treeb5f7cd6b79a79f769080a65b6fe2cb6b97c8b6fb /indra/llui/lltexteditor.h
parent45057e8881c3166c7c0ef545c02bc177922af6fb (diff)
EFFECTIVE MERGE: svn merge -r 71520:73420 svn+ssh://svn/svn/linden/branches/maintenance-3 into release
ACTUAL MERGE: svn merge -r 75074:75114 svn+ssh://svn/svn/linden/qa/maintenance-3-merge-75067 into release
Diffstat (limited to 'indra/llui/lltexteditor.h')
-rw-r--r--indra/llui/lltexteditor.h38
1 files changed, 31 insertions, 7 deletions
diff --git a/indra/llui/lltexteditor.h b/indra/llui/lltexteditor.h
index d38accca8f..7049de7b89 100644
--- a/indra/llui/lltexteditor.h
+++ b/indra/llui/lltexteditor.h
@@ -43,6 +43,8 @@
#include "lleditmenuhandler.h"
#include "lldarray.h"
+#include "llpreeditor.h"
+
class LLFontGL;
class LLScrollbar;
class LLViewBorder;
@@ -64,7 +66,7 @@ const S32 MAX_EMBEDDED_ITEMS = LAST_EMBEDDED_CHAR - FIRST_EMBEDDED_CHAR + 1;
class LLTextSegment;
class LLTextCmd;
-class LLTextEditor : public LLUICtrl, LLEditMenuHandler
+class LLTextEditor : public LLUICtrl, LLEditMenuHandler, protected LLPreeditor
{
friend class LLTextCmd;
public:
@@ -104,6 +106,7 @@ public:
// view overrides
virtual void reshape(S32 width, S32 height, BOOL called_from_parent);
virtual void draw();
+ virtual void onFocusReceived();
virtual void onFocusLost();
virtual void setEnabled(BOOL enabled);
@@ -234,7 +237,8 @@ public:
void setText(const LLStringExplicit &utf8str);
void setWText(const LLWString &wtext);
- S32 getMaxLength() const { return mMaxTextLength; }
+ // Returns byte length limit
+ S32 getMaxLength() const { return mMaxTextByteLength; }
// Change cursor
void startOfLine();
@@ -259,6 +263,7 @@ protected:
void drawCursor();
void drawText();
void drawClippedSegment(const LLWString &wtext, S32 seg_start, S32 seg_end, F32 x, F32 y, S32 selection_left, S32 selection_right, const LLStyle& color, F32* right_x);
+ void drawPreeditMarker();
void updateLineStartList(S32 startpos = 0);
void updateScrollFromCursor();
@@ -267,7 +272,7 @@ protected:
void pruneSegments();
void assignEmbedded(const LLString &s);
- void truncate();
+ BOOL truncate(); // Returns true if truncation occurs
static BOOL isPartOfWord(llwchar c);
@@ -291,7 +296,7 @@ protected:
BOOL handleControlKey(const KEY key, const MASK mask);
BOOL handleEditKey(const KEY key, const MASK mask);
- BOOL hasSelection() { return (mSelectionStart !=mSelectionEnd); }
+ BOOL hasSelection() const { return (mSelectionStart !=mSelectionEnd); }
BOOL selectionContainsLineBreaks();
void startSelection();
void endSelection();
@@ -300,8 +305,8 @@ protected:
S32 prevWordPos(S32 cursorPos) const;
S32 nextWordPos(S32 cursorPos) const;
- S32 getLineCount();
- S32 getLineStart( S32 line );
+ S32 getLineCount() const;
+ S32 getLineStart( S32 line ) const;
void getLineAndOffset(S32 pos, S32* linep, S32* offsetp);
S32 getPos(S32 line, S32 offset);
@@ -338,6 +343,20 @@ protected:
S32 removeStringNoUndo(S32 pos, S32 length);
S32 overwriteCharNoUndo(S32 pos, llwchar wc);
+protected:
+ void updateAllowingLanguageInput();
+ BOOL hasPreeditString() const;
+
+ // Overrides LLPreeditor
+ virtual void resetPreedit();
+ virtual void updatePreedit(const LLWString &preedit_string,
+ const segment_lengths_t &preedit_segment_lengths, const standouts_t &preedit_standouts, S32 caret_position);
+ virtual void markAsPreedit(S32 position, S32 length);
+ virtual void getPreeditRange(S32 *position, S32 *length) const;
+ virtual void getSelectionRange(S32 *position, S32 *length) const;
+ virtual BOOL getPreeditLocation(S32 query_offset, LLCoordGL *coord, LLRect *bounds, LLRect *control) const;
+ virtual S32 getPreeditFontSize() const;
+
public:
LLKeywords mKeywords;
static LLColor4 mLinkColor;
@@ -349,7 +368,7 @@ protected:
mutable LLString mUTF8Text;
mutable BOOL mTextIsUpToDate;
- S32 mMaxTextLength; // Maximum length mText is allowed to be
+ S32 mMaxTextByteLength; // Maximum length mText is allowed to be in bytes
const LLFontGL* mGLFont;
@@ -439,6 +458,11 @@ protected:
BOOL mParseHTML;
LLString mHTML;
+
+ LLWString mPreeditWString;
+ LLWString mPreeditOverwrittenWString;
+ std::vector<S32> mPreeditPositions;
+ std::vector<BOOL> mPreeditStandouts;
};
class LLTextSegment