1 /*
2  * This file is part of gtkD.
3  *
4  * gtkD is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser General Public License
6  * as published by the Free Software Foundation; either version 3
7  * of the License, or (at your option) any later version, with
8  * some exceptions, please read the COPYING file.
9  *
10  * gtkD is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with gtkD; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
18  */
19 
20 // generated automatically - do not change
21 // find conversion definition on APILookup.txt
22 // implement new conversion functionalities on the wrap.utils pakage
23 
24 
25 module gtk.TextIter;
26 
27 private import gdkpixbuf.Pixbuf;
28 private import glib.ListSG;
29 private import glib.Str;
30 private import gobject.ObjectG;
31 private import gtk.TextAttributes;
32 private import gtk.TextBuffer;
33 private import gtk.TextChildAnchor;
34 private import gtk.TextTag;
35 private import gtkc.gtk;
36 public  import gtkc.gtktypes;
37 private import pango.PgLanguage;
38 
39 
40 /**
41  * You may wish to begin by reading the
42  * [text widget conceptual overview][TextWidget]
43  * which gives an overview of all the objects and data
44  * types related to the text widget and how they work together.
45  */
46 public class TextIter
47 {
48 	/** the main Gtk struct */
49 	protected GtkTextIter* gtkTextIter;
50 
51 	/** Get the main Gtk struct */
52 	public GtkTextIter* getTextIterStruct()
53 	{
54 		return gtkTextIter;
55 	}
56 
57 	/** the main Gtk struct as a void* */
58 	protected void* getStruct()
59 	{
60 		return cast(void*)gtkTextIter;
61 	}
62 
63 	/**
64 	 * Sets our main struct and passes it to the parent class.
65 	 */
66 	public this (GtkTextIter* gtkTextIter)
67 	{
68 		this.gtkTextIter = gtkTextIter;
69 	}
70 
71 	/** */
72 	public this()
73 	{
74 		this(new GtkTextIter);
75 	}
76 
77 	/**
78 	 */
79 
80 	/** */
81 	public static GType getType()
82 	{
83 		return gtk_text_iter_get_type();
84 	}
85 
86 	/**
87 	 * Assigns the value of @other to @iter.  This function
88 	 * is not useful in applications, because iterators can be assigned
89 	 * with `GtkTextIter i = j;`. The
90 	 * function is used by language bindings.
91 	 *
92 	 * Params:
93 	 *     other = another #GtkTextIter
94 	 *
95 	 * Since: 3.2
96 	 */
97 	public void assign(TextIter other)
98 	{
99 		gtk_text_iter_assign(gtkTextIter, (other is null) ? null : other.getTextIterStruct());
100 	}
101 
102 	/**
103 	 * Moves backward by one character offset. Returns %TRUE if movement
104 	 * was possible; if @iter was the first in the buffer (character
105 	 * offset 0), gtk_text_iter_backward_char() returns %FALSE for convenience when
106 	 * writing loops.
107 	 *
108 	 * Return: whether movement was possible
109 	 */
110 	public bool backwardChar()
111 	{
112 		return gtk_text_iter_backward_char(gtkTextIter) != 0;
113 	}
114 
115 	/**
116 	 * Moves @count characters backward, if possible (if @count would move
117 	 * past the start or end of the buffer, moves to the start or end of
118 	 * the buffer).  The return value indicates whether the iterator moved
119 	 * onto a dereferenceable position; if the iterator didn’t move, or
120 	 * moved onto the end iterator, then %FALSE is returned. If @count is 0,
121 	 * the function does nothing and returns %FALSE.
122 	 *
123 	 * Params:
124 	 *     count = number of characters to move
125 	 *
126 	 * Return: whether @iter moved and is dereferenceable
127 	 */
128 	public bool backwardChars(int count)
129 	{
130 		return gtk_text_iter_backward_chars(gtkTextIter, count) != 0;
131 	}
132 
133 	/**
134 	 * Like gtk_text_iter_forward_cursor_position(), but moves backward.
135 	 *
136 	 * Return: %TRUE if we moved
137 	 */
138 	public bool backwardCursorPosition()
139 	{
140 		return gtk_text_iter_backward_cursor_position(gtkTextIter) != 0;
141 	}
142 
143 	/**
144 	 * Moves up to @count cursor positions. See
145 	 * gtk_text_iter_forward_cursor_position() for details.
146 	 *
147 	 * Params:
148 	 *     count = number of positions to move
149 	 *
150 	 * Return: %TRUE if we moved and the new position is dereferenceable
151 	 */
152 	public bool backwardCursorPositions(int count)
153 	{
154 		return gtk_text_iter_backward_cursor_positions(gtkTextIter, count) != 0;
155 	}
156 
157 	/**
158 	 * Same as gtk_text_iter_forward_find_char(), but goes backward from @iter.
159 	 *
160 	 * Params:
161 	 *     pred = function to be called on each character
162 	 *     userData = user data for @pred
163 	 *     limit = search limit, or %NULL for none
164 	 *
165 	 * Return: whether a match was found
166 	 */
167 	public bool backwardFindChar(GtkTextCharPredicate pred, void* userData, TextIter limit)
168 	{
169 		return gtk_text_iter_backward_find_char(gtkTextIter, pred, userData, (limit is null) ? null : limit.getTextIterStruct()) != 0;
170 	}
171 
172 	/**
173 	 * Moves @iter to the start of the previous line. Returns %TRUE if
174 	 * @iter could be moved; i.e. if @iter was at character offset 0, this
175 	 * function returns %FALSE. Therefore if @iter was already on line 0,
176 	 * but not at the start of the line, @iter is snapped to the start of
177 	 * the line and the function returns %TRUE. (Note that this implies that
178 	 * in a loop calling this function, the line number may not change on
179 	 * every iteration, if your first iteration is on line 0.)
180 	 *
181 	 * Return: whether @iter moved
182 	 */
183 	public bool backwardLine()
184 	{
185 		return gtk_text_iter_backward_line(gtkTextIter) != 0;
186 	}
187 
188 	/**
189 	 * Moves @count lines backward, if possible (if @count would move
190 	 * past the start or end of the buffer, moves to the start or end of
191 	 * the buffer).  The return value indicates whether the iterator moved
192 	 * onto a dereferenceable position; if the iterator didn’t move, or
193 	 * moved onto the end iterator, then %FALSE is returned. If @count is 0,
194 	 * the function does nothing and returns %FALSE. If @count is negative,
195 	 * moves forward by 0 - @count lines.
196 	 *
197 	 * Params:
198 	 *     count = number of lines to move backward
199 	 *
200 	 * Return: whether @iter moved and is dereferenceable
201 	 */
202 	public bool backwardLines(int count)
203 	{
204 		return gtk_text_iter_backward_lines(gtkTextIter, count) != 0;
205 	}
206 
207 	/**
208 	 * Same as gtk_text_iter_forward_search(), but moves backward.
209 	 *
210 	 * @match_end will never be set to a #GtkTextIter located after @iter, even if
211 	 * there is a possible @match_start before or at @iter.
212 	 *
213 	 * Params:
214 	 *     str = search string
215 	 *     flags = bitmask of flags affecting the search
216 	 *     matchStart = return location for start of match, or %NULL
217 	 *     matchEnd = return location for end of match, or %NULL
218 	 *     limit = location of last possible @match_start, or %NULL for start of buffer
219 	 *
220 	 * Return: whether a match was found
221 	 */
222 	public bool backwardSearch(string str, GtkTextSearchFlags flags, out TextIter matchStart, out TextIter matchEnd, TextIter limit)
223 	{
224 		GtkTextIter* outmatchStart = gMalloc!GtkTextIter();
225 		GtkTextIter* outmatchEnd = gMalloc!GtkTextIter();
226 		
227 		auto p = gtk_text_iter_backward_search(gtkTextIter, Str.toStringz(str), flags, outmatchStart, outmatchEnd, (limit is null) ? null : limit.getTextIterStruct()) != 0;
228 		
229 		matchStart = ObjectG.getDObject!(TextIter)(outmatchStart);
230 		matchEnd = ObjectG.getDObject!(TextIter)(outmatchEnd);
231 		
232 		return p;
233 	}
234 
235 	/**
236 	 * Moves backward to the previous sentence start; if @iter is already at
237 	 * the start of a sentence, moves backward to the next one.  Sentence
238 	 * boundaries are determined by Pango and should be correct for nearly
239 	 * any language (if not, the correct fix would be to the Pango text
240 	 * boundary algorithms).
241 	 *
242 	 * Return: %TRUE if @iter moved and is not the end iterator
243 	 */
244 	public bool backwardSentenceStart()
245 	{
246 		return gtk_text_iter_backward_sentence_start(gtkTextIter) != 0;
247 	}
248 
249 	/**
250 	 * Calls gtk_text_iter_backward_sentence_start() up to @count times,
251 	 * or until it returns %FALSE. If @count is negative, moves forward
252 	 * instead of backward.
253 	 *
254 	 * Params:
255 	 *     count = number of sentences to move
256 	 *
257 	 * Return: %TRUE if @iter moved and is not the end iterator
258 	 */
259 	public bool backwardSentenceStarts(int count)
260 	{
261 		return gtk_text_iter_backward_sentence_starts(gtkTextIter, count) != 0;
262 	}
263 
264 	/**
265 	 * Moves backward to the next toggle (on or off) of the
266 	 * #GtkTextTag @tag, or to the next toggle of any tag if
267 	 * @tag is %NULL. If no matching tag toggles are found,
268 	 * returns %FALSE, otherwise %TRUE. Does not return toggles
269 	 * located at @iter, only toggles before @iter. Sets @iter
270 	 * to the location of the toggle, or the start of the buffer
271 	 * if no toggle is found.
272 	 *
273 	 * Params:
274 	 *     tag = a #GtkTextTag, or %NULL
275 	 *
276 	 * Return: whether we found a tag toggle before @iter
277 	 */
278 	public bool backwardToTagToggle(TextTag tag)
279 	{
280 		return gtk_text_iter_backward_to_tag_toggle(gtkTextIter, (tag is null) ? null : tag.getTextTagStruct()) != 0;
281 	}
282 
283 	/**
284 	 * Moves @iter forward to the previous visible cursor position. See
285 	 * gtk_text_iter_backward_cursor_position() for details.
286 	 *
287 	 * Return: %TRUE if we moved and the new position is dereferenceable
288 	 *
289 	 * Since: 2.4
290 	 */
291 	public bool backwardVisibleCursorPosition()
292 	{
293 		return gtk_text_iter_backward_visible_cursor_position(gtkTextIter) != 0;
294 	}
295 
296 	/**
297 	 * Moves up to @count visible cursor positions. See
298 	 * gtk_text_iter_backward_cursor_position() for details.
299 	 *
300 	 * Params:
301 	 *     count = number of positions to move
302 	 *
303 	 * Return: %TRUE if we moved and the new position is dereferenceable
304 	 *
305 	 * Since: 2.4
306 	 */
307 	public bool backwardVisibleCursorPositions(int count)
308 	{
309 		return gtk_text_iter_backward_visible_cursor_positions(gtkTextIter, count) != 0;
310 	}
311 
312 	/**
313 	 * Moves @iter to the start of the previous visible line. Returns %TRUE if
314 	 * @iter could be moved; i.e. if @iter was at character offset 0, this
315 	 * function returns %FALSE. Therefore if @iter was already on line 0,
316 	 * but not at the start of the line, @iter is snapped to the start of
317 	 * the line and the function returns %TRUE. (Note that this implies that
318 	 * in a loop calling this function, the line number may not change on
319 	 * every iteration, if your first iteration is on line 0.)
320 	 *
321 	 * Return: whether @iter moved
322 	 *
323 	 * Since: 2.8
324 	 */
325 	public bool backwardVisibleLine()
326 	{
327 		return gtk_text_iter_backward_visible_line(gtkTextIter) != 0;
328 	}
329 
330 	/**
331 	 * Moves @count visible lines backward, if possible (if @count would move
332 	 * past the start or end of the buffer, moves to the start or end of
333 	 * the buffer).  The return value indicates whether the iterator moved
334 	 * onto a dereferenceable position; if the iterator didn’t move, or
335 	 * moved onto the end iterator, then %FALSE is returned. If @count is 0,
336 	 * the function does nothing and returns %FALSE. If @count is negative,
337 	 * moves forward by 0 - @count lines.
338 	 *
339 	 * Params:
340 	 *     count = number of lines to move backward
341 	 *
342 	 * Return: whether @iter moved and is dereferenceable
343 	 *
344 	 * Since: 2.8
345 	 */
346 	public bool backwardVisibleLines(int count)
347 	{
348 		return gtk_text_iter_backward_visible_lines(gtkTextIter, count) != 0;
349 	}
350 
351 	/**
352 	 * Moves backward to the previous visible word start. (If @iter is currently
353 	 * on a word start, moves backward to the next one after that.) Word breaks
354 	 * are determined by Pango and should be correct for nearly any
355 	 * language (if not, the correct fix would be to the Pango word break
356 	 * algorithms).
357 	 *
358 	 * Return: %TRUE if @iter moved and is not the end iterator
359 	 *
360 	 * Since: 2.4
361 	 */
362 	public bool backwardVisibleWordStart()
363 	{
364 		return gtk_text_iter_backward_visible_word_start(gtkTextIter) != 0;
365 	}
366 
367 	/**
368 	 * Calls gtk_text_iter_backward_visible_word_start() up to @count times.
369 	 *
370 	 * Params:
371 	 *     count = number of times to move
372 	 *
373 	 * Return: %TRUE if @iter moved and is not the end iterator
374 	 *
375 	 * Since: 2.4
376 	 */
377 	public bool backwardVisibleWordStarts(int count)
378 	{
379 		return gtk_text_iter_backward_visible_word_starts(gtkTextIter, count) != 0;
380 	}
381 
382 	/**
383 	 * Moves backward to the previous word start. (If @iter is currently on a
384 	 * word start, moves backward to the next one after that.) Word breaks
385 	 * are determined by Pango and should be correct for nearly any
386 	 * language (if not, the correct fix would be to the Pango word break
387 	 * algorithms).
388 	 *
389 	 * Return: %TRUE if @iter moved and is not the end iterator
390 	 */
391 	public bool backwardWordStart()
392 	{
393 		return gtk_text_iter_backward_word_start(gtkTextIter) != 0;
394 	}
395 
396 	/**
397 	 * Calls gtk_text_iter_backward_word_start() up to @count times.
398 	 *
399 	 * Params:
400 	 *     count = number of times to move
401 	 *
402 	 * Return: %TRUE if @iter moved and is not the end iterator
403 	 */
404 	public bool backwardWordStarts(int count)
405 	{
406 		return gtk_text_iter_backward_word_starts(gtkTextIter, count) != 0;
407 	}
408 
409 	/**
410 	 * Returns %TRUE if @tag is toggled on at exactly this point. If @tag
411 	 * is %NULL, returns %TRUE if any tag is toggled on at this point.
412 	 *
413 	 * Note that if gtk_text_iter_begins_tag() returns %TRUE, it means that @iter is
414 	 * at the beginning of the tagged range, and that the
415 	 * character at @iter is inside the tagged range. In other
416 	 * words, unlike gtk_text_iter_ends_tag(), if gtk_text_iter_begins_tag() returns
417 	 * %TRUE, gtk_text_iter_has_tag() will also return %TRUE for the same
418 	 * parameters.
419 	 *
420 	 * Params:
421 	 *     tag = a #GtkTextTag, or %NULL
422 	 *
423 	 * Return: whether @iter is the start of a range tagged with @tag
424 	 */
425 	public bool beginsTag(TextTag tag)
426 	{
427 		return gtk_text_iter_begins_tag(gtkTextIter, (tag is null) ? null : tag.getTextTagStruct()) != 0;
428 	}
429 
430 	/**
431 	 * Considering the default editability of the buffer, and tags that
432 	 * affect editability, determines whether text inserted at @iter would
433 	 * be editable. If text inserted at @iter would be editable then the
434 	 * user should be allowed to insert text at @iter.
435 	 * gtk_text_buffer_insert_interactive() uses this function to decide
436 	 * whether insertions are allowed at a given position.
437 	 *
438 	 * Params:
439 	 *     defaultEditability = %TRUE if text is editable by default
440 	 *
441 	 * Return: whether text inserted at @iter would be editable
442 	 */
443 	public bool canInsert(bool defaultEditability)
444 	{
445 		return gtk_text_iter_can_insert(gtkTextIter, defaultEditability) != 0;
446 	}
447 
448 	/**
449 	 * A qsort()-style function that returns negative if @lhs is less than
450 	 * @rhs, positive if @lhs is greater than @rhs, and 0 if they’re equal.
451 	 * Ordering is in character offset order, i.e. the first character in the buffer
452 	 * is less than the second character in the buffer.
453 	 *
454 	 * Params:
455 	 *     rhs = another #GtkTextIter
456 	 *
457 	 * Return: -1 if @lhs is less than @rhs, 1 if @lhs is greater, 0 if they are equal
458 	 */
459 	public int compare(TextIter rhs)
460 	{
461 		return gtk_text_iter_compare(gtkTextIter, (rhs is null) ? null : rhs.getTextIterStruct());
462 	}
463 
464 	/**
465 	 * Creates a dynamically-allocated copy of an iterator. This function
466 	 * is not useful in applications, because iterators can be copied with a
467 	 * simple assignment (`GtkTextIter i = j;`). The
468 	 * function is used by language bindings.
469 	 *
470 	 * Return: a copy of the @iter, free with gtk_text_iter_free()
471 	 */
472 	public TextIter copy()
473 	{
474 		auto p = gtk_text_iter_copy(gtkTextIter);
475 		
476 		if(p is null)
477 		{
478 			return null;
479 		}
480 		
481 		return ObjectG.getDObject!(TextIter)(cast(GtkTextIter*) p);
482 	}
483 
484 	/**
485 	 * Returns whether the character at @iter is within an editable region
486 	 * of text.  Non-editable text is “locked” and can’t be changed by the
487 	 * user via #GtkTextView. This function is simply a convenience
488 	 * wrapper around gtk_text_iter_get_attributes(). If no tags applied
489 	 * to this text affect editability, @default_setting will be returned.
490 	 *
491 	 * You don’t want to use this function to decide whether text can be
492 	 * inserted at @iter, because for insertion you don’t want to know
493 	 * whether the char at @iter is inside an editable range, you want to
494 	 * know whether a new character inserted at @iter would be inside an
495 	 * editable range. Use gtk_text_iter_can_insert() to handle this
496 	 * case.
497 	 *
498 	 * Params:
499 	 *     defaultSetting = %TRUE if text is editable by default
500 	 *
501 	 * Return: whether @iter is inside an editable range
502 	 */
503 	public bool editable(bool defaultSetting)
504 	{
505 		return gtk_text_iter_editable(gtkTextIter, defaultSetting) != 0;
506 	}
507 
508 	/**
509 	 * Returns %TRUE if @iter points to the start of the paragraph
510 	 * delimiter characters for a line (delimiters will be either a
511 	 * newline, a carriage return, a carriage return followed by a
512 	 * newline, or a Unicode paragraph separator character). Note that an
513 	 * iterator pointing to the \n of a \r\n pair will not be counted as
514 	 * the end of a line, the line ends before the \r. The end iterator is
515 	 * considered to be at the end of a line, even though there are no
516 	 * paragraph delimiter chars there.
517 	 *
518 	 * Return: whether @iter is at the end of a line
519 	 */
520 	public bool endsLine()
521 	{
522 		return gtk_text_iter_ends_line(gtkTextIter) != 0;
523 	}
524 
525 	/**
526 	 * Determines whether @iter ends a sentence.  Sentence boundaries are
527 	 * determined by Pango and should be correct for nearly any language
528 	 * (if not, the correct fix would be to the Pango text boundary
529 	 * algorithms).
530 	 *
531 	 * Return: %TRUE if @iter is at the end of a sentence.
532 	 */
533 	public bool endsSentence()
534 	{
535 		return gtk_text_iter_ends_sentence(gtkTextIter) != 0;
536 	}
537 
538 	/**
539 	 * Returns %TRUE if @tag is toggled off at exactly this point. If @tag
540 	 * is %NULL, returns %TRUE if any tag is toggled off at this point.
541 	 *
542 	 * Note that if gtk_text_iter_ends_tag() returns %TRUE, it means that @iter is
543 	 * at the end of the tagged range, but that the character
544 	 * at @iter is outside the tagged range. In other words,
545 	 * unlike gtk_text_iter_begins_tag(), if gtk_text_iter_ends_tag() returns %TRUE,
546 	 * gtk_text_iter_has_tag() will return %FALSE for the same parameters.
547 	 *
548 	 * Params:
549 	 *     tag = a #GtkTextTag, or %NULL
550 	 *
551 	 * Return: whether @iter is the end of a range tagged with @tag
552 	 */
553 	public bool endsTag(TextTag tag)
554 	{
555 		return gtk_text_iter_ends_tag(gtkTextIter, (tag is null) ? null : tag.getTextTagStruct()) != 0;
556 	}
557 
558 	/**
559 	 * Determines whether @iter ends a natural-language word.  Word breaks
560 	 * are determined by Pango and should be correct for nearly any
561 	 * language (if not, the correct fix would be to the Pango word break
562 	 * algorithms).
563 	 *
564 	 * Return: %TRUE if @iter is at the end of a word
565 	 */
566 	public bool endsWord()
567 	{
568 		return gtk_text_iter_ends_word(gtkTextIter) != 0;
569 	}
570 
571 	/**
572 	 * Tests whether two iterators are equal, using the fastest possible
573 	 * mechanism. This function is very fast; you can expect it to perform
574 	 * better than e.g. getting the character offset for each iterator and
575 	 * comparing the offsets yourself. Also, it’s a bit faster than
576 	 * gtk_text_iter_compare().
577 	 *
578 	 * Params:
579 	 *     rhs = another #GtkTextIter
580 	 *
581 	 * Return: %TRUE if the iterators point to the same place in the buffer
582 	 */
583 	public bool equal(TextIter rhs)
584 	{
585 		return gtk_text_iter_equal(gtkTextIter, (rhs is null) ? null : rhs.getTextIterStruct()) != 0;
586 	}
587 
588 	/**
589 	 * Moves @iter forward by one character offset. Note that images
590 	 * embedded in the buffer occupy 1 character slot, so
591 	 * gtk_text_iter_forward_char() may actually move onto an image instead
592 	 * of a character, if you have images in your buffer.  If @iter is the
593 	 * end iterator or one character before it, @iter will now point at
594 	 * the end iterator, and gtk_text_iter_forward_char() returns %FALSE for
595 	 * convenience when writing loops.
596 	 *
597 	 * Return: whether @iter moved and is dereferenceable
598 	 */
599 	public bool forwardChar()
600 	{
601 		return gtk_text_iter_forward_char(gtkTextIter) != 0;
602 	}
603 
604 	/**
605 	 * Moves @count characters if possible (if @count would move past the
606 	 * start or end of the buffer, moves to the start or end of the
607 	 * buffer). The return value indicates whether the new position of
608 	 * @iter is different from its original position, and dereferenceable
609 	 * (the last iterator in the buffer is not dereferenceable). If @count
610 	 * is 0, the function does nothing and returns %FALSE.
611 	 *
612 	 * Params:
613 	 *     count = number of characters to move, may be negative
614 	 *
615 	 * Return: whether @iter moved and is dereferenceable
616 	 */
617 	public bool forwardChars(int count)
618 	{
619 		return gtk_text_iter_forward_chars(gtkTextIter, count) != 0;
620 	}
621 
622 	/**
623 	 * Moves @iter forward by a single cursor position. Cursor positions
624 	 * are (unsurprisingly) positions where the cursor can appear. Perhaps
625 	 * surprisingly, there may not be a cursor position between all
626 	 * characters. The most common example for European languages would be
627 	 * a carriage return/newline sequence. For some Unicode characters,
628 	 * the equivalent of say the letter “a” with an accent mark will be
629 	 * represented as two characters, first the letter then a "combining
630 	 * mark" that causes the accent to be rendered; so the cursor can’t go
631 	 * between those two characters. See also the #PangoLogAttr-struct and
632 	 * pango_break() function.
633 	 *
634 	 * Return: %TRUE if we moved and the new position is dereferenceable
635 	 */
636 	public bool forwardCursorPosition()
637 	{
638 		return gtk_text_iter_forward_cursor_position(gtkTextIter) != 0;
639 	}
640 
641 	/**
642 	 * Moves up to @count cursor positions. See
643 	 * gtk_text_iter_forward_cursor_position() for details.
644 	 *
645 	 * Params:
646 	 *     count = number of positions to move
647 	 *
648 	 * Return: %TRUE if we moved and the new position is dereferenceable
649 	 */
650 	public bool forwardCursorPositions(int count)
651 	{
652 		return gtk_text_iter_forward_cursor_positions(gtkTextIter, count) != 0;
653 	}
654 
655 	/**
656 	 * Advances @iter, calling @pred on each character. If
657 	 * @pred returns %TRUE, returns %TRUE and stops scanning.
658 	 * If @pred never returns %TRUE, @iter is set to @limit if
659 	 * @limit is non-%NULL, otherwise to the end iterator.
660 	 *
661 	 * Params:
662 	 *     pred = a function to be called on each character
663 	 *     userData = user data for @pred
664 	 *     limit = search limit, or %NULL for none
665 	 *
666 	 * Return: whether a match was found
667 	 */
668 	public bool forwardFindChar(GtkTextCharPredicate pred, void* userData, TextIter limit)
669 	{
670 		return gtk_text_iter_forward_find_char(gtkTextIter, pred, userData, (limit is null) ? null : limit.getTextIterStruct()) != 0;
671 	}
672 
673 	/**
674 	 * Moves @iter to the start of the next line. If the iter is already on the
675 	 * last line of the buffer, moves the iter to the end of the current line.
676 	 * If after the operation, the iter is at the end of the buffer and not
677 	 * dereferencable, returns %FALSE. Otherwise, returns %TRUE.
678 	 *
679 	 * Return: whether @iter can be dereferenced
680 	 */
681 	public bool forwardLine()
682 	{
683 		return gtk_text_iter_forward_line(gtkTextIter) != 0;
684 	}
685 
686 	/**
687 	 * Moves @count lines forward, if possible (if @count would move
688 	 * past the start or end of the buffer, moves to the start or end of
689 	 * the buffer).  The return value indicates whether the iterator moved
690 	 * onto a dereferenceable position; if the iterator didn’t move, or
691 	 * moved onto the end iterator, then %FALSE is returned. If @count is 0,
692 	 * the function does nothing and returns %FALSE. If @count is negative,
693 	 * moves backward by 0 - @count lines.
694 	 *
695 	 * Params:
696 	 *     count = number of lines to move forward
697 	 *
698 	 * Return: whether @iter moved and is dereferenceable
699 	 */
700 	public bool forwardLines(int count)
701 	{
702 		return gtk_text_iter_forward_lines(gtkTextIter, count) != 0;
703 	}
704 
705 	/**
706 	 * Searches forward for @str. Any match is returned by setting
707 	 * @match_start to the first character of the match and @match_end to the
708 	 * first character after the match. The search will not continue past
709 	 * @limit. Note that a search is a linear or O(n) operation, so you
710 	 * may wish to use @limit to avoid locking up your UI on large
711 	 * buffers.
712 	 *
713 	 * @match_start will never be set to a #GtkTextIter located before @iter, even if
714 	 * there is a possible @match_end after or at @iter.
715 	 *
716 	 * Params:
717 	 *     str = a search string
718 	 *     flags = flags affecting how the search is done
719 	 *     matchStart = return location for start of match, or %NULL
720 	 *     matchEnd = return location for end of match, or %NULL
721 	 *     limit = location of last possible @match_end, or %NULL for the end of the buffer
722 	 *
723 	 * Return: whether a match was found
724 	 */
725 	public bool forwardSearch(string str, GtkTextSearchFlags flags, out TextIter matchStart, out TextIter matchEnd, TextIter limit)
726 	{
727 		GtkTextIter* outmatchStart = gMalloc!GtkTextIter();
728 		GtkTextIter* outmatchEnd = gMalloc!GtkTextIter();
729 		
730 		auto p = gtk_text_iter_forward_search(gtkTextIter, Str.toStringz(str), flags, outmatchStart, outmatchEnd, (limit is null) ? null : limit.getTextIterStruct()) != 0;
731 		
732 		matchStart = ObjectG.getDObject!(TextIter)(outmatchStart);
733 		matchEnd = ObjectG.getDObject!(TextIter)(outmatchEnd);
734 		
735 		return p;
736 	}
737 
738 	/**
739 	 * Moves forward to the next sentence end. (If @iter is at the end of
740 	 * a sentence, moves to the next end of sentence.)  Sentence
741 	 * boundaries are determined by Pango and should be correct for nearly
742 	 * any language (if not, the correct fix would be to the Pango text
743 	 * boundary algorithms).
744 	 *
745 	 * Return: %TRUE if @iter moved and is not the end iterator
746 	 */
747 	public bool forwardSentenceEnd()
748 	{
749 		return gtk_text_iter_forward_sentence_end(gtkTextIter) != 0;
750 	}
751 
752 	/**
753 	 * Calls gtk_text_iter_forward_sentence_end() @count times (or until
754 	 * gtk_text_iter_forward_sentence_end() returns %FALSE). If @count is
755 	 * negative, moves backward instead of forward.
756 	 *
757 	 * Params:
758 	 *     count = number of sentences to move
759 	 *
760 	 * Return: %TRUE if @iter moved and is not the end iterator
761 	 */
762 	public bool forwardSentenceEnds(int count)
763 	{
764 		return gtk_text_iter_forward_sentence_ends(gtkTextIter, count) != 0;
765 	}
766 
767 	/**
768 	 * Moves @iter forward to the “end iterator,” which points one past the last
769 	 * valid character in the buffer. gtk_text_iter_get_char() called on the
770 	 * end iterator returns 0, which is convenient for writing loops.
771 	 */
772 	public void forwardToEnd()
773 	{
774 		gtk_text_iter_forward_to_end(gtkTextIter);
775 	}
776 
777 	/**
778 	 * Moves the iterator to point to the paragraph delimiter characters,
779 	 * which will be either a newline, a carriage return, a carriage
780 	 * return/newline in sequence, or the Unicode paragraph separator
781 	 * character. If the iterator is already at the paragraph delimiter
782 	 * characters, moves to the paragraph delimiter characters for the
783 	 * next line. If @iter is on the last line in the buffer, which does
784 	 * not end in paragraph delimiters, moves to the end iterator (end of
785 	 * the last line), and returns %FALSE.
786 	 *
787 	 * Return: %TRUE if we moved and the new location is not the end iterator
788 	 */
789 	public bool forwardToLineEnd()
790 	{
791 		return gtk_text_iter_forward_to_line_end(gtkTextIter) != 0;
792 	}
793 
794 	/**
795 	 * Moves forward to the next toggle (on or off) of the
796 	 * #GtkTextTag @tag, or to the next toggle of any tag if
797 	 * @tag is %NULL. If no matching tag toggles are found,
798 	 * returns %FALSE, otherwise %TRUE. Does not return toggles
799 	 * located at @iter, only toggles after @iter. Sets @iter to
800 	 * the location of the toggle, or to the end of the buffer
801 	 * if no toggle is found.
802 	 *
803 	 * Params:
804 	 *     tag = a #GtkTextTag, or %NULL
805 	 *
806 	 * Return: whether we found a tag toggle after @iter
807 	 */
808 	public bool forwardToTagToggle(TextTag tag)
809 	{
810 		return gtk_text_iter_forward_to_tag_toggle(gtkTextIter, (tag is null) ? null : tag.getTextTagStruct()) != 0;
811 	}
812 
813 	/**
814 	 * Moves @iter forward to the next visible cursor position. See
815 	 * gtk_text_iter_forward_cursor_position() for details.
816 	 *
817 	 * Return: %TRUE if we moved and the new position is dereferenceable
818 	 *
819 	 * Since: 2.4
820 	 */
821 	public bool forwardVisibleCursorPosition()
822 	{
823 		return gtk_text_iter_forward_visible_cursor_position(gtkTextIter) != 0;
824 	}
825 
826 	/**
827 	 * Moves up to @count visible cursor positions. See
828 	 * gtk_text_iter_forward_cursor_position() for details.
829 	 *
830 	 * Params:
831 	 *     count = number of positions to move
832 	 *
833 	 * Return: %TRUE if we moved and the new position is dereferenceable
834 	 *
835 	 * Since: 2.4
836 	 */
837 	public bool forwardVisibleCursorPositions(int count)
838 	{
839 		return gtk_text_iter_forward_visible_cursor_positions(gtkTextIter, count) != 0;
840 	}
841 
842 	/**
843 	 * Moves @iter to the start of the next visible line. Returns %TRUE if there
844 	 * was a next line to move to, and %FALSE if @iter was simply moved to
845 	 * the end of the buffer and is now not dereferenceable, or if @iter was
846 	 * already at the end of the buffer.
847 	 *
848 	 * Return: whether @iter can be dereferenced
849 	 *
850 	 * Since: 2.8
851 	 */
852 	public bool forwardVisibleLine()
853 	{
854 		return gtk_text_iter_forward_visible_line(gtkTextIter) != 0;
855 	}
856 
857 	/**
858 	 * Moves @count visible lines forward, if possible (if @count would move
859 	 * past the start or end of the buffer, moves to the start or end of
860 	 * the buffer).  The return value indicates whether the iterator moved
861 	 * onto a dereferenceable position; if the iterator didn’t move, or
862 	 * moved onto the end iterator, then %FALSE is returned. If @count is 0,
863 	 * the function does nothing and returns %FALSE. If @count is negative,
864 	 * moves backward by 0 - @count lines.
865 	 *
866 	 * Params:
867 	 *     count = number of lines to move forward
868 	 *
869 	 * Return: whether @iter moved and is dereferenceable
870 	 *
871 	 * Since: 2.8
872 	 */
873 	public bool forwardVisibleLines(int count)
874 	{
875 		return gtk_text_iter_forward_visible_lines(gtkTextIter, count) != 0;
876 	}
877 
878 	/**
879 	 * Moves forward to the next visible word end. (If @iter is currently on a
880 	 * word end, moves forward to the next one after that.) Word breaks
881 	 * are determined by Pango and should be correct for nearly any
882 	 * language (if not, the correct fix would be to the Pango word break
883 	 * algorithms).
884 	 *
885 	 * Return: %TRUE if @iter moved and is not the end iterator
886 	 *
887 	 * Since: 2.4
888 	 */
889 	public bool forwardVisibleWordEnd()
890 	{
891 		return gtk_text_iter_forward_visible_word_end(gtkTextIter) != 0;
892 	}
893 
894 	/**
895 	 * Calls gtk_text_iter_forward_visible_word_end() up to @count times.
896 	 *
897 	 * Params:
898 	 *     count = number of times to move
899 	 *
900 	 * Return: %TRUE if @iter moved and is not the end iterator
901 	 *
902 	 * Since: 2.4
903 	 */
904 	public bool forwardVisibleWordEnds(int count)
905 	{
906 		return gtk_text_iter_forward_visible_word_ends(gtkTextIter, count) != 0;
907 	}
908 
909 	/**
910 	 * Moves forward to the next word end. (If @iter is currently on a
911 	 * word end, moves forward to the next one after that.) Word breaks
912 	 * are determined by Pango and should be correct for nearly any
913 	 * language (if not, the correct fix would be to the Pango word break
914 	 * algorithms).
915 	 *
916 	 * Return: %TRUE if @iter moved and is not the end iterator
917 	 */
918 	public bool forwardWordEnd()
919 	{
920 		return gtk_text_iter_forward_word_end(gtkTextIter) != 0;
921 	}
922 
923 	/**
924 	 * Calls gtk_text_iter_forward_word_end() up to @count times.
925 	 *
926 	 * Params:
927 	 *     count = number of times to move
928 	 *
929 	 * Return: %TRUE if @iter moved and is not the end iterator
930 	 */
931 	public bool forwardWordEnds(int count)
932 	{
933 		return gtk_text_iter_forward_word_ends(gtkTextIter, count) != 0;
934 	}
935 
936 	/**
937 	 * Free an iterator allocated on the heap. This function
938 	 * is intended for use in language bindings, and is not
939 	 * especially useful for applications, because iterators can
940 	 * simply be allocated on the stack.
941 	 */
942 	public void free()
943 	{
944 		gtk_text_iter_free(gtkTextIter);
945 	}
946 
947 	/**
948 	 * Computes the effect of any tags applied to this spot in the
949 	 * text. The @values parameter should be initialized to the default
950 	 * settings you wish to use if no tags are in effect. You’d typically
951 	 * obtain the defaults from gtk_text_view_get_default_attributes().
952 	 *
953 	 * gtk_text_iter_get_attributes() will modify @values, applying the
954 	 * effects of any tags present at @iter. If any tags affected @values,
955 	 * the function returns %TRUE.
956 	 *
957 	 * Params:
958 	 *     values = a #GtkTextAttributes to be filled in
959 	 *
960 	 * Return: %TRUE if @values was modified
961 	 */
962 	public bool getAttributes(out TextAttributes values)
963 	{
964 		GtkTextAttributes* outvalues = gMalloc!GtkTextAttributes();
965 		
966 		auto p = gtk_text_iter_get_attributes(gtkTextIter, outvalues) != 0;
967 		
968 		values = ObjectG.getDObject!(TextAttributes)(outvalues);
969 		
970 		return p;
971 	}
972 
973 	/**
974 	 * Returns the #GtkTextBuffer this iterator is associated with.
975 	 *
976 	 * Return: the buffer
977 	 */
978 	public TextBuffer getBuffer()
979 	{
980 		auto p = gtk_text_iter_get_buffer(gtkTextIter);
981 		
982 		if(p is null)
983 		{
984 			return null;
985 		}
986 		
987 		return ObjectG.getDObject!(TextBuffer)(cast(GtkTextBuffer*) p);
988 	}
989 
990 	/**
991 	 * Returns the number of bytes in the line containing @iter,
992 	 * including the paragraph delimiters.
993 	 *
994 	 * Return: number of bytes in the line
995 	 */
996 	public int getBytesInLine()
997 	{
998 		return gtk_text_iter_get_bytes_in_line(gtkTextIter);
999 	}
1000 
1001 	/**
1002 	 * The Unicode character at this iterator is returned.  (Equivalent to
1003 	 * operator* on a C++ iterator.)  If the element at this iterator is a
1004 	 * non-character element, such as an image embedded in the buffer, the
1005 	 * Unicode “unknown” character 0xFFFC is returned. If invoked on
1006 	 * the end iterator, zero is returned; zero is not a valid Unicode character.
1007 	 * So you can write a loop which ends when gtk_text_iter_get_char()
1008 	 * returns 0.
1009 	 *
1010 	 * Return: a Unicode character, or 0 if @iter is not dereferenceable
1011 	 */
1012 	public dchar getChar()
1013 	{
1014 		return gtk_text_iter_get_char(gtkTextIter);
1015 	}
1016 
1017 	/**
1018 	 * Returns the number of characters in the line containing @iter,
1019 	 * including the paragraph delimiters.
1020 	 *
1021 	 * Return: number of characters in the line
1022 	 */
1023 	public int getCharsInLine()
1024 	{
1025 		return gtk_text_iter_get_chars_in_line(gtkTextIter);
1026 	}
1027 
1028 	/**
1029 	 * If the location at @iter contains a child anchor, the
1030 	 * anchor is returned (with no new reference count added). Otherwise,
1031 	 * %NULL is returned.
1032 	 *
1033 	 * Return: the anchor at @iter
1034 	 */
1035 	public TextChildAnchor getChildAnchor()
1036 	{
1037 		auto p = gtk_text_iter_get_child_anchor(gtkTextIter);
1038 		
1039 		if(p is null)
1040 		{
1041 			return null;
1042 		}
1043 		
1044 		return ObjectG.getDObject!(TextChildAnchor)(cast(GtkTextChildAnchor*) p);
1045 	}
1046 
1047 	/**
1048 	 * A convenience wrapper around gtk_text_iter_get_attributes(),
1049 	 * which returns the language in effect at @iter. If no tags affecting
1050 	 * language apply to @iter, the return value is identical to that of
1051 	 * gtk_get_default_language().
1052 	 *
1053 	 * Return: language in effect at @iter
1054 	 */
1055 	public PgLanguage getLanguage()
1056 	{
1057 		auto p = gtk_text_iter_get_language(gtkTextIter);
1058 		
1059 		if(p is null)
1060 		{
1061 			return null;
1062 		}
1063 		
1064 		return ObjectG.getDObject!(PgLanguage)(cast(PangoLanguage*) p);
1065 	}
1066 
1067 	/**
1068 	 * Returns the line number containing the iterator. Lines in
1069 	 * a #GtkTextBuffer are numbered beginning with 0 for the first
1070 	 * line in the buffer.
1071 	 *
1072 	 * Return: a line number
1073 	 */
1074 	public int getLine()
1075 	{
1076 		return gtk_text_iter_get_line(gtkTextIter);
1077 	}
1078 
1079 	/**
1080 	 * Returns the byte index of the iterator, counting
1081 	 * from the start of a newline-terminated line.
1082 	 * Remember that #GtkTextBuffer encodes text in
1083 	 * UTF-8, and that characters can require a variable
1084 	 * number of bytes to represent.
1085 	 *
1086 	 * Return: distance from start of line, in bytes
1087 	 */
1088 	public int getLineIndex()
1089 	{
1090 		return gtk_text_iter_get_line_index(gtkTextIter);
1091 	}
1092 
1093 	/**
1094 	 * Returns the character offset of the iterator,
1095 	 * counting from the start of a newline-terminated line.
1096 	 * The first character on the line has offset 0.
1097 	 *
1098 	 * Return: offset from start of line
1099 	 */
1100 	public int getLineOffset()
1101 	{
1102 		return gtk_text_iter_get_line_offset(gtkTextIter);
1103 	}
1104 
1105 	/**
1106 	 * Returns a list of all #GtkTextMark at this location. Because marks
1107 	 * are not iterable (they don’t take up any "space" in the buffer,
1108 	 * they are just marks in between iterable locations), multiple marks
1109 	 * can exist in the same place. The returned list is not in any
1110 	 * meaningful order.
1111 	 *
1112 	 * Return: list of #GtkTextMark
1113 	 */
1114 	public ListSG getMarks()
1115 	{
1116 		auto p = gtk_text_iter_get_marks(gtkTextIter);
1117 		
1118 		if(p is null)
1119 		{
1120 			return null;
1121 		}
1122 		
1123 		return new ListSG(cast(GSList*) p);
1124 	}
1125 
1126 	/**
1127 	 * Returns the character offset of an iterator.
1128 	 * Each character in a #GtkTextBuffer has an offset,
1129 	 * starting with 0 for the first character in the buffer.
1130 	 * Use gtk_text_buffer_get_iter_at_offset() to convert an
1131 	 * offset back into an iterator.
1132 	 *
1133 	 * Return: a character offset
1134 	 */
1135 	public int getOffset()
1136 	{
1137 		return gtk_text_iter_get_offset(gtkTextIter);
1138 	}
1139 
1140 	/**
1141 	 * If the element at @iter is a pixbuf, the pixbuf is returned
1142 	 * (with no new reference count added). Otherwise,
1143 	 * %NULL is returned.
1144 	 *
1145 	 * Return: the pixbuf at @iter
1146 	 */
1147 	public Pixbuf getPixbuf()
1148 	{
1149 		auto p = gtk_text_iter_get_pixbuf(gtkTextIter);
1150 		
1151 		if(p is null)
1152 		{
1153 			return null;
1154 		}
1155 		
1156 		return ObjectG.getDObject!(Pixbuf)(cast(GdkPixbuf*) p);
1157 	}
1158 
1159 	/**
1160 	 * Returns the text in the given range. A “slice” is an array of
1161 	 * characters encoded in UTF-8 format, including the Unicode “unknown”
1162 	 * character 0xFFFC for iterable non-character elements in the buffer,
1163 	 * such as images.  Because images are encoded in the slice, byte and
1164 	 * character offsets in the returned array will correspond to byte
1165 	 * offsets in the text buffer. Note that 0xFFFC can occur in normal
1166 	 * text as well, so it is not a reliable indicator that a pixbuf or
1167 	 * widget is in the buffer.
1168 	 *
1169 	 * Params:
1170 	 *     end = iterator at end of a range
1171 	 *
1172 	 * Return: slice of text from the buffer
1173 	 */
1174 	public string getSlice(TextIter end)
1175 	{
1176 		return Str.toString(gtk_text_iter_get_slice(gtkTextIter, (end is null) ? null : end.getTextIterStruct()));
1177 	}
1178 
1179 	/**
1180 	 * Returns a list of tags that apply to @iter, in ascending order of
1181 	 * priority (highest-priority tags are last). The #GtkTextTag in the
1182 	 * list don’t have a reference added, but you have to free the list
1183 	 * itself.
1184 	 *
1185 	 * Return: list of #GtkTextTag
1186 	 */
1187 	public ListSG getTags()
1188 	{
1189 		auto p = gtk_text_iter_get_tags(gtkTextIter);
1190 		
1191 		if(p is null)
1192 		{
1193 			return null;
1194 		}
1195 		
1196 		return new ListSG(cast(GSList*) p);
1197 	}
1198 
1199 	/**
1200 	 * Returns text in the given range.  If the range
1201 	 * contains non-text elements such as images, the character and byte
1202 	 * offsets in the returned string will not correspond to character and
1203 	 * byte offsets in the buffer. If you want offsets to correspond, see
1204 	 * gtk_text_iter_get_slice().
1205 	 *
1206 	 * Params:
1207 	 *     end = iterator at end of a range
1208 	 *
1209 	 * Return: array of characters from the buffer
1210 	 */
1211 	public string getText(TextIter end)
1212 	{
1213 		return Str.toString(gtk_text_iter_get_text(gtkTextIter, (end is null) ? null : end.getTextIterStruct()));
1214 	}
1215 
1216 	/**
1217 	 * Returns a list of #GtkTextTag that are toggled on or off at this
1218 	 * point.  (If @toggled_on is %TRUE, the list contains tags that are
1219 	 * toggled on.) If a tag is toggled on at @iter, then some non-empty
1220 	 * range of characters following @iter has that tag applied to it.  If
1221 	 * a tag is toggled off, then some non-empty range following @iter
1222 	 * does not have the tag applied to it.
1223 	 *
1224 	 * Params:
1225 	 *     toggledOn = %TRUE to get toggled-on tags
1226 	 *
1227 	 * Return: tags toggled at this point
1228 	 */
1229 	public ListSG getToggledTags(bool toggledOn)
1230 	{
1231 		auto p = gtk_text_iter_get_toggled_tags(gtkTextIter, toggledOn);
1232 		
1233 		if(p is null)
1234 		{
1235 			return null;
1236 		}
1237 		
1238 		return new ListSG(cast(GSList*) p);
1239 	}
1240 
1241 	/**
1242 	 * Returns the number of bytes from the start of the
1243 	 * line to the given @iter, not counting bytes that
1244 	 * are invisible due to tags with the “invisible” flag
1245 	 * toggled on.
1246 	 *
1247 	 * Return: byte index of @iter with respect to the start of the line
1248 	 */
1249 	public int getVisibleLineIndex()
1250 	{
1251 		return gtk_text_iter_get_visible_line_index(gtkTextIter);
1252 	}
1253 
1254 	/**
1255 	 * Returns the offset in characters from the start of the
1256 	 * line to the given @iter, not counting characters that
1257 	 * are invisible due to tags with the “invisible” flag
1258 	 * toggled on.
1259 	 *
1260 	 * Return: offset in visible characters from the start of the line
1261 	 */
1262 	public int getVisibleLineOffset()
1263 	{
1264 		return gtk_text_iter_get_visible_line_offset(gtkTextIter);
1265 	}
1266 
1267 	/**
1268 	 * Like gtk_text_iter_get_slice(), but invisible text is not included.
1269 	 * Invisible text is usually invisible because a #GtkTextTag with the
1270 	 * “invisible” attribute turned on has been applied to it.
1271 	 *
1272 	 * Params:
1273 	 *     end = iterator at end of range
1274 	 *
1275 	 * Return: slice of text from the buffer
1276 	 */
1277 	public string getVisibleSlice(TextIter end)
1278 	{
1279 		return Str.toString(gtk_text_iter_get_visible_slice(gtkTextIter, (end is null) ? null : end.getTextIterStruct()));
1280 	}
1281 
1282 	/**
1283 	 * Like gtk_text_iter_get_text(), but invisible text is not included.
1284 	 * Invisible text is usually invisible because a #GtkTextTag with the
1285 	 * “invisible” attribute turned on has been applied to it.
1286 	 *
1287 	 * Params:
1288 	 *     end = iterator at end of range
1289 	 *
1290 	 * Return: string containing visible text in the
1291 	 *     range
1292 	 */
1293 	public string getVisibleText(TextIter end)
1294 	{
1295 		return Str.toString(gtk_text_iter_get_visible_text(gtkTextIter, (end is null) ? null : end.getTextIterStruct()));
1296 	}
1297 
1298 	/**
1299 	 * Returns %TRUE if @iter points to a character that is part of a range tagged
1300 	 * with @tag. See also gtk_text_iter_begins_tag() and gtk_text_iter_ends_tag().
1301 	 *
1302 	 * Params:
1303 	 *     tag = a #GtkTextTag
1304 	 *
1305 	 * Return: whether @iter is tagged with @tag
1306 	 */
1307 	public bool hasTag(TextTag tag)
1308 	{
1309 		return gtk_text_iter_has_tag(gtkTextIter, (tag is null) ? null : tag.getTextTagStruct()) != 0;
1310 	}
1311 
1312 	/**
1313 	 * Checks whether @iter falls in the range [@start, @end).
1314 	 * @start and @end must be in ascending order.
1315 	 *
1316 	 * Params:
1317 	 *     start = start of range
1318 	 *     end = end of range
1319 	 *
1320 	 * Return: %TRUE if @iter is in the range
1321 	 */
1322 	public bool inRange(TextIter start, TextIter end)
1323 	{
1324 		return gtk_text_iter_in_range(gtkTextIter, (start is null) ? null : start.getTextIterStruct(), (end is null) ? null : end.getTextIterStruct()) != 0;
1325 	}
1326 
1327 	/**
1328 	 * Determines whether @iter is inside a sentence (as opposed to in
1329 	 * between two sentences, e.g. after a period and before the first
1330 	 * letter of the next sentence).  Sentence boundaries are determined
1331 	 * by Pango and should be correct for nearly any language (if not, the
1332 	 * correct fix would be to the Pango text boundary algorithms).
1333 	 *
1334 	 * Return: %TRUE if @iter is inside a sentence.
1335 	 */
1336 	public bool insideSentence()
1337 	{
1338 		return gtk_text_iter_inside_sentence(gtkTextIter) != 0;
1339 	}
1340 
1341 	/**
1342 	 * Determines whether the character pointed by @iter is part of a
1343 	 * natural-language word (as opposed to say inside some whitespace).  Word
1344 	 * breaks are determined by Pango and should be correct for nearly any language
1345 	 * (if not, the correct fix would be to the Pango word break algorithms).
1346 	 *
1347 	 * Note that if gtk_text_iter_starts_word() returns %TRUE, then this function
1348 	 * returns %TRUE too, since @iter points to the first character of the word.
1349 	 *
1350 	 * Return: %TRUE if @iter is inside a word
1351 	 */
1352 	public bool insideWord()
1353 	{
1354 		return gtk_text_iter_inside_word(gtkTextIter) != 0;
1355 	}
1356 
1357 	/**
1358 	 * See gtk_text_iter_forward_cursor_position() or #PangoLogAttr or
1359 	 * pango_break() for details on what a cursor position is.
1360 	 *
1361 	 * Return: %TRUE if the cursor can be placed at @iter
1362 	 */
1363 	public bool isCursorPosition()
1364 	{
1365 		return gtk_text_iter_is_cursor_position(gtkTextIter) != 0;
1366 	}
1367 
1368 	/**
1369 	 * Returns %TRUE if @iter is the end iterator, i.e. one past the last
1370 	 * dereferenceable iterator in the buffer. gtk_text_iter_is_end() is
1371 	 * the most efficient way to check whether an iterator is the end
1372 	 * iterator.
1373 	 *
1374 	 * Return: whether @iter is the end iterator
1375 	 */
1376 	public bool isEnd()
1377 	{
1378 		return gtk_text_iter_is_end(gtkTextIter) != 0;
1379 	}
1380 
1381 	/**
1382 	 * Returns %TRUE if @iter is the first iterator in the buffer, that is
1383 	 * if @iter has a character offset of 0.
1384 	 *
1385 	 * Return: whether @iter is the first in the buffer
1386 	 */
1387 	public bool isStart()
1388 	{
1389 		return gtk_text_iter_is_start(gtkTextIter) != 0;
1390 	}
1391 
1392 	/**
1393 	 * Swaps the value of @first and @second if @second comes before
1394 	 * @first in the buffer. That is, ensures that @first and @second are
1395 	 * in sequence. Most text buffer functions that take a range call this
1396 	 * automatically on your behalf, so there’s no real reason to call it yourself
1397 	 * in those cases. There are some exceptions, such as gtk_text_iter_in_range(),
1398 	 * that expect a pre-sorted range.
1399 	 *
1400 	 * Params:
1401 	 *     second = another #GtkTextIter
1402 	 */
1403 	public void order(TextIter second)
1404 	{
1405 		gtk_text_iter_order(gtkTextIter, (second is null) ? null : second.getTextIterStruct());
1406 	}
1407 
1408 	/**
1409 	 * Moves iterator @iter to the start of the line @line_number.  If
1410 	 * @line_number is negative or larger than the number of lines in the
1411 	 * buffer, moves @iter to the start of the last line in the buffer.
1412 	 *
1413 	 * Params:
1414 	 *     lineNumber = line number (counted from 0)
1415 	 */
1416 	public void setLine(int lineNumber)
1417 	{
1418 		gtk_text_iter_set_line(gtkTextIter, lineNumber);
1419 	}
1420 
1421 	/**
1422 	 * Same as gtk_text_iter_set_line_offset(), but works with a
1423 	 * byte index. The given byte index must be at
1424 	 * the start of a character, it can’t be in the middle of a UTF-8
1425 	 * encoded character.
1426 	 *
1427 	 * Params:
1428 	 *     byteOnLine = a byte index relative to the start of @iter’s current line
1429 	 */
1430 	public void setLineIndex(int byteOnLine)
1431 	{
1432 		gtk_text_iter_set_line_index(gtkTextIter, byteOnLine);
1433 	}
1434 
1435 	/**
1436 	 * Moves @iter within a line, to a new character
1437 	 * (not byte) offset. The given character offset must be less than or
1438 	 * equal to the number of characters in the line; if equal, @iter
1439 	 * moves to the start of the next line. See
1440 	 * gtk_text_iter_set_line_index() if you have a byte index rather than
1441 	 * a character offset.
1442 	 *
1443 	 * Params:
1444 	 *     charOnLine = a character offset relative to the start of @iter’s current line
1445 	 */
1446 	public void setLineOffset(int charOnLine)
1447 	{
1448 		gtk_text_iter_set_line_offset(gtkTextIter, charOnLine);
1449 	}
1450 
1451 	/**
1452 	 * Sets @iter to point to @char_offset. @char_offset counts from the start
1453 	 * of the entire text buffer, starting with 0.
1454 	 *
1455 	 * Params:
1456 	 *     charOffset = a character number
1457 	 */
1458 	public void setOffset(int charOffset)
1459 	{
1460 		gtk_text_iter_set_offset(gtkTextIter, charOffset);
1461 	}
1462 
1463 	/**
1464 	 * Like gtk_text_iter_set_line_index(), but the index is in visible
1465 	 * bytes, i.e. text with a tag making it invisible is not counted
1466 	 * in the index.
1467 	 *
1468 	 * Params:
1469 	 *     byteOnLine = a byte index
1470 	 */
1471 	public void setVisibleLineIndex(int byteOnLine)
1472 	{
1473 		gtk_text_iter_set_visible_line_index(gtkTextIter, byteOnLine);
1474 	}
1475 
1476 	/**
1477 	 * Like gtk_text_iter_set_line_offset(), but the offset is in visible
1478 	 * characters, i.e. text with a tag making it invisible is not
1479 	 * counted in the offset.
1480 	 *
1481 	 * Params:
1482 	 *     charOnLine = a character offset
1483 	 */
1484 	public void setVisibleLineOffset(int charOnLine)
1485 	{
1486 		gtk_text_iter_set_visible_line_offset(gtkTextIter, charOnLine);
1487 	}
1488 
1489 	/**
1490 	 * Returns %TRUE if @iter begins a paragraph,
1491 	 * i.e. if gtk_text_iter_get_line_offset() would return 0.
1492 	 * However this function is potentially more efficient than
1493 	 * gtk_text_iter_get_line_offset() because it doesn’t have to compute
1494 	 * the offset, it just has to see whether it’s 0.
1495 	 *
1496 	 * Return: whether @iter begins a line
1497 	 */
1498 	public bool startsLine()
1499 	{
1500 		return gtk_text_iter_starts_line(gtkTextIter) != 0;
1501 	}
1502 
1503 	/**
1504 	 * Determines whether @iter begins a sentence.  Sentence boundaries are
1505 	 * determined by Pango and should be correct for nearly any language
1506 	 * (if not, the correct fix would be to the Pango text boundary
1507 	 * algorithms).
1508 	 *
1509 	 * Return: %TRUE if @iter is at the start of a sentence.
1510 	 */
1511 	public bool startsSentence()
1512 	{
1513 		return gtk_text_iter_starts_sentence(gtkTextIter) != 0;
1514 	}
1515 
1516 	/**
1517 	 * Determines whether @iter begins a natural-language word.  Word
1518 	 * breaks are determined by Pango and should be correct for nearly any
1519 	 * language (if not, the correct fix would be to the Pango word break
1520 	 * algorithms).
1521 	 *
1522 	 * Return: %TRUE if @iter is at the start of a word
1523 	 */
1524 	public bool startsWord()
1525 	{
1526 		return gtk_text_iter_starts_word(gtkTextIter) != 0;
1527 	}
1528 
1529 	/**
1530 	 * This is equivalent to (gtk_text_iter_begins_tag() ||
1531 	 * gtk_text_iter_ends_tag()), i.e. it tells you whether a range with
1532 	 * @tag applied to it begins or ends at @iter.
1533 	 *
1534 	 * Params:
1535 	 *     tag = a #GtkTextTag, or %NULL
1536 	 *
1537 	 * Return: whether @tag is toggled on or off at @iter
1538 	 */
1539 	public bool togglesTag(TextTag tag)
1540 	{
1541 		return gtk_text_iter_toggles_tag(gtkTextIter, (tag is null) ? null : tag.getTextTagStruct()) != 0;
1542 	}
1543 }