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 atk.SelectionIF;
26 
27 private import atk.ObjectAtk;
28 private import atk.c.functions;
29 public  import atk.c.types;
30 private import gobject.ObjectG;
31 private import gobject.Signals;
32 private import std.algorithm;
33 
34 
35 /**
36  * #AtkSelection should be implemented by UI components with children
37  * which are exposed by #atk_object_ref_child and
38  * #atk_object_get_n_children, if the use of the parent UI component
39  * ordinarily involves selection of one or more of the objects
40  * corresponding to those #AtkObject children - for example,
41  * selectable lists.
42  * 
43  * Note that other types of "selection" (for instance text selection)
44  * are accomplished a other ATK interfaces - #AtkSelection is limited
45  * to the selection/deselection of children.
46  */
47 public interface SelectionIF{
48 	/** Get the main Gtk struct */
49 	public AtkSelection* getSelectionStruct(bool transferOwnership = false);
50 
51 	/** the main Gtk struct as a void* */
52 	protected void* getStruct();
53 
54 
55 	/** */
56 	public static GType getType()
57 	{
58 		return atk_selection_get_type();
59 	}
60 
61 	/**
62 	 * Adds the specified accessible child of the object to the
63 	 * object's selection.
64 	 *
65 	 * Params:
66 	 *     i = a #gint specifying the child index.
67 	 *
68 	 * Returns: TRUE if success, FALSE otherwise.
69 	 */
70 	public bool addSelection(int i);
71 
72 	/**
73 	 * Clears the selection in the object so that no children in the object
74 	 * are selected.
75 	 *
76 	 * Returns: TRUE if success, FALSE otherwise.
77 	 */
78 	public bool clearSelection();
79 
80 	/**
81 	 * Gets the number of accessible children currently selected.
82 	 * Note: callers should not rely on %NULL or on a zero value for
83 	 * indication of whether AtkSelectionIface is implemented, they should
84 	 * use type checking/interface checking macros or the
85 	 * atk_get_accessible_value() convenience method.
86 	 *
87 	 * Returns: a gint representing the number of items selected, or 0
88 	 *     if @selection does not implement this interface.
89 	 */
90 	public int getSelectionCount();
91 
92 	/**
93 	 * Determines if the current child of this object is selected
94 	 * Note: callers should not rely on %NULL or on a zero value for
95 	 * indication of whether AtkSelectionIface is implemented, they should
96 	 * use type checking/interface checking macros or the
97 	 * atk_get_accessible_value() convenience method.
98 	 *
99 	 * Params:
100 	 *     i = a #gint specifying the child index.
101 	 *
102 	 * Returns: a gboolean representing the specified child is selected, or 0
103 	 *     if @selection does not implement this interface.
104 	 */
105 	public bool isChildSelected(int i);
106 
107 	/**
108 	 * Gets a reference to the accessible object representing the specified
109 	 * selected child of the object.
110 	 * Note: callers should not rely on %NULL or on a zero value for
111 	 * indication of whether AtkSelectionIface is implemented, they should
112 	 * use type checking/interface checking macros or the
113 	 * atk_get_accessible_value() convenience method.
114 	 *
115 	 * Params:
116 	 *     i = a #gint specifying the index in the selection set.  (e.g. the
117 	 *         ith selection as opposed to the ith child).
118 	 *
119 	 * Returns: an #AtkObject representing the
120 	 *     selected accessible, or %NULL if @selection does not implement this
121 	 *     interface.
122 	 */
123 	public ObjectAtk refSelection(int i);
124 
125 	/**
126 	 * Removes the specified child of the object from the object's selection.
127 	 *
128 	 * Params:
129 	 *     i = a #gint specifying the index in the selection set.  (e.g. the
130 	 *         ith selection as opposed to the ith child).
131 	 *
132 	 * Returns: TRUE if success, FALSE otherwise.
133 	 */
134 	public bool removeSelection(int i);
135 
136 	/**
137 	 * Causes every child of the object to be selected if the object
138 	 * supports multiple selections.
139 	 *
140 	 * Returns: TRUE if success, FALSE otherwise.
141 	 */
142 	public bool selectAllSelection();
143 
144 	/**
145 	 * The "selection-changed" signal is emitted by an object which
146 	 * implements AtkSelection interface when the selection changes.
147 	 */
148 	gulong addOnSelectionChanged(void delegate(SelectionIF) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0);
149 }