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.Text;
26 
27 private import gio.MenuModel;
28 private import glib.ConstructionException;
29 private import glib.Str;
30 private import glib.c.functions;
31 private import gobject.ObjectG;
32 private import gobject.Signals;
33 private import gtk.EditableIF;
34 private import gtk.EditableT;
35 private import gtk.EntryBuffer;
36 private import gtk.Widget;
37 private import gtk.c.functions;
38 public  import gtk.c.types;
39 private import pango.PgAttributeList;
40 private import pango.PgTabArray;
41 private import std.algorithm;
42 
43 
44 /**
45  * The `GtkText` widget is a single-line text entry widget.
46  * 
47  * `GtkText` is the common implementation of single-line text editing
48  * that is shared between `GtkEntry`, `GtkPasswordEntry, `GtkSpinButton`
49  * and other widgets. In all of these, `GtkText` is used as the delegate
50  * for the [iface@Gtk.Editable] implementation.
51  * 
52  * A fairly large set of key bindings are supported by default. If the
53  * entered text is longer than the allocation of the widget, the widget
54  * will scroll so that the cursor position is visible.
55  * 
56  * When using an entry for passwords and other sensitive information,
57  * it can be put into “password mode” using [method@Gtk.Text.set_visibility].
58  * In this mode, entered text is displayed using a “invisible” character.
59  * By default, GTK picks the best invisible character that is available
60  * in the current font, but it can be changed with
61  * [method@Gtk.Text.set_invisible_char].
62  * 
63  * If you are looking to add icons or progress display in an entry, look
64  * at `GtkEntry`. There other alternatives for more specialized use cases,
65  * such as `GtkSearchEntry`.
66  * 
67  * If you need multi-line editable text, look at `GtkTextView`.
68  * 
69  * # CSS nodes
70  * 
71  * ```
72  * text[.read-only]
73  * ├── placeholder
74  * ├── undershoot.left
75  * ├── undershoot.right
76  * ├── [selection]
77  * ├── [block-cursor]
78  * ╰── [window.popup]
79  * ```
80  * 
81  * `GtkText` has a main node with the name text. Depending on the properties
82  * of the widget, the .read-only style class may appear.
83  * 
84  * When the entry has a selection, it adds a subnode with the name selection.
85  * 
86  * When the entry is in overwrite mode, it adds a subnode with the name
87  * block-cursor that determines how the block cursor is drawn.
88  * 
89  * The CSS node for a context menu is added as a subnode below text as well.
90  * 
91  * The undershoot nodes are used to draw the underflow indication when content
92  * is scrolled out of view. These nodes get the .left and .right style classes
93  * added depending on where the indication is drawn.
94  * 
95  * When touch is used and touch selection handles are shown, they are using
96  * CSS nodes with name cursor-handle. They get the .top or .bottom style class
97  * depending on where they are shown in relation to the selection. If there is
98  * just a single handle for the text cursor, it gets the style class
99  * .insertion-cursor.
100  * 
101  * # Accessibility
102  * 
103  * `GtkText` uses the %GTK_ACCESSIBLE_ROLE_NONE role, which causes it to be
104  * skipped for accessibility. This is because `GtkText` is expected to be used
105  * as a delegate for a `GtkEditable` implementation that will be represented
106  * to accessibility.
107  */
108 public class Text : Widget, EditableIF
109 {
110 	/** the main Gtk struct */
111 	protected GtkText* gtkText;
112 
113 	/** Get the main Gtk struct */
114 	public GtkText* getTextStruct(bool transferOwnership = false)
115 	{
116 		if (transferOwnership)
117 			ownedRef = false;
118 		return gtkText;
119 	}
120 
121 	/** the main Gtk struct as a void* */
122 	protected override void* getStruct()
123 	{
124 		return cast(void*)gtkText;
125 	}
126 
127 	/**
128 	 * Sets our main struct and passes it to the parent class.
129 	 */
130 	public this (GtkText* gtkText, bool ownedRef = false)
131 	{
132 		this.gtkText = gtkText;
133 		super(cast(GtkWidget*)gtkText, ownedRef);
134 	}
135 
136 	// add the Editable capabilities
137 	mixin EditableT!(GtkText);
138 
139 
140 	/** */
141 	public static GType getType()
142 	{
143 		return gtk_text_get_type();
144 	}
145 
146 	/**
147 	 * Creates a new `GtkText`.
148 	 *
149 	 * Returns: a new `GtkText`.
150 	 *
151 	 * Throws: ConstructionException GTK+ fails to create the object.
152 	 */
153 	public this()
154 	{
155 		auto __p = gtk_text_new();
156 
157 		if(__p is null)
158 		{
159 			throw new ConstructionException("null returned by new");
160 		}
161 
162 		this(cast(GtkText*) __p);
163 	}
164 
165 	/**
166 	 * Creates a new `GtkText` with the specified text buffer.
167 	 *
168 	 * Params:
169 	 *     buffer = The buffer to use for the new `GtkText`.
170 	 *
171 	 * Returns: a new `GtkText`
172 	 *
173 	 * Throws: ConstructionException GTK+ fails to create the object.
174 	 */
175 	public this(EntryBuffer buffer)
176 	{
177 		auto __p = gtk_text_new_with_buffer((buffer is null) ? null : buffer.getEntryBufferStruct());
178 
179 		if(__p is null)
180 		{
181 			throw new ConstructionException("null returned by new_with_buffer");
182 		}
183 
184 		this(cast(GtkText*) __p);
185 	}
186 
187 	/**
188 	 * Retrieves the value set by gtk_text_set_activates_default().
189 	 *
190 	 * Returns: %TRUE if the `GtkText` will activate the default widget
191 	 */
192 	public bool getActivatesDefault()
193 	{
194 		return gtk_text_get_activates_default(gtkText) != 0;
195 	}
196 
197 	/**
198 	 * Gets the attribute list that was set on the `GtkText`
199 	 * using gtk_text_set_attributes().
200 	 *
201 	 * Returns: the attribute list,
202 	 *     or %NULL if none was set.
203 	 */
204 	public PgAttributeList getAttributes()
205 	{
206 		auto __p = gtk_text_get_attributes(gtkText);
207 
208 		if(__p is null)
209 		{
210 			return null;
211 		}
212 
213 		return ObjectG.getDObject!(PgAttributeList)(cast(PangoAttrList*) __p);
214 	}
215 
216 	/**
217 	 * Get the `GtkEntryBuffer` object which holds the text for
218 	 * this self.
219 	 *
220 	 * Returns: A `GtkEntryBuffer` object.
221 	 */
222 	public EntryBuffer getBuffer()
223 	{
224 		auto __p = gtk_text_get_buffer(gtkText);
225 
226 		if(__p is null)
227 		{
228 			return null;
229 		}
230 
231 		return ObjectG.getDObject!(EntryBuffer)(cast(GtkEntryBuffer*) __p);
232 	}
233 
234 	/**
235 	 * Returns whether Emoji completion is enabled for this
236 	 * `GtkText` widget.
237 	 *
238 	 * Returns: %TRUE if Emoji completion is enabled
239 	 */
240 	public bool getEnableEmojiCompletion()
241 	{
242 		return gtk_text_get_enable_emoji_completion(gtkText) != 0;
243 	}
244 
245 	/**
246 	 * Gets the menu model set with gtk_text_set_extra_menu().
247 	 *
248 	 * Returns: the menu model
249 	 */
250 	public MenuModel getExtraMenu()
251 	{
252 		auto __p = gtk_text_get_extra_menu(gtkText);
253 
254 		if(__p is null)
255 		{
256 			return null;
257 		}
258 
259 		return ObjectG.getDObject!(MenuModel)(cast(GMenuModel*) __p);
260 	}
261 
262 	/**
263 	 * Gets the input hints of the `GtkText`.
264 	 */
265 	public GtkInputHints getInputHints()
266 	{
267 		return gtk_text_get_input_hints(gtkText);
268 	}
269 
270 	/**
271 	 * Gets the input purpose of the `GtkText`.
272 	 */
273 	public GtkInputPurpose getInputPurpose()
274 	{
275 		return gtk_text_get_input_purpose(gtkText);
276 	}
277 
278 	/**
279 	 * Retrieves the character displayed in place of the real characters
280 	 * for entries with visibility set to false.
281 	 *
282 	 * Note that GTK does not compute this value unless it needs it,
283 	 * so the value returned by this function is not very useful unless
284 	 * it has been explicitly set with [method@Gtk.Text.set_invisible_char].
285 	 *
286 	 * Returns: the current invisible char, or 0, if @text does not
287 	 *     show invisible text at all.
288 	 */
289 	public dchar getInvisibleChar()
290 	{
291 		return gtk_text_get_invisible_char(gtkText);
292 	}
293 
294 	/**
295 	 * Retrieves the maximum allowed length of the text in @self.
296 	 *
297 	 * See [method@Gtk.Text.set_max_length].
298 	 *
299 	 * This is equivalent to getting @self's `GtkEntryBuffer` and
300 	 * calling [method@Gtk.EntryBuffer.get_max_length] on it.
301 	 *
302 	 * Returns: the maximum allowed number of characters
303 	 *     in `GtkText`, or 0 if there is no maximum.
304 	 */
305 	public int getMaxLength()
306 	{
307 		return gtk_text_get_max_length(gtkText);
308 	}
309 
310 	/**
311 	 * Gets the value set by gtk_text_set_overwrite_mode().
312 	 *
313 	 * Returns: whether the text is overwritten when typing.
314 	 */
315 	public bool getOverwriteMode()
316 	{
317 		return gtk_text_get_overwrite_mode(gtkText) != 0;
318 	}
319 
320 	/**
321 	 * Retrieves the text that will be displayed when
322 	 * @self is empty and unfocused
323 	 *
324 	 * Returns: a pointer
325 	 *     to the placeholder text as a string. This string
326 	 *     points to internally allocated storage in the widget
327 	 *     and must not be freed, modified or stored. If no placeholder
328 	 *     text has been set, %NULL will be returned.
329 	 */
330 	public string getPlaceholderText()
331 	{
332 		return Str.toString(gtk_text_get_placeholder_text(gtkText));
333 	}
334 
335 	/**
336 	 * Returns whether the `GtkText` will grow and shrink
337 	 * with the content.
338 	 *
339 	 * Returns: %TRUE if @self will propagate the text width
340 	 */
341 	public bool getPropagateTextWidth()
342 	{
343 		return gtk_text_get_propagate_text_width(gtkText) != 0;
344 	}
345 
346 	/**
347 	 * Gets the tabstops that were set on the `GtkText`
348 	 * using gtk_text_set_tabs().
349 	 *
350 	 * Returns: the tabstops,
351 	 *     or %NULL if none was set.
352 	 */
353 	public PgTabArray getTabs()
354 	{
355 		auto __p = gtk_text_get_tabs(gtkText);
356 
357 		if(__p is null)
358 		{
359 			return null;
360 		}
361 
362 		return ObjectG.getDObject!(PgTabArray)(cast(PangoTabArray*) __p);
363 	}
364 
365 	/**
366 	 * Retrieves the current length of the text in @self.
367 	 *
368 	 * This is equivalent to getting @self's `GtkEntryBuffer`
369 	 * and calling [method@Gtk.EntryBuffer.get_length] on it.
370 	 *
371 	 * Returns: the current number of characters
372 	 *     in `GtkText`, or 0 if there are none.
373 	 */
374 	public ushort getTextLength()
375 	{
376 		return gtk_text_get_text_length(gtkText);
377 	}
378 
379 	/**
380 	 * Returns whether the `GtkText` will truncate multi-line text
381 	 * that is pasted into the widget
382 	 *
383 	 * Returns: %TRUE if @self will truncate multi-line text
384 	 */
385 	public bool getTruncateMultiline()
386 	{
387 		return gtk_text_get_truncate_multiline(gtkText) != 0;
388 	}
389 
390 	/**
391 	 * Retrieves whether the text in @self is visible.
392 	 *
393 	 * Returns: %TRUE if the text is currently visible
394 	 */
395 	public bool getVisibility()
396 	{
397 		return gtk_text_get_visibility(gtkText) != 0;
398 	}
399 
400 	/**
401 	 * Causes @self to have keyboard focus.
402 	 *
403 	 * It behaves like [method@Gtk.Widget.grab_focus],
404 	 * except that it doesn't select the contents of @self.
405 	 * You only want to call this on some special entries
406 	 * which the user usually doesn't want to replace all text in,
407 	 * such as search-as-you-type entries.
408 	 *
409 	 * Returns: %TRUE if focus is now inside @self
410 	 */
411 	public bool grabFocusWithoutSelecting()
412 	{
413 		return gtk_text_grab_focus_without_selecting(gtkText) != 0;
414 	}
415 
416 	/**
417 	 * If @activates is %TRUE, pressing Enter in the @self will
418 	 * activate the default widget for the window containing @self.
419 	 *
420 	 * This usually means that the dialog containing the `GtkText`
421 	 * will be closed, since the default widget is usually one of
422 	 * the dialog buttons.
423 	 *
424 	 * Params:
425 	 *     activates = %TRUE to activate window’s default widget on Enter keypress
426 	 */
427 	public void setActivatesDefault(bool activates)
428 	{
429 		gtk_text_set_activates_default(gtkText, activates);
430 	}
431 
432 	/**
433 	 * Sets attributes that are applied to the text.
434 	 *
435 	 * Params:
436 	 *     attrs = a `PangoAttrList` or %NULL to unset
437 	 */
438 	public void setAttributes(PgAttributeList attrs)
439 	{
440 		gtk_text_set_attributes(gtkText, (attrs is null) ? null : attrs.getPgAttributeListStruct());
441 	}
442 
443 	/**
444 	 * Set the `GtkEntryBuffer` object which holds the text for
445 	 * this widget.
446 	 *
447 	 * Params:
448 	 *     buffer = a `GtkEntryBuffer`
449 	 */
450 	public void setBuffer(EntryBuffer buffer)
451 	{
452 		gtk_text_set_buffer(gtkText, (buffer is null) ? null : buffer.getEntryBufferStruct());
453 	}
454 
455 	/**
456 	 * Sets whether Emoji completion is enabled.
457 	 *
458 	 * If it is, typing ':', followed by a recognized keyword,
459 	 * will pop up a window with suggested Emojis matching the
460 	 * keyword.
461 	 *
462 	 * Params:
463 	 *     enableEmojiCompletion = %TRUE to enable Emoji completion
464 	 */
465 	public void setEnableEmojiCompletion(bool enableEmojiCompletion)
466 	{
467 		gtk_text_set_enable_emoji_completion(gtkText, enableEmojiCompletion);
468 	}
469 
470 	/**
471 	 * Sets a menu model to add when constructing
472 	 * the context menu for @self.
473 	 *
474 	 * Params:
475 	 *     model = a `GMenuModel`
476 	 */
477 	public void setExtraMenu(MenuModel model)
478 	{
479 		gtk_text_set_extra_menu(gtkText, (model is null) ? null : model.getMenuModelStruct());
480 	}
481 
482 	/**
483 	 * Sets input hints that allow input methods
484 	 * to fine-tune their behaviour.
485 	 *
486 	 * Params:
487 	 *     hints = the hints
488 	 */
489 	public void setInputHints(GtkInputHints hints)
490 	{
491 		gtk_text_set_input_hints(gtkText, hints);
492 	}
493 
494 	/**
495 	 * Sets the input purpose of the `GtkText`.
496 	 *
497 	 * This can be used by on-screen keyboards and other
498 	 * input methods to adjust their behaviour.
499 	 *
500 	 * Params:
501 	 *     purpose = the purpose
502 	 */
503 	public void setInputPurpose(GtkInputPurpose purpose)
504 	{
505 		gtk_text_set_input_purpose(gtkText, purpose);
506 	}
507 
508 	/**
509 	 * Sets the character to use in place of the actual text when
510 	 * in “password mode”.
511 	 *
512 	 * By default, GTK picks the best invisible char available in the
513 	 * current font. If you set the invisible char to 0, then the user
514 	 * will get no feedback at all; there will be no text on the screen
515 	 * as they type.
516 	 *
517 	 * Params:
518 	 *     ch = a Unicode character
519 	 */
520 	public void setInvisibleChar(dchar ch)
521 	{
522 		gtk_text_set_invisible_char(gtkText, ch);
523 	}
524 
525 	/**
526 	 * Sets the maximum allowed length of the contents of the widget.
527 	 *
528 	 * If the current contents are longer than the given length, then
529 	 * they will be truncated to fit.
530 	 *
531 	 * This is equivalent to getting @self's `GtkEntryBuffer` and
532 	 * calling [method@Gtk.EntryBuffer.set_max_length] on it.
533 	 *
534 	 * Params:
535 	 *     length = the maximum length of the `GtkText`, or 0 for no maximum.
536 	 *         (other than the maximum length of entries.) The value passed
537 	 *         in will be clamped to the range 0-65536.
538 	 */
539 	public void setMaxLength(int length)
540 	{
541 		gtk_text_set_max_length(gtkText, length);
542 	}
543 
544 	/**
545 	 * Sets whether the text is overwritten when typing
546 	 * in the `GtkText`.
547 	 *
548 	 * Params:
549 	 *     overwrite = new value
550 	 */
551 	public void setOverwriteMode(bool overwrite)
552 	{
553 		gtk_text_set_overwrite_mode(gtkText, overwrite);
554 	}
555 
556 	/**
557 	 * Sets text to be displayed in @self when it is empty.
558 	 *
559 	 * This can be used to give a visual hint of the expected
560 	 * contents of the `GtkText`.
561 	 *
562 	 * Params:
563 	 *     text = a string to be displayed when @self
564 	 *         is empty and unfocused, or %NULL
565 	 */
566 	public void setPlaceholderText(string text)
567 	{
568 		gtk_text_set_placeholder_text(gtkText, Str.toStringz(text));
569 	}
570 
571 	/**
572 	 * Sets whether the `GtkText` should grow and shrink with the content.
573 	 *
574 	 * Params:
575 	 *     propagateTextWidth = %TRUE to propagate the text width
576 	 */
577 	public void setPropagateTextWidth(bool propagateTextWidth)
578 	{
579 		gtk_text_set_propagate_text_width(gtkText, propagateTextWidth);
580 	}
581 
582 	/**
583 	 * Sets tabstops that are applied to the text.
584 	 *
585 	 * Params:
586 	 *     tabs = a `PangoTabArray`
587 	 */
588 	public void setTabs(PgTabArray tabs)
589 	{
590 		gtk_text_set_tabs(gtkText, (tabs is null) ? null : tabs.getPgTabArrayStruct());
591 	}
592 
593 	/**
594 	 * Sets whether the `GtkText` should truncate multi-line text
595 	 * that is pasted into the widget.
596 	 *
597 	 * Params:
598 	 *     truncateMultiline = %TRUE to truncate multi-line text
599 	 */
600 	public void setTruncateMultiline(bool truncateMultiline)
601 	{
602 		gtk_text_set_truncate_multiline(gtkText, truncateMultiline);
603 	}
604 
605 	/**
606 	 * Sets whether the contents of the `GtkText` are visible or not.
607 	 *
608 	 * When visibility is set to %FALSE, characters are displayed
609 	 * as the invisible char, and will also appear that way when
610 	 * the text in the widget is copied to the clipboard.
611 	 *
612 	 * By default, GTK picks the best invisible character available
613 	 * in the current font, but it can be changed with
614 	 * [method@Gtk.Text.set_invisible_char].
615 	 *
616 	 * Note that you probably want to set [property@Gtk.Text:input-purpose]
617 	 * to %GTK_INPUT_PURPOSE_PASSWORD or %GTK_INPUT_PURPOSE_PIN to
618 	 * inform input methods about the purpose of this self,
619 	 * in addition to setting visibility to %FALSE.
620 	 *
621 	 * Params:
622 	 *     visible = %TRUE if the contents of the `GtkText` are displayed
623 	 *         as plaintext
624 	 */
625 	public void setVisibility(bool visible)
626 	{
627 		gtk_text_set_visibility(gtkText, visible);
628 	}
629 
630 	/**
631 	 * Unsets the invisible char.
632 	 *
633 	 * After calling this, the default invisible
634 	 * char is used again.
635 	 */
636 	public void unsetInvisibleChar()
637 	{
638 		gtk_text_unset_invisible_char(gtkText);
639 	}
640 
641 	/**
642 	 * Emitted when the user hits the Enter key.
643 	 *
644 	 * The default bindings for this signal are all forms
645 	 * of the <kbd>Enter</kbd> key.
646 	 */
647 	gulong addOnActivate(void delegate(Text) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
648 	{
649 		return Signals.connect(this, "activate", dlg, connectFlags ^ ConnectFlags.SWAPPED);
650 	}
651 
652 	/**
653 	 * Emitted when the user asks for it.
654 	 *
655 	 * This is a [keybinding signal](class.SignalAction.html).
656 	 *
657 	 * The default bindings for this signal are
658 	 * <kbd>Backspace</kbd> and <kbd>Shift</kbd>-<kbd>Backspace</kbd>.
659 	 */
660 	gulong addOnBackspace(void delegate(Text) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
661 	{
662 		return Signals.connect(this, "backspace", dlg, connectFlags ^ ConnectFlags.SWAPPED);
663 	}
664 
665 	/**
666 	 * Emitted to copy the selection to the clipboard.
667 	 *
668 	 * This is a [keybinding signal](class.SignalAction.html).
669 	 *
670 	 * The default bindings for this signal are
671 	 * <kbd>Ctrl</kbd>-<kbd>c</kbd> and
672 	 * <kbd>Ctrl</kbd>-<kbd>Insert</kbd>.
673 	 */
674 	gulong addOnCopyClipboard(void delegate(Text) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
675 	{
676 		return Signals.connect(this, "copy-clipboard", dlg, connectFlags ^ ConnectFlags.SWAPPED);
677 	}
678 
679 	/**
680 	 * Emitted to cut the selection to the clipboard.
681 	 *
682 	 * This is a [keybinding signal](class.SignalAction.html).
683 	 *
684 	 * The default bindings for this signal are
685 	 * <kbd>Ctrl</kbd>-<kbd>x</kbd> and
686 	 * <kbd>Shift</kbd>-<kbd>Delete</kbd>.
687 	 */
688 	gulong addOnCutClipboard(void delegate(Text) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
689 	{
690 		return Signals.connect(this, "cut-clipboard", dlg, connectFlags ^ ConnectFlags.SWAPPED);
691 	}
692 
693 	/**
694 	 * Emitted when the user initiates a text deletion.
695 	 *
696 	 * This is a [keybinding signal](class.SignalAction.html).
697 	 *
698 	 * If the @type is %GTK_DELETE_CHARS, GTK deletes the selection
699 	 * if there is one, otherwise it deletes the requested number
700 	 * of characters.
701 	 *
702 	 * The default bindings for this signal are <kbd>Delete</kbd>
703 	 * for deleting a character and <kbd>Ctrl</kbd>-<kbd>Delete</kbd>
704 	 * for deleting a word.
705 	 *
706 	 * Params:
707 	 *     type = the granularity of the deletion, as a #GtkDeleteType
708 	 *     count = the number of @type units to delete
709 	 */
710 	gulong addOnDeleteFromCursor(void delegate(GtkDeleteType, int, Text) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
711 	{
712 		return Signals.connect(this, "delete-from-cursor", dlg, connectFlags ^ ConnectFlags.SWAPPED);
713 	}
714 
715 	/**
716 	 * Emitted when the user initiates the insertion of a
717 	 * fixed string at the cursor.
718 	 *
719 	 * This is a [keybinding signal](class.SignalAction.html).
720 	 *
721 	 * This signal has no default bindings.
722 	 *
723 	 * Params:
724 	 *     string_ = the string to insert
725 	 */
726 	gulong addOnInsertAtCursor(void delegate(string, Text) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
727 	{
728 		return Signals.connect(this, "insert-at-cursor", dlg, connectFlags ^ ConnectFlags.SWAPPED);
729 	}
730 
731 	/**
732 	 * Emitted to present the Emoji chooser for the @self.
733 	 *
734 	 * This is a [keybinding signal](class.SignalAction.html).
735 	 *
736 	 * The default bindings for this signal are
737 	 * <kbd>Ctrl</kbd>-<kbd>.</kbd> and
738 	 * <kbd>Ctrl</kbd>-<kbd>;</kbd>
739 	 */
740 	gulong addOnInsertEmoji(void delegate(Text) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
741 	{
742 		return Signals.connect(this, "insert-emoji", dlg, connectFlags ^ ConnectFlags.SWAPPED);
743 	}
744 
745 	/**
746 	 * Emitted when the user initiates a cursor movement.
747 	 *
748 	 * If the cursor is not visible in @self, this signal causes
749 	 * the viewport to be moved instead.
750 	 *
751 	 * This is a [keybinding signal](class.SignalAction.html).
752 	 *
753 	 * Applications should not connect to it, but may emit it with
754 	 * g_signal_emit_by_name() if they need to control the cursor
755 	 * programmatically.
756 	 *
757 	 * The default bindings for this signal come in two variants,
758 	 * the variant with the <kbd>Shift</kbd> modifier extends the
759 	 * selection, the variant without it does not.
760 	 * There are too many key combinations to list them all here.
761 	 *
762 	 * - <kbd>←</kbd>, <kbd>→</kbd>, <kbd>↑</kbd>, <kbd>↓</kbd>
763 	 * move by individual characters/lines
764 	 * - <kbd>Ctrl</kbd>-<kbd>→</kbd>, etc. move by words/paragraphs
765 	 * - <kbd>Home</kbd>, <kbd>End</kbd> move to the ends of the buffer
766 	 *
767 	 * Params:
768 	 *     step = the granularity of the move, as a #GtkMovementStep
769 	 *     count = the number of @step units to move
770 	 *     extend = %TRUE if the move should extend the selection
771 	 */
772 	gulong addOnMoveCursor(void delegate(GtkMovementStep, int, bool, Text) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
773 	{
774 		return Signals.connect(this, "move-cursor", dlg, connectFlags ^ ConnectFlags.SWAPPED);
775 	}
776 
777 	/**
778 	 * Emitted to paste the contents of the clipboard.
779 	 *
780 	 * This is a [keybinding signal](class.SignalAction.html).
781 	 *
782 	 * The default bindings for this signal are
783 	 * <kbd>Ctrl</kbd>-<kbd>v</kbd> and <kbd>Shift</kbd>-<kbd>Insert</kbd>.
784 	 */
785 	gulong addOnPasteClipboard(void delegate(Text) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
786 	{
787 		return Signals.connect(this, "paste-clipboard", dlg, connectFlags ^ ConnectFlags.SWAPPED);
788 	}
789 
790 	/**
791 	 * Emitted when the preedit text changes.
792 	 *
793 	 * If an input method is used, the typed text will not immediately
794 	 * be committed to the buffer. So if you are interested in the text,
795 	 * connect to this signal.
796 	 *
797 	 * Params:
798 	 *     preedit = the current preedit string
799 	 */
800 	gulong addOnPreeditChanged(void delegate(string, Text) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
801 	{
802 		return Signals.connect(this, "preedit-changed", dlg, connectFlags ^ ConnectFlags.SWAPPED);
803 	}
804 
805 	/**
806 	 * Emitted to toggle the overwrite mode of the `GtkText`.
807 	 *
808 	 * This is a [keybinding signal](class.SignalAction.html).
809 	 *
810 	 * The default bindings for this signal is <kbd>Insert</kbd>.
811 	 */
812 	gulong addOnToggleOverwrite(void delegate(Text) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
813 	{
814 		return Signals.connect(this, "toggle-overwrite", dlg, connectFlags ^ ConnectFlags.SWAPPED);
815 	}
816 }