2007-10-24 00:44:17 +04:00
|
|
|
/*
|
2009-08-27 15:12:41 +04:00
|
|
|
* Copyright 2007-2009, Haiku, Inc. All rights reserved.
|
|
|
|
* Distributed under the terms of the MIT License.
|
2007-10-24 00:44:17 +04:00
|
|
|
*/
|
2002-10-23 17:54:44 +04:00
|
|
|
#ifndef _TEXTVIEW_H
|
|
|
|
#define _TEXTVIEW_H
|
|
|
|
|
2007-10-24 00:44:17 +04:00
|
|
|
|
2008-09-20 19:08:40 +04:00
|
|
|
#include <Locker.h>
|
2002-10-23 17:54:44 +04:00
|
|
|
#include <View.h>
|
|
|
|
|
2008-09-20 19:08:40 +04:00
|
|
|
|
2007-10-24 00:44:17 +04:00
|
|
|
class BBitmap;
|
|
|
|
class BClipboard;
|
|
|
|
class BFile;
|
|
|
|
class BList;
|
2008-09-20 19:08:40 +04:00
|
|
|
class BMessageRunner;
|
2007-10-24 00:44:17 +04:00
|
|
|
|
2002-10-23 17:54:44 +04:00
|
|
|
struct text_run {
|
2007-10-24 00:44:17 +04:00
|
|
|
int32 offset;
|
|
|
|
BFont font;
|
|
|
|
rgb_color color;
|
2002-10-23 17:54:44 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
struct text_run_array {
|
2007-10-24 00:44:17 +04:00
|
|
|
int32 count;
|
|
|
|
text_run runs[1];
|
2002-10-23 17:54:44 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
enum undo_state {
|
|
|
|
B_UNDO_UNAVAILABLE,
|
|
|
|
B_UNDO_TYPING,
|
|
|
|
B_UNDO_CUT,
|
|
|
|
B_UNDO_PASTE,
|
|
|
|
B_UNDO_CLEAR,
|
|
|
|
B_UNDO_DROP
|
|
|
|
};
|
|
|
|
|
2008-09-21 22:03:17 +04:00
|
|
|
namespace BPrivate {
|
2008-09-22 00:47:16 +04:00
|
|
|
class TextGapBuffer;
|
2009-08-27 15:12:41 +04:00
|
|
|
}
|
|
|
|
|
2008-09-20 19:08:40 +04:00
|
|
|
|
2007-10-24 00:44:17 +04:00
|
|
|
class BTextView : public BView {
|
2008-09-20 14:09:32 +04:00
|
|
|
public:
|
|
|
|
BTextView(BRect frame, const char* name,
|
|
|
|
BRect textRect, uint32 resizeMask,
|
|
|
|
uint32 flags
|
|
|
|
= B_WILL_DRAW | B_PULSE_NEEDED);
|
|
|
|
BTextView(BRect frame, const char* name,
|
|
|
|
BRect textRect, const BFont* initialFont,
|
|
|
|
const rgb_color* initialColor,
|
|
|
|
uint32 resizeMask, uint32 flags);
|
2008-09-20 19:08:40 +04:00
|
|
|
|
|
|
|
BTextView(const char* name,
|
|
|
|
uint32 flags
|
|
|
|
= B_WILL_DRAW | B_PULSE_NEEDED);
|
|
|
|
BTextView(const char* name,
|
|
|
|
const BFont* initialFont,
|
|
|
|
const rgb_color* initialColor,
|
|
|
|
uint32 flags);
|
|
|
|
|
2009-08-27 15:12:41 +04:00
|
|
|
BTextView(BMessage* archive);
|
2008-09-20 14:09:32 +04:00
|
|
|
|
|
|
|
virtual ~BTextView();
|
|
|
|
|
2009-08-27 15:12:41 +04:00
|
|
|
static BArchivable* Instantiate(BMessage* archive);
|
|
|
|
virtual status_t Archive(BMessage* archive,
|
|
|
|
bool deep = true) const;
|
2008-09-20 14:09:32 +04:00
|
|
|
|
|
|
|
virtual void AttachedToWindow();
|
|
|
|
virtual void DetachedFromWindow();
|
|
|
|
virtual void Draw(BRect updateRect);
|
|
|
|
virtual void MouseDown(BPoint where);
|
|
|
|
virtual void MouseUp(BPoint where);
|
|
|
|
virtual void MouseMoved(BPoint where, uint32 code,
|
|
|
|
const BMessage* dragMessage);
|
|
|
|
virtual void WindowActivated(bool state);
|
|
|
|
virtual void KeyDown(const char* bytes, int32 numBytes);
|
|
|
|
virtual void Pulse();
|
|
|
|
virtual void FrameResized(float width, float height);
|
|
|
|
virtual void MakeFocus(bool focusState = true);
|
|
|
|
virtual void MessageReceived(BMessage* message);
|
|
|
|
|
2009-08-27 15:12:41 +04:00
|
|
|
virtual BHandler* ResolveSpecifier(BMessage* message,
|
|
|
|
int32 index, BMessage* specifier,
|
|
|
|
int32 form, const char* property);
|
2008-09-20 14:09:32 +04:00
|
|
|
virtual status_t GetSupportedSuites(BMessage* data);
|
|
|
|
|
2013-03-17 01:05:09 +04:00
|
|
|
void SetText(const char* text,
|
|
|
|
const text_run_array* runs = NULL);
|
|
|
|
void SetText(const char* text, int32 length,
|
|
|
|
const text_run_array* runs = NULL);
|
|
|
|
void SetText(BFile* file, int32 offset,
|
|
|
|
int32 length,
|
|
|
|
const text_run_array* runs = NULL);
|
|
|
|
|
|
|
|
void Insert(const char* text,
|
|
|
|
const text_run_array* runs = NULL);
|
|
|
|
void Insert(const char* text, int32 length,
|
|
|
|
const text_run_array* runs = NULL);
|
|
|
|
void Insert(int32 offset, const char* text,
|
|
|
|
int32 length,
|
|
|
|
const text_run_array* runs = NULL);
|
2008-09-20 14:09:32 +04:00
|
|
|
|
|
|
|
void Delete();
|
|
|
|
void Delete(int32 startOffset, int32 endOffset);
|
|
|
|
|
|
|
|
const char* Text() const;
|
|
|
|
int32 TextLength() const;
|
|
|
|
void GetText(int32 offset, int32 length,
|
|
|
|
char* buffer) const;
|
|
|
|
uint8 ByteAt(int32 offset) const;
|
|
|
|
|
|
|
|
int32 CountLines() const;
|
|
|
|
int32 CurrentLine() const;
|
|
|
|
void GoToLine(int32 lineIndex);
|
|
|
|
|
|
|
|
virtual void Cut(BClipboard* clipboard);
|
|
|
|
virtual void Copy(BClipboard* clipboard);
|
|
|
|
virtual void Paste(BClipboard* clipboard);
|
|
|
|
void Clear();
|
|
|
|
|
|
|
|
virtual bool AcceptsPaste(BClipboard* clipboard);
|
2013-03-17 01:05:09 +04:00
|
|
|
virtual bool AcceptsDrop(const BMessage* message);
|
2008-09-20 14:09:32 +04:00
|
|
|
|
|
|
|
virtual void Select(int32 startOffset, int32 endOffset);
|
|
|
|
void SelectAll();
|
2013-03-17 01:05:09 +04:00
|
|
|
void GetSelection(int32* _start, int32* _end) const;
|
2008-09-20 14:09:32 +04:00
|
|
|
|
2013-03-17 01:05:09 +04:00
|
|
|
void SetFontAndColor(const BFont* font,
|
|
|
|
uint32 mode = B_FONT_ALL,
|
|
|
|
const rgb_color* color = NULL);
|
2008-09-20 14:09:32 +04:00
|
|
|
void SetFontAndColor(int32 startOffset,
|
2013-03-17 01:05:09 +04:00
|
|
|
int32 endOffset, const BFont* font,
|
|
|
|
uint32 mode = B_FONT_ALL,
|
|
|
|
const rgb_color* color = NULL);
|
2008-09-20 14:09:32 +04:00
|
|
|
|
2013-03-17 01:05:09 +04:00
|
|
|
void GetFontAndColor(int32 offset, BFont* _font,
|
|
|
|
rgb_color* _color = NULL) const;
|
|
|
|
void GetFontAndColor(BFont* _font, uint32* _mode,
|
|
|
|
rgb_color* _color = NULL,
|
|
|
|
bool* _sameColor = NULL) const;
|
2008-09-20 14:09:32 +04:00
|
|
|
|
|
|
|
void SetRunArray(int32 startOffset, int32 endOffset,
|
2013-03-17 01:05:09 +04:00
|
|
|
const text_run_array* runs);
|
2008-09-20 14:09:32 +04:00
|
|
|
text_run_array* RunArray(int32 startOffset, int32 endOffset,
|
2013-03-17 01:05:09 +04:00
|
|
|
int32* _size = NULL) const;
|
2008-09-20 14:09:32 +04:00
|
|
|
|
|
|
|
int32 LineAt(int32 offset) const;
|
|
|
|
int32 LineAt(BPoint point) const;
|
2013-03-17 01:05:09 +04:00
|
|
|
BPoint PointAt(int32 offset,
|
|
|
|
float* _height = NULL) const;
|
2008-09-20 14:09:32 +04:00
|
|
|
int32 OffsetAt(BPoint point) const;
|
|
|
|
int32 OffsetAt(int32 line) const;
|
|
|
|
|
2013-03-17 01:05:09 +04:00
|
|
|
virtual void FindWord(int32 offset, int32* _fromOffset,
|
|
|
|
int32* _toOffset);
|
2008-09-20 14:09:32 +04:00
|
|
|
|
|
|
|
virtual bool CanEndLine(int32 offset);
|
|
|
|
|
|
|
|
float LineWidth(int32 lineIndex = 0) const;
|
|
|
|
float LineHeight(int32 lineIndex = 0) const;
|
|
|
|
float TextHeight(int32 startLine,
|
|
|
|
int32 endLine) const;
|
|
|
|
|
|
|
|
void GetTextRegion(int32 startOffset,
|
|
|
|
int32 endOffset, BRegion* outRegion) const;
|
|
|
|
|
2013-03-17 01:05:09 +04:00
|
|
|
virtual void ScrollToOffset(int32 offset);
|
2008-09-20 14:09:32 +04:00
|
|
|
void ScrollToSelection();
|
|
|
|
|
2008-10-21 14:14:24 +04:00
|
|
|
void Highlight(int32 startOffset, int32 endOffset);
|
2008-09-20 14:09:32 +04:00
|
|
|
|
|
|
|
void SetTextRect(BRect rect);
|
|
|
|
BRect TextRect() const;
|
2008-09-21 12:43:06 +04:00
|
|
|
void SetInsets(float left, float top, float right,
|
|
|
|
float bottom);
|
|
|
|
void GetInsets(float* _left, float* _top,
|
|
|
|
float* _right, float* _bottom) const;
|
2008-09-20 19:08:40 +04:00
|
|
|
|
2008-09-20 14:09:32 +04:00
|
|
|
void SetStylable(bool stylable);
|
|
|
|
bool IsStylable() const;
|
|
|
|
void SetTabWidth(float width);
|
|
|
|
float TabWidth() const;
|
|
|
|
void MakeSelectable(bool selectable = true);
|
|
|
|
bool IsSelectable() const;
|
|
|
|
void MakeEditable(bool editable = true);
|
|
|
|
bool IsEditable() const;
|
|
|
|
void SetWordWrap(bool wrap);
|
|
|
|
bool DoesWordWrap() const;
|
|
|
|
void SetMaxBytes(int32 max);
|
|
|
|
int32 MaxBytes() const;
|
2013-03-17 01:05:09 +04:00
|
|
|
void DisallowChar(uint32 character);
|
|
|
|
void AllowChar(uint32 character);
|
|
|
|
void SetAlignment(alignment align);
|
2008-09-20 14:09:32 +04:00
|
|
|
alignment Alignment() const;
|
|
|
|
void SetAutoindent(bool state);
|
|
|
|
bool DoesAutoindent() const;
|
|
|
|
void SetColorSpace(color_space colors);
|
|
|
|
color_space ColorSpace() const;
|
|
|
|
void MakeResizable(bool resize,
|
|
|
|
BView* resizeView = NULL);
|
|
|
|
bool IsResizable() const;
|
|
|
|
void SetDoesUndo(bool undo);
|
2008-10-21 14:14:24 +04:00
|
|
|
bool DoesUndo() const;
|
2008-09-20 14:09:32 +04:00
|
|
|
void HideTyping(bool enabled);
|
2008-10-21 14:14:24 +04:00
|
|
|
bool IsTypingHidden() const;
|
2008-09-20 14:09:32 +04:00
|
|
|
|
|
|
|
virtual void ResizeToPreferred();
|
|
|
|
virtual void GetPreferredSize(float* _width, float* _height);
|
2008-09-21 19:36:44 +04:00
|
|
|
|
|
|
|
virtual BSize MinSize();
|
|
|
|
virtual BSize MaxSize();
|
|
|
|
virtual BSize PreferredSize();
|
|
|
|
|
|
|
|
virtual bool HasHeightForWidth();
|
|
|
|
virtual void GetHeightForWidth(float width, float* min,
|
|
|
|
float* max, float* preferred);
|
|
|
|
|
|
|
|
protected:
|
2011-10-23 01:01:47 +04:00
|
|
|
virtual void LayoutInvalidated(bool descendants);
|
2008-09-21 19:36:44 +04:00
|
|
|
virtual void DoLayout();
|
|
|
|
|
|
|
|
public:
|
2008-09-20 14:09:32 +04:00
|
|
|
virtual void AllAttached();
|
|
|
|
virtual void AllDetached();
|
|
|
|
|
|
|
|
static text_run_array* AllocRunArray(int32 entryCount,
|
|
|
|
int32* outSize = NULL);
|
|
|
|
static text_run_array* CopyRunArray(const text_run_array* orig,
|
|
|
|
int32 countDelta = 0);
|
|
|
|
static void FreeRunArray(text_run_array* array);
|
2013-03-17 01:05:09 +04:00
|
|
|
static void* FlattenRunArray(const text_run_array* runArray,
|
|
|
|
int32* _size = NULL);
|
2008-09-20 14:09:32 +04:00
|
|
|
static text_run_array* UnflattenRunArray(const void* data,
|
2013-03-17 01:05:09 +04:00
|
|
|
int32* _size = NULL);
|
2008-09-20 14:09:32 +04:00
|
|
|
|
|
|
|
protected:
|
2013-03-17 01:05:09 +04:00
|
|
|
virtual void InsertText(const char* text, int32 length,
|
|
|
|
int32 offset, const text_run_array* runs);
|
2008-09-20 14:09:32 +04:00
|
|
|
virtual void DeleteText(int32 fromOffset, int32 toOffset);
|
|
|
|
|
|
|
|
public:
|
|
|
|
virtual void Undo(BClipboard* clipboard);
|
|
|
|
undo_state UndoState(bool* isRedo) const;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual void GetDragParameters(BMessage* drag,
|
|
|
|
BBitmap** _bitmap, BPoint* point,
|
|
|
|
BHandler** _handler);
|
|
|
|
|
2009-08-27 15:12:41 +04:00
|
|
|
// FBC padding and forbidden methods
|
|
|
|
public:
|
|
|
|
virtual status_t Perform(perform_code code, void* data);
|
|
|
|
|
|
|
|
private:
|
|
|
|
virtual void _ReservedTextView3();
|
|
|
|
virtual void _ReservedTextView4();
|
|
|
|
virtual void _ReservedTextView5();
|
|
|
|
virtual void _ReservedTextView6();
|
|
|
|
virtual void _ReservedTextView7();
|
|
|
|
virtual void _ReservedTextView8();
|
|
|
|
virtual void _ReservedTextView9();
|
|
|
|
virtual void _ReservedTextView10();
|
|
|
|
virtual void _ReservedTextView11();
|
|
|
|
virtual void _ReservedTextView12();
|
|
|
|
|
2008-09-20 14:09:32 +04:00
|
|
|
private:
|
2008-09-20 19:08:40 +04:00
|
|
|
class InlineInput;
|
|
|
|
struct LayoutData;
|
|
|
|
class LineBuffer;
|
|
|
|
class StyleBuffer;
|
|
|
|
class TextTrackState;
|
|
|
|
class UndoBuffer;
|
|
|
|
|
2008-09-21 13:15:35 +04:00
|
|
|
// UndoBuffer derivatives
|
2008-09-21 12:43:06 +04:00
|
|
|
class CutUndoBuffer;
|
|
|
|
class PasteUndoBuffer;
|
|
|
|
class ClearUndoBuffer;
|
|
|
|
class DropUndoBuffer;
|
|
|
|
class TypingUndoBuffer;
|
|
|
|
|
2008-09-20 19:08:40 +04:00
|
|
|
friend class TextTrackState;
|
2008-09-20 14:09:32 +04:00
|
|
|
|
|
|
|
void _InitObject(BRect textRect,
|
|
|
|
const BFont* initialFont,
|
|
|
|
const rgb_color* initialColor);
|
|
|
|
|
2009-08-27 15:12:41 +04:00
|
|
|
void _ValidateLayoutData();
|
2009-10-21 17:42:25 +04:00
|
|
|
void _ResetTextRect();
|
2009-08-27 15:12:41 +04:00
|
|
|
|
2008-09-20 14:09:32 +04:00
|
|
|
void _HandleBackspace();
|
2013-03-17 01:05:09 +04:00
|
|
|
void _HandleArrowKey(uint32 arrowKey,
|
2014-01-10 11:55:29 +04:00
|
|
|
int32 modifiers = -1);
|
2008-09-20 14:09:32 +04:00
|
|
|
void _HandleDelete();
|
2013-03-17 01:05:09 +04:00
|
|
|
void _HandlePageKey(uint32 pageKey,
|
2014-01-10 11:55:29 +04:00
|
|
|
int32 modifiers = -1);
|
2008-09-20 14:09:32 +04:00
|
|
|
void _HandleAlphaKey(const char* bytes,
|
|
|
|
int32 numBytes);
|
|
|
|
|
|
|
|
void _Refresh(int32 fromOffset, int32 toOffset,
|
2009-10-21 17:42:25 +04:00
|
|
|
bool scroll);
|
2008-09-20 14:09:32 +04:00
|
|
|
void _RecalculateLineBreaks(int32* startLine,
|
|
|
|
int32* endLine);
|
|
|
|
int32 _FindLineBreak(int32 fromOffset,
|
2013-03-17 01:05:09 +04:00
|
|
|
float* _ascent, float* _descent,
|
2009-10-21 17:42:25 +04:00
|
|
|
float* inOutWidth);
|
2008-09-20 14:09:32 +04:00
|
|
|
|
|
|
|
float _StyledWidth(int32 fromOffset, int32 length,
|
2013-03-17 01:05:09 +04:00
|
|
|
float* _ascent = NULL,
|
|
|
|
float* _descent = NULL) const;
|
2009-10-21 23:09:20 +04:00
|
|
|
float _TabExpandedStyledWidth(int32 offset,
|
2013-03-17 01:05:09 +04:00
|
|
|
int32 length, float* _ascent = NULL,
|
|
|
|
float* _descent = NULL) const;
|
2008-09-20 14:09:32 +04:00
|
|
|
|
|
|
|
float _ActualTabWidth(float location) const;
|
|
|
|
|
2013-03-17 01:05:09 +04:00
|
|
|
void _DoInsertText(const char* text, int32 length,
|
|
|
|
int32 offset, const text_run_array* runs);
|
2008-09-20 14:09:32 +04:00
|
|
|
|
2009-08-27 15:12:41 +04:00
|
|
|
void _DoDeleteText(int32 fromOffset,
|
|
|
|
int32 toOffset);
|
2008-09-20 14:09:32 +04:00
|
|
|
|
|
|
|
void _DrawLine(BView* view, const int32 &startLine,
|
2009-08-27 15:12:41 +04:00
|
|
|
const int32& startOffset,
|
|
|
|
const bool& erase, BRect& eraseRect,
|
|
|
|
BRegion& inputRegion);
|
2008-09-20 14:09:32 +04:00
|
|
|
|
|
|
|
void _DrawLines(int32 startLine, int32 endLine,
|
2009-08-27 15:12:41 +04:00
|
|
|
int32 startOffset = -1,
|
|
|
|
bool erase = false);
|
2009-04-08 02:40:53 +04:00
|
|
|
void _RequestDrawLines(int32 startLine,
|
2009-10-21 17:42:25 +04:00
|
|
|
int32 endLine);
|
2009-04-08 02:40:53 +04:00
|
|
|
|
2010-04-11 18:13:57 +04:00
|
|
|
void _DrawCaret(int32 offset, bool visible);
|
2008-09-20 14:09:32 +04:00
|
|
|
void _ShowCaret();
|
2008-10-21 14:14:24 +04:00
|
|
|
void _HideCaret();
|
2008-09-20 14:09:32 +04:00
|
|
|
void _InvertCaret();
|
|
|
|
void _DragCaret(int32 offset);
|
|
|
|
|
|
|
|
void _StopMouseTracking();
|
|
|
|
bool _PerformMouseUp(BPoint where);
|
|
|
|
bool _PerformMouseMoved(BPoint where, uint32 code);
|
|
|
|
|
|
|
|
void _TrackMouse(BPoint where,
|
|
|
|
const BMessage* message,
|
|
|
|
bool force = false);
|
|
|
|
|
|
|
|
void _TrackDrag(BPoint where);
|
|
|
|
void _InitiateDrag();
|
2013-03-17 01:05:09 +04:00
|
|
|
bool _MessageDropped(BMessage* message,
|
2008-09-20 14:09:32 +04:00
|
|
|
BPoint where, BPoint offset);
|
|
|
|
|
2008-10-21 14:14:24 +04:00
|
|
|
void _PerformAutoScrolling();
|
2008-09-20 14:09:32 +04:00
|
|
|
void _UpdateScrollbars();
|
2011-01-28 08:09:52 +03:00
|
|
|
void _ScrollBy(float horizontalStep,
|
|
|
|
float verticalStep);
|
|
|
|
void _ScrollTo(float x, float y);
|
|
|
|
|
2008-09-20 14:09:32 +04:00
|
|
|
void _AutoResize(bool doRedraw = true);
|
|
|
|
|
|
|
|
void _NewOffscreen(float padding = 0.0);
|
|
|
|
void _DeleteOffscreen();
|
|
|
|
|
|
|
|
void _Activate();
|
|
|
|
void _Deactivate();
|
|
|
|
|
|
|
|
void _NormalizeFont(BFont* font);
|
|
|
|
|
|
|
|
void _SetRunArray(int32 startOffset, int32 endOffset,
|
2013-03-17 01:05:09 +04:00
|
|
|
const text_run_array* runs);
|
2008-09-20 14:09:32 +04:00
|
|
|
|
2009-05-01 17:59:13 +04:00
|
|
|
void _ApplyStyleRange(int32 fromOffset,
|
|
|
|
int32 toOffset,
|
2013-03-17 01:05:09 +04:00
|
|
|
uint32 mode = B_FONT_ALL,
|
|
|
|
const BFont* font = NULL,
|
|
|
|
const rgb_color* color = NULL,
|
2009-05-01 17:59:13 +04:00
|
|
|
bool syncNullStyle = true);
|
|
|
|
|
2008-09-20 14:09:32 +04:00
|
|
|
uint32 _CharClassification(int32 offset) const;
|
|
|
|
int32 _NextInitialByte(int32 offset) const;
|
|
|
|
int32 _PreviousInitialByte(int32 offset) const;
|
|
|
|
|
2014-01-10 11:55:29 +04:00
|
|
|
int32 _PreviousLineStart(int32 offset);
|
|
|
|
int32 _NextLineEnd(int32 offset);
|
|
|
|
|
2009-04-08 02:40:53 +04:00
|
|
|
int32 _PreviousWordBoundary(int32 offset);
|
|
|
|
int32 _NextWordBoundary(int32 offset);
|
|
|
|
|
2009-11-04 21:49:15 +03:00
|
|
|
int32 _PreviousWordStart(int32 offset);
|
2009-11-06 18:32:55 +03:00
|
|
|
int32 _NextWordEnd(int32 offset);
|
2009-11-04 21:49:15 +03:00
|
|
|
|
2008-09-20 14:09:32 +04:00
|
|
|
bool _GetProperty(BMessage* specifier, int32 form,
|
|
|
|
const char* property, BMessage* reply);
|
|
|
|
bool _SetProperty(BMessage* specifier, int32 form,
|
|
|
|
const char* property, BMessage* reply);
|
|
|
|
bool _CountProperties(BMessage* specifier,
|
|
|
|
int32 form, const char* property,
|
|
|
|
BMessage* reply);
|
|
|
|
|
|
|
|
void _HandleInputMethodChanged(BMessage* message);
|
|
|
|
void _HandleInputMethodLocationRequest();
|
|
|
|
void _CancelInputMethod();
|
|
|
|
|
2009-04-27 18:00:45 +04:00
|
|
|
int32 _LineAt(int32 offset) const;
|
|
|
|
int32 _LineAt(const BPoint& point) const;
|
|
|
|
bool _IsOnEmptyLastLine(int32 offset) const;
|
|
|
|
|
2009-05-01 17:59:13 +04:00
|
|
|
float _NullStyleHeight() const;
|
|
|
|
|
2011-01-28 08:09:52 +03:00
|
|
|
void _ShowContextMenu(BPoint where);
|
2009-05-14 02:09:15 +04:00
|
|
|
|
2012-07-13 03:47:04 +04:00
|
|
|
void _FilterDisallowedChars(char* text,
|
2012-07-31 00:27:21 +04:00
|
|
|
ssize_t& length, text_run_array* runArray);
|
2012-07-13 03:38:09 +04:00
|
|
|
|
2009-08-27 15:12:41 +04:00
|
|
|
private:
|
2008-09-22 00:47:16 +04:00
|
|
|
BPrivate::TextGapBuffer* fText;
|
2008-09-20 19:08:40 +04:00
|
|
|
LineBuffer* fLines;
|
|
|
|
StyleBuffer* fStyles;
|
2008-09-20 14:09:32 +04:00
|
|
|
BRect fTextRect;
|
|
|
|
int32 fSelStart;
|
|
|
|
int32 fSelEnd;
|
|
|
|
bool fCaretVisible;
|
|
|
|
bigtime_t fCaretTime;
|
2009-08-16 21:02:47 +04:00
|
|
|
int32 fCaretOffset;
|
2008-09-20 14:09:32 +04:00
|
|
|
int32 fClickCount;
|
|
|
|
bigtime_t fClickTime;
|
|
|
|
int32 fDragOffset;
|
|
|
|
uint8 fCursor;
|
|
|
|
bool fActive;
|
|
|
|
bool fStylable;
|
|
|
|
float fTabWidth;
|
|
|
|
bool fSelectable;
|
|
|
|
bool fEditable;
|
|
|
|
bool fWrap;
|
|
|
|
int32 fMaxBytes;
|
|
|
|
BList* fDisallowedChars;
|
|
|
|
alignment fAlignment;
|
|
|
|
bool fAutoindent;
|
|
|
|
BBitmap* fOffscreen;
|
|
|
|
color_space fColorSpace;
|
|
|
|
bool fResizable;
|
|
|
|
BView* fContainerView;
|
2008-09-20 19:08:40 +04:00
|
|
|
UndoBuffer* fUndo;
|
|
|
|
InlineInput* fInline;
|
2009-08-16 21:02:47 +04:00
|
|
|
BMessageRunner* fDragRunner;
|
|
|
|
BMessageRunner* fClickRunner;
|
2008-09-20 14:09:32 +04:00
|
|
|
BPoint fWhere;
|
2008-09-20 19:08:40 +04:00
|
|
|
TextTrackState* fTrackingMouse;
|
2008-09-20 14:09:32 +04:00
|
|
|
|
2009-08-16 21:02:47 +04:00
|
|
|
float fMinTextRectWidth;
|
2008-09-21 12:43:06 +04:00
|
|
|
LayoutData* fLayoutData;
|
2009-08-16 21:02:47 +04:00
|
|
|
int32 fLastClickOffset;
|
2014-01-10 11:55:29 +04:00
|
|
|
|
2014-02-01 03:30:07 +04:00
|
|
|
bool fInstalledNavigateCommandWordwiseShortcuts;
|
|
|
|
bool fInstalledNavigateOptionWordwiseShortcuts;
|
|
|
|
bool fInstalledNavigateOptionLinewiseShortcuts;
|
|
|
|
bool fInstalledNavigateHomeEndDocwiseShortcuts;
|
|
|
|
|
|
|
|
bool fInstalledSelectCommandWordwiseShortcuts;
|
|
|
|
bool fInstalledSelectOptionWordwiseShortcuts;
|
|
|
|
bool fInstalledSelectOptionLinewiseShortcuts;
|
|
|
|
bool fInstalledSelectHomeEndDocwiseShortcuts;
|
2008-09-21 12:43:06 +04:00
|
|
|
|
2012-11-04 20:34:26 +04:00
|
|
|
uint32 _reserved[6];
|
2007-10-24 00:44:17 +04:00
|
|
|
};
|
2002-10-23 17:54:44 +04:00
|
|
|
|
2007-10-24 00:44:17 +04:00
|
|
|
#endif // _TEXTVIEW_H
|