~ubuntu-branches/ubuntu/trusty/gcr/trusty-proposed

« back to all changes in this revision

Viewing changes to docs/reference/gcr/html/GcrCollectionModel.html

  • Committer: Package Import Robot
  • Author(s): Jordi Mallach
  • Date: 2012-05-03 10:18:39 UTC
  • Revision ID: package-import@ubuntu.com-20120503101839-wuvloldm7gmdsnij
Tags: upstream-3.4.1
Import upstream version 3.4.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
 
2
<html>
 
3
<head>
 
4
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
 
5
<title>GcrCollectionModel</title>
 
6
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
 
7
<link rel="home" href="index.html" title="Gcr Library Reference Manual">
 
8
<link rel="up" href="collections.html" title="Part II. Collections">
 
9
<link rel="prev" href="GcrSimpleCollection.html" title="GcrSimpleCollection">
 
10
<link rel="next" href="widgets.html" title="Part III. Widgets">
 
11
<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
 
12
<link rel="stylesheet" href="style.css" type="text/css">
 
13
</head>
 
14
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
 
15
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
 
16
<tr valign="middle">
 
17
<td><a accesskey="p" href="GcrSimpleCollection.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
 
18
<td><a accesskey="u" href="collections.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
 
19
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
 
20
<th width="100%" align="center">Gcr Library Reference Manual</th>
 
21
<td><a accesskey="n" href="widgets.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
 
22
</tr>
 
23
<tr><td colspan="5" class="shortcuts">
 
24
<a href="#GcrCollectionModel.synopsis" class="shortcut">Top</a>
 
25
                   | 
 
26
                  <a href="#GcrCollectionModel.description" class="shortcut">Description</a>
 
27
                   | 
 
28
                  <a href="#GcrCollectionModel.object-hierarchy" class="shortcut">Object Hierarchy</a>
 
29
                   | 
 
30
                  <a href="#GcrCollectionModel.implemented-interfaces" class="shortcut">Implemented Interfaces</a>
 
31
                   | 
 
32
                  <a href="#GcrCollectionModel.properties" class="shortcut">Properties</a>
 
33
</td></tr>
 
34
</table>
 
35
<div class="refentry">
 
36
<a name="GcrCollectionModel"></a><div class="titlepage"></div>
 
37
<div class="refnamediv"><table width="100%"><tr>
 
38
<td valign="top">
 
39
<h2><span class="refentrytitle"><a name="GcrCollectionModel.top_of_page"></a>GcrCollectionModel</span></h2>
 
40
<p>GcrCollectionModel — A GtkTreeModel that represents a collection</p>
 
41
</td>
 
42
<td valign="top" align="right"></td>
 
43
</tr></table></div>
 
44
<div class="refsynopsisdiv">
 
45
<a name="GcrCollectionModel.synopsis"></a><h2>Synopsis</h2>
 
46
<pre class="synopsis">struct              <a class="link" href="GcrCollectionModel.html#GcrCollectionModel-struct" title="struct GcrCollectionModel">GcrCollectionModel</a>;
 
47
struct              <a class="link" href="GcrCollectionModel.html#GcrCollectionModelClass" title="struct GcrCollectionModelClass">GcrCollectionModelClass</a>;
 
48
enum                <a class="link" href="GcrCollectionModel.html#GcrCollectionModelMode" title="enum GcrCollectionModelMode">GcrCollectionModelMode</a>;
 
49
<a class="link" href="GcrCollectionModel.html" title="GcrCollectionModel"><span class="returnvalue">GcrCollectionModel</span></a> * <a class="link" href="GcrCollectionModel.html#gcr-collection-model-new" title="gcr_collection_model_new ()">gcr_collection_model_new</a>           (<em class="parameter"><code><a class="link" href="GcrCollection.html" title="GcrCollection"><span class="type">GcrCollection</span></a> *collection</code></em>,
 
50
                                                         <em class="parameter"><code><a class="link" href="GcrCollectionModel.html#GcrCollectionModelMode" title="enum GcrCollectionModelMode"><span class="type">GcrCollectionModelMode</span></a> mode</code></em>,
 
51
                                                         <em class="parameter"><code>...</code></em>);
 
52
<a class="link" href="GcrCollectionModel.html" title="GcrCollectionModel"><span class="returnvalue">GcrCollectionModel</span></a> * <a class="link" href="GcrCollectionModel.html#gcr-collection-model-new-full" title="gcr_collection_model_new_full ()">gcr_collection_model_new_full</a>      (<em class="parameter"><code><a class="link" href="GcrCollection.html" title="GcrCollection"><span class="type">GcrCollection</span></a> *collection</code></em>,
 
53
                                                         <em class="parameter"><code><a class="link" href="GcrCollectionModel.html#GcrCollectionModelMode" title="enum GcrCollectionModelMode"><span class="type">GcrCollectionModelMode</span></a> mode</code></em>,
 
54
                                                         <em class="parameter"><code>const <a class="link" href="gcr-GcrColumn.html#GcrColumn" title="GcrColumn"><span class="type">GcrColumn</span></a> *columns</code></em>);
 
55
<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a>               <a class="link" href="GcrCollectionModel.html#gcr-collection-model-set-columns" title="gcr_collection_model_set_columns ()">gcr_collection_model_set_columns</a>    (<em class="parameter"><code><a class="link" href="GcrCollectionModel.html" title="GcrCollectionModel"><span class="type">GcrCollectionModel</span></a> *self</code></em>,
 
56
                                                         <em class="parameter"><code>const <a class="link" href="gcr-GcrColumn.html#GcrColumn" title="GcrColumn"><span class="type">GcrColumn</span></a> *columns</code></em>);
 
57
<a class="link" href="GcrCollection.html" title="GcrCollection"><span class="returnvalue">GcrCollection</span></a> *     <a class="link" href="GcrCollectionModel.html#gcr-collection-model-get-collection" title="gcr_collection_model_get_collection ()">gcr_collection_model_get_collection</a> (<em class="parameter"><code><a class="link" href="GcrCollectionModel.html" title="GcrCollectionModel"><span class="type">GcrCollectionModel</span></a> *self</code></em>);
 
58
<span class="returnvalue">void</span>                <a class="link" href="GcrCollectionModel.html#gcr-collection-model-set-collection" title="gcr_collection_model_set_collection ()">gcr_collection_model_set_collection</a> (<em class="parameter"><code><a class="link" href="GcrCollectionModel.html" title="GcrCollectionModel"><span class="type">GcrCollectionModel</span></a> *self</code></em>,
 
59
                                                         <em class="parameter"><code><a class="link" href="GcrCollection.html" title="GcrCollection"><span class="type">GcrCollection</span></a> *collection</code></em>);
 
60
<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            <a class="link" href="GcrCollectionModel.html#gcr-collection-model-iter-for-object" title="gcr_collection_model_iter_for_object ()">gcr_collection_model_iter_for_object</a>
 
61
                                                        (<em class="parameter"><code><a class="link" href="GcrCollectionModel.html" title="GcrCollectionModel"><span class="type">GcrCollectionModel</span></a> *self</code></em>,
 
62
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#GObject"><span class="type">GObject</span></a> *object</code></em>,
 
63
                                                         <em class="parameter"><code><a href="http://developer.gnome.org/devel/gtk/GtkTreeModel.html#GtkTreeIter"><span class="type">GtkTreeIter</span></a> *iter</code></em>);
 
64
<a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#GObject"><span class="returnvalue">GObject</span></a> *           <a class="link" href="GcrCollectionModel.html#gcr-collection-model-object-for-iter" title="gcr_collection_model_object_for_iter ()">gcr_collection_model_object_for_iter</a>
 
65
                                                        (<em class="parameter"><code><a class="link" href="GcrCollectionModel.html" title="GcrCollectionModel"><span class="type">GcrCollectionModel</span></a> *self</code></em>,
 
66
                                                         <em class="parameter"><code>const <a href="http://developer.gnome.org/devel/gtk/GtkTreeModel.html#GtkTreeIter"><span class="type">GtkTreeIter</span></a> *iter</code></em>);
 
67
<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            <a class="link" href="GcrCollectionModel.html#gcr-collection-model-is-selected" title="gcr_collection_model_is_selected ()">gcr_collection_model_is_selected</a>    (<em class="parameter"><code><a class="link" href="GcrCollectionModel.html" title="GcrCollectionModel"><span class="type">GcrCollectionModel</span></a> *self</code></em>,
 
68
                                                         <em class="parameter"><code><a href="http://developer.gnome.org/devel/gtk/GtkTreeModel.html#GtkTreeIter"><span class="type">GtkTreeIter</span></a> *iter</code></em>);
 
69
<span class="returnvalue">void</span>                <a class="link" href="GcrCollectionModel.html#gcr-collection-model-change-selected" title="gcr_collection_model_change_selected ()">gcr_collection_model_change_selected</a>
 
70
                                                        (<em class="parameter"><code><a class="link" href="GcrCollectionModel.html" title="GcrCollectionModel"><span class="type">GcrCollectionModel</span></a> *self</code></em>,
 
71
                                                         <em class="parameter"><code><a href="http://developer.gnome.org/devel/gtk/GtkTreeModel.html#GtkTreeIter"><span class="type">GtkTreeIter</span></a> *iter</code></em>,
 
72
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> selected</code></em>);
 
73
<span class="returnvalue">void</span>                <a class="link" href="GcrCollectionModel.html#gcr-collection-model-toggle-selected" title="gcr_collection_model_toggle_selected ()">gcr_collection_model_toggle_selected</a>
 
74
                                                        (<em class="parameter"><code><a class="link" href="GcrCollectionModel.html" title="GcrCollectionModel"><span class="type">GcrCollectionModel</span></a> *self</code></em>,
 
75
                                                         <em class="parameter"><code><a href="http://developer.gnome.org/devel/gtk/GtkTreeModel.html#GtkTreeIter"><span class="type">GtkTreeIter</span></a> *iter</code></em>);
 
76
<a href="http://library.gnome.org/devel/glib/unstable/glib-Doubly-Linked-Lists.html#GList"><span class="returnvalue">GList</span></a> *             <a class="link" href="GcrCollectionModel.html#gcr-collection-model-get-selected-objects" title="gcr_collection_model_get_selected_objects ()">gcr_collection_model_get_selected_objects</a>
 
77
                                                        (<em class="parameter"><code><a class="link" href="GcrCollectionModel.html" title="GcrCollectionModel"><span class="type">GcrCollectionModel</span></a> *self</code></em>);
 
78
<span class="returnvalue">void</span>                <a class="link" href="GcrCollectionModel.html#gcr-collection-model-set-selected-objects" title="gcr_collection_model_set_selected_objects ()">gcr_collection_model_set_selected_objects</a>
 
79
                                                        (<em class="parameter"><code><a class="link" href="GcrCollectionModel.html" title="GcrCollectionModel"><span class="type">GcrCollectionModel</span></a> *self</code></em>,
 
80
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Doubly-Linked-Lists.html#GList"><span class="type">GList</span></a> *selected</code></em>);
 
81
<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="returnvalue">gint</span></a>                <a class="link" href="GcrCollectionModel.html#gcr-collection-model-column-for-selected" title="gcr_collection_model_column_for_selected ()">gcr_collection_model_column_for_selected</a>
 
82
                                                        (<em class="parameter"><code><a class="link" href="GcrCollectionModel.html" title="GcrCollectionModel"><span class="type">GcrCollectionModel</span></a> *self</code></em>);
 
83
</pre>
 
84
</div>
 
85
<div class="refsect1">
 
86
<a name="GcrCollectionModel.object-hierarchy"></a><h2>Object Hierarchy</h2>
 
87
<pre class="synopsis">
 
88
  <a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#GObject">GObject</a>
 
89
   +----GcrCollectionModel
 
90
</pre>
 
91
</div>
 
92
<div class="refsect1">
 
93
<a name="GcrCollectionModel.implemented-interfaces"></a><h2>Implemented Interfaces</h2>
 
94
<p>
 
95
GcrCollectionModel implements
 
96
 <a href="http://developer.gnome.org/devel/gtk/GtkTreeModel.html">GtkTreeModel</a> and  <a href="http://developer.gnome.org/devel/gtk/GtkTreeSortable.html">GtkTreeSortable</a>.</p>
 
97
</div>
 
98
<div class="refsect1">
 
99
<a name="GcrCollectionModel.properties"></a><h2>Properties</h2>
 
100
<pre class="synopsis">
 
101
  "<a class="link" href="GcrCollectionModel.html#GcrCollectionModel--collection" title='The "collection" property'>collection</a>"               <a class="link" href="GcrCollection.html" title="GcrCollection"><span class="type">GcrCollection</span></a>*        : Read / Write
 
102
  "<a class="link" href="GcrCollectionModel.html#GcrCollectionModel--columns" title='The "columns" property'>columns</a>"                  <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a>              : Read / Write / Construct Only
 
103
  "<a class="link" href="GcrCollectionModel.html#GcrCollectionModel--mode" title='The "mode" property'>mode</a>"                     <a class="link" href="GcrCollectionModel.html#GcrCollectionModelMode" title="enum GcrCollectionModelMode"><span class="type">GcrCollectionModelMode</span></a>  : Read / Write / Construct Only
 
104
</pre>
 
105
</div>
 
106
<div class="refsect1">
 
107
<a name="GcrCollectionModel.description"></a><h2>Description</h2>
 
108
<p>
 
109
This is an implementation of <a href="http://developer.gnome.org/devel/gtk/GtkTreeModel.html"><span class="type">GtkTreeModel</span></a> which represents the objects in
 
110
the a <a class="link" href="GcrCollection.html" title="GcrCollection"><span class="type">GcrCollection</span></a>. As objects are added or removed from the collection,
 
111
rows are added and removed from this model.
 
112
</p>
 
113
<p>
 
114
The row values come from the properties of the objects in the collection. Use
 
115
<a class="link" href="GcrCollectionModel.html#gcr-collection-model-new" title="gcr_collection_model_new ()"><code class="function">gcr_collection_model_new()</code></a> to create a new collection model. To have more
 
116
control over the values use a set of <a class="link" href="gcr-GcrColumn.html#GcrColumn" title="GcrColumn"><span class="type">GcrColumn</span></a> structures to define the
 
117
columns. This can be done with <a class="link" href="GcrCollectionModel.html#gcr-collection-model-new-full" title="gcr_collection_model_new_full ()"><code class="function">gcr_collection_model_new_full()</code></a> or
 
118
<a class="link" href="GcrCollectionModel.html#gcr-collection-model-set-columns" title="gcr_collection_model_set_columns ()"><code class="function">gcr_collection_model_set_columns()</code></a>.
 
119
</p>
 
120
<p>
 
121
Each row can have a selected state, which is represented by a boolean column.
 
122
The selected state can be toggled with <a class="link" href="GcrCollectionModel.html#gcr-collection-model-toggle-selected" title="gcr_collection_model_toggle_selected ()"><code class="function">gcr_collection_model_toggle_selected()</code></a>
 
123
or set with <a class="link" href="GcrCollectionModel.html#gcr-collection-model-set-selected-objects" title="gcr_collection_model_set_selected_objects ()"><code class="function">gcr_collection_model_set_selected_objects()</code></a> and retrieved with
 
124
<a class="link" href="GcrCollectionModel.html#gcr-collection-model-get-selected-objects" title="gcr_collection_model_get_selected_objects ()"><code class="function">gcr_collection_model_get_selected_objects()</code></a>.
 
125
</p>
 
126
<p>
 
127
To determine which object a row represents and vice versa, use the
 
128
<a class="link" href="GcrCollectionModel.html#gcr-collection-model-iter-for-object" title="gcr_collection_model_iter_for_object ()"><code class="function">gcr_collection_model_iter_for_object()</code></a> or <a class="link" href="GcrCollectionModel.html#gcr-collection-model-object-for-iter" title="gcr_collection_model_object_for_iter ()"><code class="function">gcr_collection_model_object_for_iter()</code></a>
 
129
functions.
 
130
</p>
 
131
</div>
 
132
<div class="refsect1">
 
133
<a name="GcrCollectionModel.details"></a><h2>Details</h2>
 
134
<div class="refsect2">
 
135
<a name="GcrCollectionModel-struct"></a><h3>struct GcrCollectionModel</h3>
 
136
<pre class="programlisting">struct GcrCollectionModel;</pre>
 
137
<p>
 
138
A <a href="http://developer.gnome.org/devel/gtk/GtkTreeModel.html"><span class="type">GtkTreeModel</span></a> which contains a row for each object in a <a class="link" href="GcrCollection.html" title="GcrCollection"><span class="type">GcrCollection</span></a>.
 
139
</p>
 
140
</div>
 
141
<hr>
 
142
<div class="refsect2">
 
143
<a name="GcrCollectionModelClass"></a><h3>struct GcrCollectionModelClass</h3>
 
144
<pre class="programlisting">struct GcrCollectionModelClass {
 
145
        GObjectClass parent_class;
 
146
};
 
147
</pre>
 
148
<p>
 
149
The class for <a class="link" href="GcrCollectionModel.html" title="GcrCollectionModel"><span class="type">GcrCollectionModel</span></a>.
 
150
</p>
 
151
<div class="variablelist"><table border="0">
 
152
<col align="left" valign="top">
 
153
<tbody><tr>
 
154
<td><p><span class="term"><a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#GObjectClass"><span class="type">GObjectClass</span></a> <em class="structfield"><code><a name="GcrCollectionModelClass.parent-class"></a>parent_class</code></em>;</span></p></td>
 
155
<td>The parent class</td>
 
156
</tr></tbody>
 
157
</table></div>
 
158
</div>
 
159
<hr>
 
160
<div class="refsect2">
 
161
<a name="GcrCollectionModelMode"></a><h3>enum GcrCollectionModelMode</h3>
 
162
<pre class="programlisting">typedef enum {
 
163
        GCR_COLLECTION_MODEL_LIST = 0,
 
164
        GCR_COLLECTION_MODEL_TREE
 
165
} GcrCollectionModelMode;
 
166
</pre>
 
167
<p>
 
168
If set GcrCollectionModel is created with a mode of <a class="link" href="GcrCollectionModel.html#GCR-COLLECTION-MODEL-TREE:CAPS"><code class="literal">GCR_COLLECTION_MODEL_TREE</code></a>,
 
169
then any included objects that are themselves a <a class="link" href="GcrCollection.html" title="GcrCollection"><span class="type">GcrCollection</span></a>, will have all child
 
170
objects include as child rows in a tree form.
 
171
</p>
 
172
<div class="variablelist"><table border="0">
 
173
<col align="left" valign="top">
 
174
<tbody>
 
175
<tr>
 
176
<td><p><a name="GCR-COLLECTION-MODEL-LIST:CAPS"></a><span class="term"><code class="literal">GCR_COLLECTION_MODEL_LIST</code></span></p></td>
 
177
<td>only objects in the top collection, no child objects
 
178
</td>
 
179
</tr>
 
180
<tr>
 
181
<td><p><a name="GCR-COLLECTION-MODEL-TREE:CAPS"></a><span class="term"><code class="literal">GCR_COLLECTION_MODEL_TREE</code></span></p></td>
 
182
<td>show objects in the collection, and child objects in a tree form
 
183
</td>
 
184
</tr>
 
185
</tbody>
 
186
</table></div>
 
187
</div>
 
188
<hr>
 
189
<div class="refsect2">
 
190
<a name="gcr-collection-model-new"></a><h3>gcr_collection_model_new ()</h3>
 
191
<pre class="programlisting"><a class="link" href="GcrCollectionModel.html" title="GcrCollectionModel"><span class="returnvalue">GcrCollectionModel</span></a> * gcr_collection_model_new           (<em class="parameter"><code><a class="link" href="GcrCollection.html" title="GcrCollection"><span class="type">GcrCollection</span></a> *collection</code></em>,
 
192
                                                         <em class="parameter"><code><a class="link" href="GcrCollectionModel.html#GcrCollectionModelMode" title="enum GcrCollectionModelMode"><span class="type">GcrCollectionModelMode</span></a> mode</code></em>,
 
193
                                                         <em class="parameter"><code>...</code></em>);</pre>
 
194
<p>
 
195
Create a new <a class="link" href="GcrCollectionModel.html" title="GcrCollectionModel"><span class="type">GcrCollectionModel</span></a>. The variable argument list should contain
 
196
pairs of property names, and <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Type-Information.html#GType"><span class="type">GType</span></a> values. The variable argument list should
 
197
be terminated with <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>.
 
198
</p>
 
199
<div class="variablelist"><table border="0">
 
200
<col align="left" valign="top">
 
201
<tbody>
 
202
<tr>
 
203
<td><p><span class="term"><em class="parameter"><code>collection</code></em> :</span></p></td>
 
204
<td>the collection to represent</td>
 
205
</tr>
 
206
<tr>
 
207
<td><p><span class="term"><em class="parameter"><code>mode</code></em> :</span></p></td>
 
208
<td>whether list or tree mode</td>
 
209
</tr>
 
210
<tr>
 
211
<td><p><span class="term"><em class="parameter"><code>...</code></em> :</span></p></td>
 
212
<td>the column names and types</td>
 
213
</tr>
 
214
<tr>
 
215
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
 
216
<td>a newly allocated model, which should be released
 
217
with <a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#g-object-unref"><code class="function">g_object_unref()</code></a>. <span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span>
 
218
</td>
 
219
</tr>
 
220
</tbody>
 
221
</table></div>
 
222
</div>
 
223
<hr>
 
224
<div class="refsect2">
 
225
<a name="gcr-collection-model-new-full"></a><h3>gcr_collection_model_new_full ()</h3>
 
226
<pre class="programlisting"><a class="link" href="GcrCollectionModel.html" title="GcrCollectionModel"><span class="returnvalue">GcrCollectionModel</span></a> * gcr_collection_model_new_full      (<em class="parameter"><code><a class="link" href="GcrCollection.html" title="GcrCollection"><span class="type">GcrCollection</span></a> *collection</code></em>,
 
227
                                                         <em class="parameter"><code><a class="link" href="GcrCollectionModel.html#GcrCollectionModelMode" title="enum GcrCollectionModelMode"><span class="type">GcrCollectionModelMode</span></a> mode</code></em>,
 
228
                                                         <em class="parameter"><code>const <a class="link" href="gcr-GcrColumn.html#GcrColumn" title="GcrColumn"><span class="type">GcrColumn</span></a> *columns</code></em>);</pre>
 
229
<p>
 
230
Create a new <a class="link" href="GcrCollectionModel.html" title="GcrCollectionModel"><span class="type">GcrCollectionModel</span></a>.
 
231
</p>
 
232
<div class="variablelist"><table border="0">
 
233
<col align="left" valign="top">
 
234
<tbody>
 
235
<tr>
 
236
<td><p><span class="term"><em class="parameter"><code>collection</code></em> :</span></p></td>
 
237
<td>the collection to represent</td>
 
238
</tr>
 
239
<tr>
 
240
<td><p><span class="term"><em class="parameter"><code>mode</code></em> :</span></p></td>
 
241
<td>whether list or tree mode</td>
 
242
</tr>
 
243
<tr>
 
244
<td><p><span class="term"><em class="parameter"><code>columns</code></em> :</span></p></td>
 
245
<td>the columns the model should contain</td>
 
246
</tr>
 
247
<tr>
 
248
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
 
249
<td>a newly allocated model, which should be released
 
250
with <a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#g-object-unref"><code class="function">g_object_unref()</code></a>. <span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span>
 
251
</td>
 
252
</tr>
 
253
</tbody>
 
254
</table></div>
 
255
</div>
 
256
<hr>
 
257
<div class="refsect2">
 
258
<a name="gcr-collection-model-set-columns"></a><h3>gcr_collection_model_set_columns ()</h3>
 
259
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a>               gcr_collection_model_set_columns    (<em class="parameter"><code><a class="link" href="GcrCollectionModel.html" title="GcrCollectionModel"><span class="type">GcrCollectionModel</span></a> *self</code></em>,
 
260
                                                         <em class="parameter"><code>const <a class="link" href="gcr-GcrColumn.html#GcrColumn" title="GcrColumn"><span class="type">GcrColumn</span></a> *columns</code></em>);</pre>
 
261
<p>
 
262
Set the columns that the model should contain. <em class="parameter"><code>columns</code></em> is an array of
 
263
<a class="link" href="gcr-GcrColumn.html#GcrColumn" title="GcrColumn"><span class="type">GcrColumn</span></a> structures, with the last one containing <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> for all values.
 
264
</p>
 
265
<p>
 
266
This function can only be called once, and only if the model was not created
 
267
without a set of columns. This function cannot be called after the model
 
268
has been added to a view.
 
269
</p>
 
270
<p>
 
271
The columns are accessed as static data. They should continue to remain
 
272
in memory for longer than the GcrCollectionModel object.
 
273
</p>
 
274
<div class="variablelist"><table border="0">
 
275
<col align="left" valign="top">
 
276
<tbody>
 
277
<tr>
 
278
<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
 
279
<td>The model</td>
 
280
</tr>
 
281
<tr>
 
282
<td><p><span class="term"><em class="parameter"><code>columns</code></em> :</span></p></td>
 
283
<td>The columns the model should contain</td>
 
284
</tr>
 
285
<tr>
 
286
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
 
287
<td>The number of columns</td>
 
288
</tr>
 
289
</tbody>
 
290
</table></div>
 
291
</div>
 
292
<hr>
 
293
<div class="refsect2">
 
294
<a name="gcr-collection-model-get-collection"></a><h3>gcr_collection_model_get_collection ()</h3>
 
295
<pre class="programlisting"><a class="link" href="GcrCollection.html" title="GcrCollection"><span class="returnvalue">GcrCollection</span></a> *     gcr_collection_model_get_collection (<em class="parameter"><code><a class="link" href="GcrCollectionModel.html" title="GcrCollectionModel"><span class="type">GcrCollectionModel</span></a> *self</code></em>);</pre>
 
296
<p>
 
297
Get the collection which this model represents
 
298
</p>
 
299
<div class="variablelist"><table border="0">
 
300
<col align="left" valign="top">
 
301
<tbody>
 
302
<tr>
 
303
<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
 
304
<td>a collection model</td>
 
305
</tr>
 
306
<tr>
 
307
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
 
308
<td>the collection, owned by the model. <span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span>
 
309
</td>
 
310
</tr>
 
311
</tbody>
 
312
</table></div>
 
313
</div>
 
314
<hr>
 
315
<div class="refsect2">
 
316
<a name="gcr-collection-model-set-collection"></a><h3>gcr_collection_model_set_collection ()</h3>
 
317
<pre class="programlisting"><span class="returnvalue">void</span>                gcr_collection_model_set_collection (<em class="parameter"><code><a class="link" href="GcrCollectionModel.html" title="GcrCollectionModel"><span class="type">GcrCollectionModel</span></a> *self</code></em>,
 
318
                                                         <em class="parameter"><code><a class="link" href="GcrCollection.html" title="GcrCollection"><span class="type">GcrCollection</span></a> *collection</code></em>);</pre>
 
319
<p>
 
320
</p>
 
321
</div>
 
322
<hr>
 
323
<div class="refsect2">
 
324
<a name="gcr-collection-model-iter-for-object"></a><h3>gcr_collection_model_iter_for_object ()</h3>
 
325
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            gcr_collection_model_iter_for_object
 
326
                                                        (<em class="parameter"><code><a class="link" href="GcrCollectionModel.html" title="GcrCollectionModel"><span class="type">GcrCollectionModel</span></a> *self</code></em>,
 
327
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#GObject"><span class="type">GObject</span></a> *object</code></em>,
 
328
                                                         <em class="parameter"><code><a href="http://developer.gnome.org/devel/gtk/GtkTreeModel.html#GtkTreeIter"><span class="type">GtkTreeIter</span></a> *iter</code></em>);</pre>
 
329
<p>
 
330
Set <em class="parameter"><code>iter</code></em> to the row for the given object. If the object is not in this
 
331
model, then <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> will be returned.
 
332
</p>
 
333
<div class="variablelist"><table border="0">
 
334
<col align="left" valign="top">
 
335
<tbody>
 
336
<tr>
 
337
<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
 
338
<td>The model</td>
 
339
</tr>
 
340
<tr>
 
341
<td><p><span class="term"><em class="parameter"><code>object</code></em> :</span></p></td>
 
342
<td>The object</td>
 
343
</tr>
 
344
<tr>
 
345
<td><p><span class="term"><em class="parameter"><code>iter</code></em> :</span></p></td>
 
346
<td>The row for the object</td>
 
347
</tr>
 
348
<tr>
 
349
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
 
350
<td>
 
351
<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the object was present.</td>
 
352
</tr>
 
353
</tbody>
 
354
</table></div>
 
355
</div>
 
356
<hr>
 
357
<div class="refsect2">
 
358
<a name="gcr-collection-model-object-for-iter"></a><h3>gcr_collection_model_object_for_iter ()</h3>
 
359
<pre class="programlisting"><a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#GObject"><span class="returnvalue">GObject</span></a> *           gcr_collection_model_object_for_iter
 
360
                                                        (<em class="parameter"><code><a class="link" href="GcrCollectionModel.html" title="GcrCollectionModel"><span class="type">GcrCollectionModel</span></a> *self</code></em>,
 
361
                                                         <em class="parameter"><code>const <a href="http://developer.gnome.org/devel/gtk/GtkTreeModel.html#GtkTreeIter"><span class="type">GtkTreeIter</span></a> *iter</code></em>);</pre>
 
362
<p>
 
363
Get the object that is represented by the given row in the model.
 
364
</p>
 
365
<div class="variablelist"><table border="0">
 
366
<col align="left" valign="top">
 
367
<tbody>
 
368
<tr>
 
369
<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
 
370
<td>The model</td>
 
371
</tr>
 
372
<tr>
 
373
<td><p><span class="term"><em class="parameter"><code>iter</code></em> :</span></p></td>
 
374
<td>The row</td>
 
375
</tr>
 
376
<tr>
 
377
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
 
378
<td>The object, owned by the model. <span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span>
 
379
</td>
 
380
</tr>
 
381
</tbody>
 
382
</table></div>
 
383
</div>
 
384
<hr>
 
385
<div class="refsect2">
 
386
<a name="gcr-collection-model-is-selected"></a><h3>gcr_collection_model_is_selected ()</h3>
 
387
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            gcr_collection_model_is_selected    (<em class="parameter"><code><a class="link" href="GcrCollectionModel.html" title="GcrCollectionModel"><span class="type">GcrCollectionModel</span></a> *self</code></em>,
 
388
                                                         <em class="parameter"><code><a href="http://developer.gnome.org/devel/gtk/GtkTreeModel.html#GtkTreeIter"><span class="type">GtkTreeIter</span></a> *iter</code></em>);</pre>
 
389
<p>
 
390
Check whether a given row has been toggled as selected.
 
391
</p>
 
392
<div class="variablelist"><table border="0">
 
393
<col align="left" valign="top">
 
394
<tbody>
 
395
<tr>
 
396
<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
 
397
<td>The model</td>
 
398
</tr>
 
399
<tr>
 
400
<td><p><span class="term"><em class="parameter"><code>iter</code></em> :</span></p></td>
 
401
<td>The row</td>
 
402
</tr>
 
403
<tr>
 
404
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
 
405
<td>Whether the row has been selected.</td>
 
406
</tr>
 
407
</tbody>
 
408
</table></div>
 
409
</div>
 
410
<hr>
 
411
<div class="refsect2">
 
412
<a name="gcr-collection-model-change-selected"></a><h3>gcr_collection_model_change_selected ()</h3>
 
413
<pre class="programlisting"><span class="returnvalue">void</span>                gcr_collection_model_change_selected
 
414
                                                        (<em class="parameter"><code><a class="link" href="GcrCollectionModel.html" title="GcrCollectionModel"><span class="type">GcrCollectionModel</span></a> *self</code></em>,
 
415
                                                         <em class="parameter"><code><a href="http://developer.gnome.org/devel/gtk/GtkTreeModel.html#GtkTreeIter"><span class="type">GtkTreeIter</span></a> *iter</code></em>,
 
416
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> selected</code></em>);</pre>
 
417
<p>
 
418
Set whether a given row is toggled selected or not.
 
419
</p>
 
420
<div class="variablelist"><table border="0">
 
421
<col align="left" valign="top">
 
422
<tbody>
 
423
<tr>
 
424
<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
 
425
<td>The model</td>
 
426
</tr>
 
427
<tr>
 
428
<td><p><span class="term"><em class="parameter"><code>iter</code></em> :</span></p></td>
 
429
<td>The row</td>
 
430
</tr>
 
431
<tr>
 
432
<td><p><span class="term"><em class="parameter"><code>selected</code></em> :</span></p></td>
 
433
<td>Whether the row should be selected or not.</td>
 
434
</tr>
 
435
</tbody>
 
436
</table></div>
 
437
</div>
 
438
<hr>
 
439
<div class="refsect2">
 
440
<a name="gcr-collection-model-toggle-selected"></a><h3>gcr_collection_model_toggle_selected ()</h3>
 
441
<pre class="programlisting"><span class="returnvalue">void</span>                gcr_collection_model_toggle_selected
 
442
                                                        (<em class="parameter"><code><a class="link" href="GcrCollectionModel.html" title="GcrCollectionModel"><span class="type">GcrCollectionModel</span></a> *self</code></em>,
 
443
                                                         <em class="parameter"><code><a href="http://developer.gnome.org/devel/gtk/GtkTreeModel.html#GtkTreeIter"><span class="type">GtkTreeIter</span></a> *iter</code></em>);</pre>
 
444
<p>
 
445
Toggle the selected state of a given row.
 
446
</p>
 
447
<div class="variablelist"><table border="0">
 
448
<col align="left" valign="top">
 
449
<tbody>
 
450
<tr>
 
451
<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
 
452
<td>The model</td>
 
453
</tr>
 
454
<tr>
 
455
<td><p><span class="term"><em class="parameter"><code>iter</code></em> :</span></p></td>
 
456
<td>The row</td>
 
457
</tr>
 
458
</tbody>
 
459
</table></div>
 
460
</div>
 
461
<hr>
 
462
<div class="refsect2">
 
463
<a name="gcr-collection-model-get-selected-objects"></a><h3>gcr_collection_model_get_selected_objects ()</h3>
 
464
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Doubly-Linked-Lists.html#GList"><span class="returnvalue">GList</span></a> *             gcr_collection_model_get_selected_objects
 
465
                                                        (<em class="parameter"><code><a class="link" href="GcrCollectionModel.html" title="GcrCollectionModel"><span class="type">GcrCollectionModel</span></a> *self</code></em>);</pre>
 
466
<p>
 
467
Get a list of checked/selected objects.
 
468
</p>
 
469
<div class="variablelist"><table border="0">
 
470
<col align="left" valign="top">
 
471
<tbody>
 
472
<tr>
 
473
<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
 
474
<td>the collection model</td>
 
475
</tr>
 
476
<tr>
 
477
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
 
478
<td>a list of selected
 
479
objects, which should be freed with <a href="http://library.gnome.org/devel/glib/unstable/glib-Doubly-Linked-Lists.html#g-list-free"><code class="function">g_list_free()</code></a>. <span class="annotation">[<acronym title="Free data container after the code is done."><span class="acronym">transfer container</span></acronym>][<acronym title="Generics and defining elements of containers and arrays."><span class="acronym">element-type</span></acronym> GLib.Object]</span>
 
480
</td>
 
481
</tr>
 
482
</tbody>
 
483
</table></div>
 
484
</div>
 
485
<hr>
 
486
<div class="refsect2">
 
487
<a name="gcr-collection-model-set-selected-objects"></a><h3>gcr_collection_model_set_selected_objects ()</h3>
 
488
<pre class="programlisting"><span class="returnvalue">void</span>                gcr_collection_model_set_selected_objects
 
489
                                                        (<em class="parameter"><code><a class="link" href="GcrCollectionModel.html" title="GcrCollectionModel"><span class="type">GcrCollectionModel</span></a> *self</code></em>,
 
490
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Doubly-Linked-Lists.html#GList"><span class="type">GList</span></a> *selected</code></em>);</pre>
 
491
<p>
 
492
Set the checked/selected objects.
 
493
</p>
 
494
<div class="variablelist"><table border="0">
 
495
<col align="left" valign="top">
 
496
<tbody>
 
497
<tr>
 
498
<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
 
499
<td>the collection model</td>
 
500
</tr>
 
501
<tr>
 
502
<td><p><span class="term"><em class="parameter"><code>selected</code></em> :</span></p></td>
 
503
<td>a list of objects to select. <span class="annotation">[<acronym title="Generics and defining elements of containers and arrays."><span class="acronym">element-type</span></acronym> GLib.Object]</span>
 
504
</td>
 
505
</tr>
 
506
</tbody>
 
507
</table></div>
 
508
</div>
 
509
<hr>
 
510
<div class="refsect2">
 
511
<a name="gcr-collection-model-column-for-selected"></a><h3>gcr_collection_model_column_for_selected ()</h3>
 
512
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="returnvalue">gint</span></a>                gcr_collection_model_column_for_selected
 
513
                                                        (<em class="parameter"><code><a class="link" href="GcrCollectionModel.html" title="GcrCollectionModel"><span class="type">GcrCollectionModel</span></a> *self</code></em>);</pre>
 
514
<p>
 
515
Get the column identifier for the column that contains the values
 
516
of the selected state.
 
517
</p>
 
518
<div class="variablelist"><table border="0">
 
519
<col align="left" valign="top">
 
520
<tbody>
 
521
<tr>
 
522
<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
 
523
<td>The model</td>
 
524
</tr>
 
525
<tr>
 
526
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
 
527
<td>The column identifier.</td>
 
528
</tr>
 
529
</tbody>
 
530
</table></div>
 
531
</div>
 
532
</div>
 
533
<div class="refsect1">
 
534
<a name="GcrCollectionModel.property-details"></a><h2>Property Details</h2>
 
535
<div class="refsect2">
 
536
<a name="GcrCollectionModel--collection"></a><h3>The <code class="literal">"collection"</code> property</h3>
 
537
<pre class="programlisting">  "collection"               <a class="link" href="GcrCollection.html" title="GcrCollection"><span class="type">GcrCollection</span></a>*        : Read / Write</pre>
 
538
<p>Collection to get objects from.</p>
 
539
</div>
 
540
<hr>
 
541
<div class="refsect2">
 
542
<a name="GcrCollectionModel--columns"></a><h3>The <code class="literal">"columns"</code> property</h3>
 
543
<pre class="programlisting">  "columns"                  <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a>              : Read / Write / Construct Only</pre>
 
544
<p>Columns for the model.</p>
 
545
</div>
 
546
<hr>
 
547
<div class="refsect2">
 
548
<a name="GcrCollectionModel--mode"></a><h3>The <code class="literal">"mode"</code> property</h3>
 
549
<pre class="programlisting">  "mode"                     <a class="link" href="GcrCollectionModel.html#GcrCollectionModelMode" title="enum GcrCollectionModelMode"><span class="type">GcrCollectionModelMode</span></a>  : Read / Write / Construct Only</pre>
 
550
<p>Tree or list mode.</p>
 
551
<p>Default value: GCR_COLLECTION_MODEL_TREE</p>
 
552
</div>
 
553
</div>
 
554
</div>
 
555
<div class="footer">
 
556
<hr>
 
557
          Generated by GTK-Doc V1.18</div>
 
558
</body>
 
559
</html>
 
 
b'\\ No newline at end of file'