| ||||||||||
| ||||||||||
| ||||||||||
Description | ||||||||||
An iterator is an abstract datatype representing a pointer into a TextBuffer. | ||||||||||
Synopsis | ||||||||||
Types | ||||||||||
data TextIter | ||||||||||
data TextSearchFlags | ||||||||||
| ||||||||||
Methods | ||||||||||
textIterCopy :: TextIter -> IO TextIter | ||||||||||
Copy the iterator. | ||||||||||
textIterGetBuffer :: TextIter -> IO TextBuffer | ||||||||||
Return the TextBuffer this iterator is associated with. | ||||||||||
textIterGetOffset :: TextIter -> IO Int | ||||||||||
Returns the character offset of an iterator. Each character in a TextBuffer has an offset, starting with 0 for the first character in the buffer. Use Graphics.UI.Gtk.Multiline.TextBuffer.textBufferGetIterAtOffset to convert an offset back into an iterator. | ||||||||||
textIterGetLine :: TextIter -> IO Int | ||||||||||
Returns the line number containing the iterator. Lines in a TextBuffer are numbered beginning with 0 for the first line in the buffer. | ||||||||||
textIterGetLineOffset :: TextIter -> IO Int | ||||||||||
Returns the character offset of the iterator, counting from the start of a newline-terminated line. The first character on the line has offset 0. | ||||||||||
textIterGetVisibleLineOffset :: TextIter -> IO Int | ||||||||||
Returns the offset in characters from the start of the line to the given iter, not counting characters that are invisible due to tags with the "invisible" flag toggled on. | ||||||||||
textIterGetChar :: TextIter -> IO (Maybe Char) | ||||||||||
Returns the Unicode character at this iterator. If the element at this iterator is a non-character element, such as an image embedded in the buffer, the Unicode "unknown" character 0xFFFC is returned. If invoked on the end iterator, Nothigng is returned. | ||||||||||
textIterGetSlice :: TextIter -> TextIter -> IO String | ||||||||||
Returns the text in the given range. A "slice" is a list of characters, including the Unicode "unknown" character 0xFFFC for iterable non-character elements in the buffer, such as images. Because images are encoded in the slice, offsets in the returned array will correspond to offsets in the text buffer. Note that 0xFFFC can occur in normal text as well, so it is not a reliable indicator that a pixbuf or widget is in the buffer. | ||||||||||
textIterGetText :: TextIter -> TextIter -> IO String | ||||||||||
Return the text in a given range.
| ||||||||||
textIterGetVisibleSlice :: TextIter -> TextIter -> IO String | ||||||||||
Like textIterGetSlice, but invisible text is not included. Invisible text is usually invisible because a TextTag with the "invisible" attribute turned on has been applied to it. | ||||||||||
textIterGetVisibleText :: TextIter -> TextIter -> IO String | ||||||||||
Like textIterGetText, but invisible text is not included. Invisible text is usually invisible because a TextTag with the "invisible" attribute turned on has been applied to it. | ||||||||||
textIterGetPixbuf :: TextIter -> IO (Maybe Pixbuf) | ||||||||||
Get the Pixbuf under the iterator. | ||||||||||
textIterGetChildAnchor :: TextIter -> IO (Maybe TextChildAnchor) | ||||||||||
If the location at iter contains a child anchor, the anchor is returned (with no new reference count added). Otherwise, Nothing is returned. | ||||||||||
textIterGetMarks | ||||||||||
| ||||||||||
textIterGetToggledTags | ||||||||||
| ||||||||||
textIterBeginsTag :: TextIter -> Maybe TextTag -> IO Bool | ||||||||||
Returns True if tag is toggled on at exactly this point. If tag is Nothing, returns True if any tag is toggled on at this point. Note that the textIterBeginsTag returns True if iter is the start of the tagged range; textIterHasTag tells you whether an iterator is within a tagged range. | ||||||||||
textIterEndsTag :: TextIter -> Maybe TextTag -> IO Bool | ||||||||||
Returns True if tag is toggled off at exactly this point. If tag is Notihng, returns True if any tag is toggled off at this point. Note that the textIterEndsTag returns True if iter is the end of the tagged range; textIterHasTag tells you whether an iterator is within a tagged range. | ||||||||||
textIterTogglesTag :: TextIter -> Maybe TextTag -> IO Bool | ||||||||||
Query if the TextIter is at the beginning or the end of a TextTag. This is equivalent to (textIterBeginsTag || textIterEndsTag), i.e. it tells you whether a range with tag applied to it begins or ends at iter. | ||||||||||
textIterHasTag :: TextIter -> Maybe TextTag -> IO Bool | ||||||||||
Check if TextIter is within a range tagged with tag. | ||||||||||
textIterGetTags | ||||||||||
| ||||||||||
textIterEditable :: TextIter -> Bool -> IO Bool | ||||||||||
Returns whether the character at iter is within an editable region of text. Non-editable text is "locked" and can't be changed by the user via TextView. This function is simply a convenience wrapper around textIterGetAttributes. If no tags applied to this text affect editability, defaultSetting will be returned. You don't want to use this function to decide whether text can be inserted at iter, because for insertion you don't want to know whether the char at iter is inside an editable range, you want to know whether a new character inserted at iter would be inside an editable range. Use textIterCanInsert to handle this case. | ||||||||||
textIterCanInsert :: TextIter -> Bool -> IO Bool | ||||||||||
Check if new text can be inserted at TextIter.
| ||||||||||
textIterStartsWord :: TextIter -> IO Bool | ||||||||||
Determine if TextIter begins a new natural-language word. | ||||||||||
textIterEndsWord :: TextIter -> IO Bool | ||||||||||
Determine if TextIter ends a new natural-language word. | ||||||||||
textIterInsideWord :: TextIter -> IO Bool | ||||||||||
Determine if TextIter is inside a word. | ||||||||||
textIterStartsLine :: TextIter -> IO Bool | ||||||||||
Determine if TextIter begins a new line. | ||||||||||
textIterEndsLine :: TextIter -> IO Bool | ||||||||||
Returns True if iter points to the start of the paragraph delimiter characters for a line (delimiters will be either a newline, a carriage return, a carriage return followed by a newline, or a Unicode paragraph separator character). Note that an iterator pointing to the n of a rn pair will not be counted as the end of a line, the line ends before the r. The end iterator is considered to be at the end of a line, even though there are no paragraph delimiter chars there. | ||||||||||
textIterStartsSentence :: TextIter -> IO Bool | ||||||||||
Determine if TextIter starts a sentence. | ||||||||||
textIterEndsSentence :: TextIter -> IO Bool | ||||||||||
Determine if TextIter ends a sentence. | ||||||||||
textIterInsideSentence :: TextIter -> IO Bool | ||||||||||
Determine if TextIter is inside a sentence. | ||||||||||
textIterIsCursorPosition :: TextIter -> IO Bool | ||||||||||
Determine if TextIter is at a cursor position. | ||||||||||
textIterGetCharsInLine :: TextIter -> IO Int | ||||||||||
Return number of characters in this line.
| ||||||||||
textIterGetAttributes :: TextIter -> TextAttributes -> IO Bool | ||||||||||
Computes the effect of any tags applied to this spot in the text. The values parameter should be initialized to the default settings you wish to use if no tags are in effect. You'd typically obtain the defaults from textViewGetDefaultAttributes. textIterGetAttributes will modify values, applying the effects of any tags present at iter. If any tags affected values, the function returns True. | ||||||||||
textIterGetLanguage :: TextIter -> IO Language | ||||||||||
A convenience wrapper around textIterGetAttributes, which returns the language in effect at iter. If no tags affecting language apply to iter, the return value is identical to that of getDefaultLanguage. | ||||||||||
textIterIsEnd :: TextIter -> IO Bool | ||||||||||
Determine if TextIter is at the end of the buffer. | ||||||||||
textIterIsStart :: TextIter -> IO Bool | ||||||||||
Determine if TextIter is at the beginning of the buffer. | ||||||||||
textIterForwardChar :: TextIter -> IO Bool | ||||||||||
Move TextIter forwards.
| ||||||||||
textIterBackwardChar :: TextIter -> IO Bool | ||||||||||
Move TextIter backwards.
| ||||||||||
textIterForwardChars :: TextIter -> Int -> IO Bool | ||||||||||
Move TextIter forwards by n characters.
| ||||||||||
textIterBackwardChars :: TextIter -> Int -> IO Bool | ||||||||||
Move TextIter backwards by n characters.
| ||||||||||
textIterForwardLine :: TextIter -> IO Bool | ||||||||||
Move TextIter forwards.
| ||||||||||
textIterBackwardLine :: TextIter -> IO Bool | ||||||||||
Move TextIter backwards.
| ||||||||||
textIterForwardLines :: TextIter -> Int -> IO Bool | ||||||||||
Move TextIter forwards by n lines.
| ||||||||||
textIterBackwardLines :: TextIter -> Int -> IO Bool | ||||||||||
Move TextIter backwards by n lines.
| ||||||||||
textIterForwardWordEnds :: TextIter -> Int -> IO Bool | ||||||||||
Move TextIter forwards by n word ends.
| ||||||||||
textIterBackwardWordStarts :: TextIter -> Int -> IO Bool | ||||||||||
Move TextIter backwards by n word beginnings.
| ||||||||||
textIterForwardWordEnd :: TextIter -> IO Bool | ||||||||||
Move TextIter forwards to the next word end.
| ||||||||||
textIterBackwardWordStart :: TextIter -> IO Bool | ||||||||||
Move TextIter backwards to the next word beginning.
| ||||||||||
textIterForwardCursorPosition :: TextIter -> IO Bool | ||||||||||
Move TextIter forwards to the next cursor position. | ||||||||||
textIterBackwardCursorPosition :: TextIter -> IO Bool | ||||||||||
Move TextIter backwards to the next cursor position. | ||||||||||
textIterForwardCursorPositions :: TextIter -> Int -> IO Bool | ||||||||||
Move TextIter forwards by n cursor positions.
| ||||||||||
textIterBackwardCursorPositions :: TextIter -> Int -> IO Bool | ||||||||||
Move TextIter backwards by n cursor positions.
| ||||||||||
textIterForwardSentenceEnds :: TextIter -> Int -> IO Bool | ||||||||||
Move TextIter forwards by n sentence ends.
| ||||||||||
textIterBackwardSentenceStarts :: TextIter -> Int -> IO Bool | ||||||||||
Move TextIter backwards by n sentence beginnings.
| ||||||||||
textIterForwardSentenceEnd :: TextIter -> IO Bool | ||||||||||
Move TextIter forwards to the next sentence end.
| ||||||||||
textIterBackwardSentenceStart :: TextIter -> IO Bool | ||||||||||
Move TextIter backwards to the next sentence beginning.
| ||||||||||
textIterSetOffset :: TextIter -> Int -> IO () | ||||||||||
Set TextIter to an offset within the buffer. | ||||||||||
textIterSetLine :: TextIter -> Int -> IO () | ||||||||||
Set TextIter to a line within the buffer.
| ||||||||||
textIterSetLineOffset :: TextIter -> Int -> IO () | ||||||||||
Set TextIter to an offset within the line.
| ||||||||||
textIterSetVisibleLineOffset :: TextIter -> Int -> IO () | ||||||||||
Like textIterSetLineOffset, but the offset is in visible characters, i.e. text with a tag making it invisible is not counted in the offset. | ||||||||||
textIterForwardToEnd :: TextIter -> IO () | ||||||||||
Moves iter forward to the "end iterator," which points one past the last valid character in the buffer. | ||||||||||
textIterForwardToLineEnd :: TextIter -> IO Bool | ||||||||||
Moves the iterator to point to the paragraph delimiter characters, which will be either a newline, a carriage return, a carriage return/newline in sequence, or the Unicode paragraph separator character. If the iterator is already at the paragraph delimiter characters, moves to the paragraph delimiter characters for the next line. If iter is on the last line in the buffer, which does not end in paragraph delimiters, moves to the end iterator (end of the last line), and returns False. | ||||||||||
textIterForwardToTagToggle :: TextIter -> Maybe TextTag -> IO Bool | ||||||||||
textIterBackwardToTagToggle :: TextIter -> Maybe TextTag -> IO Bool | ||||||||||
textIterForwardFindChar :: TextIter -> (Char -> Bool) -> Maybe TextIter -> IO Bool | ||||||||||
Move TextIter forward until a predicate function returns True.
| ||||||||||
textIterBackwardFindChar :: TextIter -> (Char -> Bool) -> Maybe TextIter -> IO Bool | ||||||||||
Move TextIter backward until a predicate function returns True.
| ||||||||||
textIterForwardSearch :: TextIter -> String -> [TextSearchFlags] -> Maybe TextIter -> IO (Maybe (TextIter, TextIter)) | ||||||||||
Search forward for a specific string.
| ||||||||||
textIterBackwardSearch :: TextIter -> String -> [TextSearchFlags] -> Maybe TextIter -> IO (Maybe (TextIter, TextIter)) | ||||||||||
Search backward for a specific string.
| ||||||||||
textIterEqual :: TextIter -> TextIter -> IO Bool | ||||||||||
Compare two TextIter for equality. | ||||||||||
textIterCompare :: TextIter -> TextIter -> IO Ordering | ||||||||||
Compare two TextIter. | ||||||||||
textIterInRange | ||||||||||
| ||||||||||
textIterOrder :: TextIter -> TextIter -> IO () | ||||||||||
Swaps the value of first and second if second comes before first in the buffer. That is, ensures that first and second are in sequence. Most text buffer functions that take a range call this automatically on your behalf, so there's no real reason to call it yourself in those cases. There are some exceptions, such as textIterInRange, that expect a pre-sorted range. | ||||||||||
textIterForwardVisibleLine | ||||||||||
| ||||||||||
textIterBackwardVisibleLine | ||||||||||
| ||||||||||
textIterForwardVisibleLines | ||||||||||
| ||||||||||
textIterBackwardVisibleLines | ||||||||||
| ||||||||||
textIterForwardVisibleWordEnds | ||||||||||
| ||||||||||
textIterBackwardVisibleWordStarts | ||||||||||
| ||||||||||
textIterForwardVisibleWordEnd | ||||||||||
| ||||||||||
textIterBackwardVisibleWordStart | ||||||||||
| ||||||||||
textIterForwardVisibleCursorPosition | ||||||||||
| ||||||||||
textIterBackwardVisibleCursorPosition | ||||||||||
| ||||||||||
textIterForwardVisibleCursorPositions | ||||||||||
| ||||||||||
textIterBackwardVisibleCursorPositions | ||||||||||
| ||||||||||
Attributes | ||||||||||
textIterVisibleLineOffset :: Attr TextIter Int | ||||||||||
'visibleLineOffset' property. See textIterGetVisibleLineOffset and textIterSetVisibleLineOffset | ||||||||||
textIterOffset :: Attr TextIter Int | ||||||||||
'offset' property. See textIterGetOffset and textIterSetOffset | ||||||||||
textIterLineOffset :: Attr TextIter Int | ||||||||||
'lineOffset' property. See textIterGetLineOffset and textIterSetLineOffset | ||||||||||
textIterLine :: Attr TextIter Int | ||||||||||
'line' property. See textIterGetLine and textIterSetLine | ||||||||||
Produced by Haddock version 2.4.2 |