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 gtk.MultiFilter; 26 27 private import gio.ListModelIF; 28 private import gio.ListModelT; 29 private import gtk.BuildableIF; 30 private import gtk.BuildableT; 31 private import gtk.Filter; 32 private import gtk.c.functions; 33 public import gtk.c.types; 34 35 36 /** 37 * `GtkMultiFilter` is the base class for filters that combine multiple filters. 38 */ 39 public class MultiFilter : Filter, ListModelIF, BuildableIF 40 { 41 /** the main Gtk struct */ 42 protected GtkMultiFilter* gtkMultiFilter; 43 44 /** Get the main Gtk struct */ 45 public GtkMultiFilter* getMultiFilterStruct(bool transferOwnership = false) 46 { 47 if (transferOwnership) 48 ownedRef = false; 49 return gtkMultiFilter; 50 } 51 52 /** the main Gtk struct as a void* */ 53 protected override void* getStruct() 54 { 55 return cast(void*)gtkMultiFilter; 56 } 57 58 /** 59 * Sets our main struct and passes it to the parent class. 60 */ 61 public this (GtkMultiFilter* gtkMultiFilter, bool ownedRef = false) 62 { 63 this.gtkMultiFilter = gtkMultiFilter; 64 super(cast(GtkFilter*)gtkMultiFilter, ownedRef); 65 } 66 67 // add the ListModel capabilities 68 mixin ListModelT!(GtkMultiFilter); 69 70 // add the Buildable capabilities 71 mixin BuildableT!(GtkMultiFilter); 72 73 74 /** */ 75 public static GType getType() 76 { 77 return gtk_multi_filter_get_type(); 78 } 79 80 /** 81 * Adds a @filter to @self to use for matching. 82 * 83 * Params: 84 * filter = A new filter to use 85 */ 86 public void append(Filter filter) 87 { 88 gtk_multi_filter_append(gtkMultiFilter, (filter is null) ? null : filter.getFilterStruct()); 89 } 90 91 /** 92 * Removes the filter at the given @position from the list of filters used 93 * by @self. 94 * 95 * If @position is larger than the number of filters, nothing happens and 96 * the function returns. 97 * 98 * Params: 99 * position = position of filter to remove 100 */ 101 public void remove(uint position) 102 { 103 gtk_multi_filter_remove(gtkMultiFilter, position); 104 } 105 }