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  * Conversion parameters:
26  * inFile  = GtkSourceUndoManager.html
27  * outPack = gsv
28  * outFile = SourceUndoManagerT
29  * strct   = GtkSourceUndoManager
30  * realStrct=
31  * ctorStrct=
32  * clss    = SourceUndoManagerT
33  * interf  = SourceUndoManagerIF
34  * class Code: No
35  * interface Code: No
36  * template for:
37  * 	- TStruct
38  * extend  = 
39  * implements:
40  * prefixes:
41  * 	- gtk_source_undo_manager_
42  * omit structs:
43  * omit prefixes:
44  * omit code:
45  * omit signals:
46  * imports:
47  * structWrap:
48  * module aliases:
49  * local aliases:
50  * overrides:
51  */
52 
53 module gsv.SourceUndoManagerT;
54 
55 public  import gsvc.gsvtypes;
56 
57 public import gsvc.gsv;
58 public import glib.ConstructionException;
59 public import gobject.ObjectG;
60 
61 public import gobject.Signals;
62 public  import gtkc.gdktypes;
63 
64 
65 
66 
67 
68 /**
69  * The GtkSourceUndoManager interface can be implemented to provide custom
70  * undo management to a GtkSourceBuffer. Use
71  * gtk_source_buffer_set_undo_manager() to install a custom undo manager for
72  * a particular source buffer.
73  *
74  * Use gtk_source_undo_manager_can_undo_changed() and
75  * gtk_source_undo_manager_can_redo_changed() when respectively the undo state
76  * or redo state of the undo stack has changed.
77  */
78 public template SourceUndoManagerT(TStruct)
79 {
80 	
81 	/** the main Gtk struct */
82 	protected GtkSourceUndoManager* gtkSourceUndoManager;
83 	
84 	
85 	public GtkSourceUndoManager* getSourceUndoManagerTStruct()
86 	{
87 		return cast(GtkSourceUndoManager*)getStruct();
88 	}
89 	
90 	
91 	/**
92 	 */
93 	int[string] connectedSignals;
94 	
95 	void delegate(SourceUndoManagerIF)[] _onCanRedoChangedListeners;
96 	void delegate(SourceUndoManagerIF)[] onCanRedoChangedListeners()
97 	{
98 		return  _onCanRedoChangedListeners;
99 	}
100 	/**
101 	 * Emitted when the ability to redo has changed.
102 	 * Since 2.10
103 	 */
104 	void addOnCanRedoChanged(void delegate(SourceUndoManagerIF) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
105 	{
106 		if ( !("can-redo-changed" in connectedSignals) )
107 		{
108 			Signals.connectData(
109 			getStruct(),
110 			"can-redo-changed",
111 			cast(GCallback)&callBackCanRedoChanged,
112 			cast(void*)cast(SourceUndoManagerIF)this,
113 			null,
114 			connectFlags);
115 			connectedSignals["can-redo-changed"] = 1;
116 		}
117 		_onCanRedoChangedListeners ~= dlg;
118 	}
119 	extern(C) static void callBackCanRedoChanged(GtkSourceUndoManager* managerStruct, SourceUndoManagerIF _sourceUndoManagerIF)
120 	{
121 		foreach ( void delegate(SourceUndoManagerIF) dlg ; _sourceUndoManagerIF.onCanRedoChangedListeners )
122 		{
123 			dlg(_sourceUndoManagerIF);
124 		}
125 	}
126 	
127 	void delegate(SourceUndoManagerIF)[] _onCanUndoChangedListeners;
128 	void delegate(SourceUndoManagerIF)[] onCanUndoChangedListeners()
129 	{
130 		return  _onCanUndoChangedListeners;
131 	}
132 	/**
133 	 * Emitted when the ability to undo has changed.
134 	 * Since 2.10
135 	 * See Also
136 	 * GtkTextBuffer, GtkSourceView
137 	 */
138 	void addOnCanUndoChanged(void delegate(SourceUndoManagerIF) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
139 	{
140 		if ( !("can-undo-changed" in connectedSignals) )
141 		{
142 			Signals.connectData(
143 			getStruct(),
144 			"can-undo-changed",
145 			cast(GCallback)&callBackCanUndoChanged,
146 			cast(void*)cast(SourceUndoManagerIF)this,
147 			null,
148 			connectFlags);
149 			connectedSignals["can-undo-changed"] = 1;
150 		}
151 		_onCanUndoChangedListeners ~= dlg;
152 	}
153 	extern(C) static void callBackCanUndoChanged(GtkSourceUndoManager* managerStruct, SourceUndoManagerIF _sourceUndoManagerIF)
154 	{
155 		foreach ( void delegate(SourceUndoManagerIF) dlg ; _sourceUndoManagerIF.onCanUndoChangedListeners )
156 		{
157 			dlg(_sourceUndoManagerIF);
158 		}
159 	}
160 	
161 	
162 	/**
163 	 * Get whether there are undo operations available.
164 	 * Since 2.10
165 	 * Returns: TRUE if there are undo operations available, FALSE otherwise
166 	 */
167 	public int canUndo()
168 	{
169 		// gboolean gtk_source_undo_manager_can_undo (GtkSourceUndoManager *manager);
170 		return gtk_source_undo_manager_can_undo(getSourceUndoManagerTStruct());
171 	}
172 	
173 	/**
174 	 * Get whether there are redo operations available.
175 	 * Since 2.10
176 	 * Returns: TRUE if there are redo operations available, FALSE otherwise
177 	 */
178 	public int canRedo()
179 	{
180 		// gboolean gtk_source_undo_manager_can_redo (GtkSourceUndoManager *manager);
181 		return gtk_source_undo_manager_can_redo(getSourceUndoManagerTStruct());
182 	}
183 	
184 	/**
185 	 * Perform a single undo. Calling this function when there are no undo operations
186 	 * available is an error. Use gtk_source_undo_manager_can_undo() to find out
187 	 * if there are undo operations available.
188 	 * Since 2.10
189 	 */
190 	public void undo()
191 	{
192 		// void gtk_source_undo_manager_undo (GtkSourceUndoManager *manager);
193 		gtk_source_undo_manager_undo(getSourceUndoManagerTStruct());
194 	}
195 	
196 	/**
197 	 * Perform a single redo. Calling this function when there are no redo operations
198 	 * available is an error. Use gtk_source_undo_manager_can_redo() to find out
199 	 * if there are redo operations available.
200 	 * Since 2.10
201 	 */
202 	public void redo()
203 	{
204 		// void gtk_source_undo_manager_redo (GtkSourceUndoManager *manager);
205 		gtk_source_undo_manager_redo(getSourceUndoManagerTStruct());
206 	}
207 	
208 	/**
209 	 * Begin a not undoable action on the buffer. All changes between this call
210 	 * and the call to gtk_source_undo_manager_end_not_undoable_action() cannot
211 	 * be undone. This function should be re-entrant.
212 	 * Since 2.10
213 	 */
214 	public void beginNotUndoableAction()
215 	{
216 		// void gtk_source_undo_manager_begin_not_undoable_action  (GtkSourceUndoManager *manager);
217 		gtk_source_undo_manager_begin_not_undoable_action(getSourceUndoManagerTStruct());
218 	}
219 	
220 	/**
221 	 * Ends a not undoable action on the buffer.
222 	 * Since 2.10
223 	 */
224 	public void endNotUndoableAction()
225 	{
226 		// void gtk_source_undo_manager_end_not_undoable_action  (GtkSourceUndoManager *manager);
227 		gtk_source_undo_manager_end_not_undoable_action(getSourceUndoManagerTStruct());
228 	}
229 	
230 	/**
231 	 * Emits the "can-undo-changed" signal.
232 	 * Since 2.10
233 	 */
234 	public void canUndoChanged()
235 	{
236 		// void gtk_source_undo_manager_can_undo_changed  (GtkSourceUndoManager *manager);
237 		gtk_source_undo_manager_can_undo_changed(getSourceUndoManagerTStruct());
238 	}
239 	
240 	/**
241 	 * Emits the "can-redo-changed" signal.
242 	 * Since 2.10
243 	 * Signal Details
244 	 * The "can-redo-changed" signal
245 	 * void user_function (GtkSourceUndoManager *manager,
246 	 *  gpointer user_data) : Action
247 	 * Emitted when the ability to redo has changed.
248 	 * Since 2.10
249 	 */
250 	public void canRedoChanged()
251 	{
252 		// void gtk_source_undo_manager_can_redo_changed  (GtkSourceUndoManager *manager);
253 		gtk_source_undo_manager_can_redo_changed(getSourceUndoManagerTStruct());
254 	}
255 }