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 gsvc.gsv;
29 public  import gsvc.gsvtypes;
30 public  import gtkc.gdktypes;
31 
32 
33 public template SourceUndoManagerT(TStruct)
34 {
35 	/** Get the main Gtk struct */
36 	public GtkSourceUndoManager* getSourceUndoManagerStruct()
37 	{
38 		return cast(GtkSourceUndoManager*)getStruct();
39 	}
40 
41 	/**
42 	 */
43 
44 	/**
45 	 * Begin a not undoable action on the buffer. All changes between this call
46 	 * and the call to gtk_source_undo_manager_end_not_undoable_action() cannot
47 	 * be undone. This function should be re-entrant.
48 	 *
49 	 * Since: 2.10
50 	 */
51 	public void beginNotUndoableAction()
52 	{
53 		gtk_source_undo_manager_begin_not_undoable_action(getSourceUndoManagerStruct());
54 	}
55 
56 	/**
57 	 * Get whether there are redo operations available.
58 	 *
59 	 * Return: %TRUE if there are redo operations available, %FALSE otherwise
60 	 *
61 	 * Since: 2.10
62 	 */
63 	public bool canRedo()
64 	{
65 		return gtk_source_undo_manager_can_redo(getSourceUndoManagerStruct()) != 0;
66 	}
67 
68 	/**
69 	 * Emits the #GtkSourceUndoManager::can-redo-changed signal.
70 	 *
71 	 * Since: 2.10
72 	 */
73 	public void canRedoChanged()
74 	{
75 		gtk_source_undo_manager_can_redo_changed(getSourceUndoManagerStruct());
76 	}
77 
78 	/**
79 	 * Get whether there are undo operations available.
80 	 *
81 	 * Return: %TRUE if there are undo operations available, %FALSE otherwise
82 	 *
83 	 * Since: 2.10
84 	 */
85 	public bool canUndo()
86 	{
87 		return gtk_source_undo_manager_can_undo(getSourceUndoManagerStruct()) != 0;
88 	}
89 
90 	/**
91 	 * Emits the #GtkSourceUndoManager::can-undo-changed signal.
92 	 *
93 	 * Since: 2.10
94 	 */
95 	public void canUndoChanged()
96 	{
97 		gtk_source_undo_manager_can_undo_changed(getSourceUndoManagerStruct());
98 	}
99 
100 	/**
101 	 * Ends a not undoable action on the buffer.
102 	 *
103 	 * Since: 2.10
104 	 */
105 	public void endNotUndoableAction()
106 	{
107 		gtk_source_undo_manager_end_not_undoable_action(getSourceUndoManagerStruct());
108 	}
109 
110 	/**
111 	 * Perform a single redo. Calling this function when there are no redo operations
112 	 * available is an error. Use gtk_source_undo_manager_can_redo() to find out
113 	 * if there are redo operations available.
114 	 *
115 	 * Since: 2.10
116 	 */
117 	public void redo()
118 	{
119 		gtk_source_undo_manager_redo(getSourceUndoManagerStruct());
120 	}
121 
122 	/**
123 	 * Perform a single undo. Calling this function when there are no undo operations
124 	 * available is an error. Use gtk_source_undo_manager_can_undo() to find out
125 	 * if there are undo operations available.
126 	 *
127 	 * Since: 2.10
128 	 */
129 	public void undo()
130 	{
131 		gtk_source_undo_manager_undo(getSourceUndoManagerStruct());
132 	}
133 
134 	int[string] connectedSignals;
135 
136 	void delegate(SourceUndoManagerIF)[] _onCanRedoChangedListeners;
137 	@property void delegate(SourceUndoManagerIF)[] onCanRedoChangedListeners()
138 	{
139 		return _onCanRedoChangedListeners;
140 	}
141 	/**
142 	 * Emitted when the ability to redo has changed.
143 	 *
144 	 * Since: 2.10
145 	 */
146 	void addOnCanRedoChanged(void delegate(SourceUndoManagerIF) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
147 	{
148 		if ( "can-redo-changed" !in connectedSignals )
149 		{
150 			Signals.connectData(
151 				this,
152 				"can-redo-changed",
153 				cast(GCallback)&callBackCanRedoChanged,
154 				cast(void*)cast(SourceUndoManagerIF)this,
155 				null,
156 				connectFlags);
157 			connectedSignals["can-redo-changed"] = 1;
158 		}
159 		_onCanRedoChangedListeners ~= dlg;
160 	}
161 	extern(C) static void callBackCanRedoChanged(GtkSourceUndoManager* sourceundomanagerStruct, SourceUndoManagerIF _sourceundomanager)
162 	{
163 		foreach ( void delegate(SourceUndoManagerIF) dlg; _sourceundomanager.onCanRedoChangedListeners )
164 		{
165 			dlg(_sourceundomanager);
166 		}
167 	}
168 
169 	void delegate(SourceUndoManagerIF)[] _onCanUndoChangedListeners;
170 	@property void delegate(SourceUndoManagerIF)[] onCanUndoChangedListeners()
171 	{
172 		return _onCanUndoChangedListeners;
173 	}
174 	/**
175 	 * Emitted when the ability to undo has changed.
176 	 *
177 	 * Since: 2.10
178 	 */
179 	void addOnCanUndoChanged(void delegate(SourceUndoManagerIF) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
180 	{
181 		if ( "can-undo-changed" !in connectedSignals )
182 		{
183 			Signals.connectData(
184 				this,
185 				"can-undo-changed",
186 				cast(GCallback)&callBackCanUndoChanged,
187 				cast(void*)cast(SourceUndoManagerIF)this,
188 				null,
189 				connectFlags);
190 			connectedSignals["can-undo-changed"] = 1;
191 		}
192 		_onCanUndoChangedListeners ~= dlg;
193 	}
194 	extern(C) static void callBackCanUndoChanged(GtkSourceUndoManager* sourceundomanagerStruct, SourceUndoManagerIF _sourceundomanager)
195 	{
196 		foreach ( void delegate(SourceUndoManagerIF) dlg; _sourceundomanager.onCanUndoChangedListeners )
197 		{
198 			dlg(_sourceundomanager);
199 		}
200 	}
201 }