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