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