EdText.dcl 1 KB
Newer Older
Diederik van Arkel's avatar
Diederik van Arkel committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/*
 * EdText.dcl: operations on text areas (extends EdLineText)
 */

definition module EdText

//1.3
from StdString	 import String
//3.1
import StdMaybe
from EdSelection import Selection, Position, ColumnNr, LineNr
import EdLineText

getTextFragment	:: !Selection				!Text -> (!TextFragment, !Text)
removeText		:: !Selection				!Text -> (Maybe Int,		 Text)
insertText		:: !Position !TextFragment	!Text -> (Maybe Int,		 Text)
replaceText		:: !Selection !TextFragment !Text -> !Text
appendText		:: !TextFragment			!Text -> Text

// getSelection:	returns the text fragment that is denoted
//					by the selection argument. The text is also returned, 
//					because in some implementations it may change.
//					E.g. the current implementation 
//					maintains a focus on the text to speed up operations
//					that occur nearby each other (very common in editing).
// removeSelection: removes the part of the text that is indicated 
//					by the selection.
// insertText:		inserts a text fragment in a text at a given position.