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 gsv.SourceUndoManagerT;
26 
27 public  import gobject.Signals;
28 public  import gsv.c.functions;
29 public  import gsv.c.types;
30 public  import gsvc.gsvtypes;
31 public  import std.algorithm;
32 
33 
34 /** */
35 public template SourceUndoManagerT(TStruct)
36 {
37 	/** Get the main Gtk struct */
38 	public GtkSourceUndoManager* getSourceUndoManagerStruct(bool transferOwnership = false)
39 	{
40 		if (transferOwnership)
41 			ownedRef = false;
42 		return cast(GtkSourceUndoManager*)getStruct();
43 	}
44 
45 
46 	/**
47 	 * Begin a not undoable action on the buffer. All changes between this call
48 	 * and the call to gtk_source_undo_manager_end_not_undoable_action() cannot
49 	 * be undone. This function should be re-entrant.
50 	 *
51 	 * Since: 2.10
52 	 */
53 	public void beginNotUndoableAction()
54 	{
55 		gtk_source_undo_manager_begin_not_undoable_action(getSourceUndoManagerStruct());
56 	}
57 
58 	/**
59 	 * Get whether there are redo operations available.
60 	 *
61 	 * Returns: %TRUE if there are redo operations available, %FALSE otherwise
62 	 *
63 	 * Since: 2.10
64 	 */
65 	public bool canRedo()
66 	{
67 		return gtk_source_undo_manager_can_redo(getSourceUndoManagerStruct()) != 0;
68 	}
69 
70 	/**
71 	 * Emits the #GtkSourceUndoManager::can-redo-changed signal.
72 	 *
73 	 * Since: 2.10
74 	 */
75 	public void canRedoChanged()
76 	{
77 		gtk_source_undo_manager_can_redo_changed(getSourceUndoManagerStruct());
78 	}
79 
80 	/**
81 	 * Get whether there are undo operations available.
82 	 *
83 	 * Returns: %TRUE if there are undo operations available, %FALSE otherwise
84 	 *
85 	 * Since: 2.10
86 	 */
87 	public bool canUndo()
88 	{
89 		return gtk_source_undo_manager_can_undo(getSourceUndoManagerStruct()) != 0;
90 	}
91 
92 	/**
93 	 * Emits the #GtkSourceUndoManager::can-undo-changed signal.
94 	 *
95 	 * Since: 2.10
96 	 */
97 	public void canUndoChanged()
98 	{
99 		gtk_source_undo_manager_can_undo_changed(getSourceUndoManagerStruct());
100 	}
101 
102 	/**
103 	 * Ends a not undoable action on the buffer.
104 	 *
105 	 * Since: 2.10
106 	 */
107 	public void endNotUndoableAction()
108 	{
109 		gtk_source_undo_manager_end_not_undoable_action(getSourceUndoManagerStruct());
110 	}
111 
112 	/**
113 	 * Perform a single redo. Calling this function when there are no redo operations
114 	 * available is an error. Use gtk_source_undo_manager_can_redo() to find out
115 	 * if there are redo operations available.
116 	 *
117 	 * Since: 2.10
118 	 */
119 	public void redo()
120 	{
121 		gtk_source_undo_manager_redo(getSourceUndoManagerStruct());
122 	}
123 
124 	/**
125 	 * Perform a single undo. Calling this function when there are no undo operations
126 	 * available is an error. Use gtk_source_undo_manager_can_undo() to find out
127 	 * if there are undo operations available.
128 	 *
129 	 * Since: 2.10
130 	 */
131 	public void undo()
132 	{
133 		gtk_source_undo_manager_undo(getSourceUndoManagerStruct());
134 	}
135 
136 	/**
137 	 * Emitted when the ability to redo has changed.
138 	 *
139 	 * Since: 2.10
140 	 */
141 	gulong addOnCanRedoChanged(void delegate(SourceUndoManagerIF) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
142 	{
143 		return Signals.connect(this, "can-redo-changed", dlg, connectFlags ^ ConnectFlags.SWAPPED);
144 	}
145 
146 	/**
147 	 * Emitted when the ability to undo has changed.
148 	 *
149 	 * Since: 2.10
150 	 */
151 	gulong addOnCanUndoChanged(void delegate(SourceUndoManagerIF) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
152 	{
153 		return Signals.connect(this, "can-undo-changed", dlg, connectFlags ^ ConnectFlags.SWAPPED);
154 	}
155 }