Class EditableContent
editable plain text
(singleline/multiline
)
Inherits from
-
(base class)Object
Constructors
Name | Description |
---|---|
this
|
Fields
Name | Type | Description |
---|---|---|
contentChangeListeners
|
Signal!(dlangui.widgets.editors.EditableContentListener) |
listeners for edit operations |
_filename
|
string |
|
_format
|
TextFileFormat |
|
_lines
|
dstring[] |
|
_multiline
|
bool |
|
_readOnly
|
bool |
|
_syntaxHighlighter
|
SyntaxHighlighter |
|
_tokenProps
|
ubyte[][] |
|
_undoBuffer
|
UndoBuffer |
Properties
Name | Type | Description |
---|---|---|
filename
[get]
|
string |
file used to load editor content
|
hasRedo
[get]
|
bool |
return true if there is at least one operation in redo buffer
|
hasSyntaxHighlight
[get]
|
bool |
returns true if content has syntax highlight handler set |
hasUndo
[get]
|
bool |
return true if there is at least one operation in undo buffer
|
length
[get]
|
int |
returns line text
|
multiline
[get]
|
bool |
returns true if miltyline content is supported |
readOnly
[set]
|
bool |
|
readOnly
[get]
|
bool |
|
syntaxHighlighter
[set]
|
EditableContent |
|
syntaxHighlighter
[get]
|
SyntaxHighlighter |
|
text
[set]
|
EditableContent |
replace whole text with another content
|
text
[get]
|
dstring |
returns all lines concatenated delimited by '\n' |
Methods
Name | Description |
---|---|
clear
|
clear content
|
clearUndo
|
clear undo /redp history
|
correctPosition
|
when position is out of content bounds, fix it to nearest valid position
|
correctRange
|
when range positions is out of content bounds, fix it to nearest valid position
|
firstNonSpace
|
returns position before first non-space character of line , returns 0 position if no non-space chars
|
handleContentChange
|
|
isAlNum
|
|
isAlpha
|
|
isBracket
|
|
isDigit
|
|
isLowerAlpha
|
|
isPunct
|
|
isUpperAlpha
|
|
isWordBound
|
|
lastNonSpace
|
returns position after last non-space character of line , returns 0 position if no non-space chars on line
|
line
|
returns line text by index , "" if index is out of bounds
|
lineEnd
|
returns text position for end of line lineIndex
|
lineLength
|
returns text position for end of line lineIndex
|
lineTokenProps
|
returns line token properties one item per character
|
load
|
load content form input stream
|
load
|
load content from file
|
maxLineLength
|
returns maximum length of line
|
moveByWord
|
change text position to nearest word bound (direction < 0 - back, > 0 - forward)
|
notifyContentReplaced
|
call listener to say that whole content is replaced e.g. by loading from file |
opIndex
|
|
performOperation
|
edit content |
rangeText
|
return text for specified range
|
redo
|
redoes last undone change |
save
|
save to output stream in specified format
|
save
|
save to output stream in current format
|
save
|
save to file in specified format
|
save
|
save to file in current format
|
undo
|
undoes last change |
clearTokenProps
|
set props arrays size equal to text line sizes, bit fill with unknown token
|
insertLines
|
inserts count empty lines at specified position
|
removeLines
|
removes removedCount lines starting from start
|
replaceRange
|
inserts or removes lines, removes text in range
|
updateTokenProps
|
Authors
Vadim Lopatin, coolreader.org@gmail.com
Copyright
Vadim Lopatin, 2014
License
Boost License 1.0