comparison finch/libgnt/gnttree.h @ 17928:8410511f4dbb

applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3 through e82c41f34ce5f7439b2f2971139efaf6ef7a54ff
author Eric Polino <aluink@pidgin.im>
date Wed, 06 Jun 2007 15:50:21 +0000
parents 790d1d003825
children ab6d2763b8d8
comparison
equal deleted inserted replaced
17927:f189497429c5 17928:8410511f4dbb
1 /**
2 * GNT - The GLib Ncurses Toolkit
3 *
4 * GNT is the legal property of its developers, whose names are too numerous
5 * to list here. Please refer to the COPYRIGHT file distributed with this
6 * source distribution.
7 *
8 * This library is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 */
22
1 #ifndef GNT_TREE_H 23 #ifndef GNT_TREE_H
2 #define GNT_TREE_H 24 #define GNT_TREE_H
3 25
4 #include "gntwidget.h" 26 #include "gntwidget.h"
5 #include "gnt.h" 27 #include "gnt.h"
72 void (*gnt_reserved4)(void); 94 void (*gnt_reserved4)(void);
73 }; 95 };
74 96
75 G_BEGIN_DECLS 97 G_BEGIN_DECLS
76 98
99 /**
100 *
101 *
102 * @return
103 */
77 GType gnt_tree_get_gtype(void); 104 GType gnt_tree_get_gtype(void);
78 105
79 GntWidget *gnt_tree_new(void); /* A tree with just one column */ 106 /**
80 107 *
81 GntWidget *gnt_tree_new_with_columns(int columns); 108 *
82 109 * @return
110 */
111 GntWidget * gnt_tree_new(void);
112
113 /* A tree with just one column */
114
115 /**
116 *
117 * @param columns
118 *
119 * @return
120 */
121 GntWidget * gnt_tree_new_with_columns(int columns);
122
123 /**
124 *
125 * @param tree
126 * @param rows
127 */
83 void gnt_tree_set_visible_rows(GntTree *tree, int rows); 128 void gnt_tree_set_visible_rows(GntTree *tree, int rows);
84 129
130 /**
131 *
132 * @param tree
133 *
134 * @return
135 */
85 int gnt_tree_get_visible_rows(GntTree *tree); 136 int gnt_tree_get_visible_rows(GntTree *tree);
86 137
138 /**
139 *
140 * @param tree
141 * @param count
142 */
87 void gnt_tree_scroll(GntTree *tree, int count); 143 void gnt_tree_scroll(GntTree *tree, int count);
88 144
89 GntTreeRow *gnt_tree_add_row_after(GntTree *tree, void *key, GntTreeRow *row, void *parent, void *bigbro); 145 /**
90 146 *
91 GntTreeRow *gnt_tree_add_row_last(GntTree *tree, void *key, GntTreeRow *row, void *parent); 147 * @param tree
92 148 * @param key
149 * @param row
150 * @param parent
151 * @param bigbro
152 *
153 * @return
154 */
155 GntTreeRow * gnt_tree_add_row_after(GntTree *tree, void *key, GntTreeRow *row, void *parent, void *bigbro);
156
157 /**
158 *
159 * @param tree
160 * @param key
161 * @param row
162 * @param parent
163 *
164 * @return
165 */
166 GntTreeRow * gnt_tree_add_row_last(GntTree *tree, void *key, GntTreeRow *row, void *parent);
167
168 /**
169 *
170 * @param tree
171 *
172 * @return
173 */
93 gpointer gnt_tree_get_selection_data(GntTree *tree); 174 gpointer gnt_tree_get_selection_data(GntTree *tree);
94 175
95 /* Returned string needs to be freed */ 176 /* Returned string needs to be freed */
96 char *gnt_tree_get_selection_text(GntTree *tree); 177 /**
97 178 *
98 GList *gnt_tree_get_selection_text_list(GntTree *tree); 179 * @param tree
180 *
181 * @return
182 */
183 char * gnt_tree_get_selection_text(GntTree *tree);
184
185 /**
186 *
187 * @param tree
188 *
189 * @return
190 */
191 GList * gnt_tree_get_selection_text_list(GntTree *tree);
99 192
100 const GList *gnt_tree_get_rows(GntTree *tree); 193 const GList *gnt_tree_get_rows(GntTree *tree);
101 194
195 /**
196 *
197 * @param tree
198 * @param key
199 */
102 void gnt_tree_remove(GntTree *tree, gpointer key); 200 void gnt_tree_remove(GntTree *tree, gpointer key);
103 201
202 /**
203 *
204 * @param tree
205 */
104 void gnt_tree_remove_all(GntTree *tree); 206 void gnt_tree_remove_all(GntTree *tree);
105 207
106 /* Returns the visible line number of the selected row */ 208 /* Returns the visible line number of the selected row */
209 /**
210 *
211 * @param tree
212 *
213 * @return
214 */
107 int gnt_tree_get_selection_visible_line(GntTree *tree); 215 int gnt_tree_get_selection_visible_line(GntTree *tree);
108 216
217 /**
218 *
219 * @param tree
220 * @param key
221 * @param colno
222 * @param text
223 */
109 void gnt_tree_change_text(GntTree *tree, gpointer key, int colno, const char *text); 224 void gnt_tree_change_text(GntTree *tree, gpointer key, int colno, const char *text);
110 225
111 GntTreeRow *gnt_tree_add_choice(GntTree *tree, void *key, GntTreeRow *row, void *parent, void *bigbro); 226 /**
112 227 *
228 * @param tree
229 * @param key
230 * @param row
231 * @param parent
232 * @param bigbro
233 *
234 * @return
235 */
236 GntTreeRow * gnt_tree_add_choice(GntTree *tree, void *key, GntTreeRow *row, void *parent, void *bigbro);
237
238 /**
239 *
240 * @param tree
241 * @param key
242 * @param set
243 */
113 void gnt_tree_set_choice(GntTree *tree, void *key, gboolean set); 244 void gnt_tree_set_choice(GntTree *tree, void *key, gboolean set);
114 245
246 /**
247 *
248 * @param tree
249 * @param key
250 *
251 * @return
252 */
115 gboolean gnt_tree_get_choice(GntTree *tree, void *key); 253 gboolean gnt_tree_get_choice(GntTree *tree, void *key);
116 254
255 /**
256 *
257 * @param tree
258 * @param key
259 * @param flags
260 */
117 void gnt_tree_set_row_flags(GntTree *tree, void *key, GntTextFormatFlags flags); 261 void gnt_tree_set_row_flags(GntTree *tree, void *key, GntTextFormatFlags flags);
118 262
263 /**
264 *
265 * @param key
266 */
119 void gnt_tree_set_selected(GntTree *tree , void *key); 267 void gnt_tree_set_selected(GntTree *tree , void *key);
120 268
121 GntTreeRow *gnt_tree_create_row(GntTree *tree, ...); 269 /**
122 270 *
123 GntTreeRow *gnt_tree_create_row_from_list(GntTree *tree, GList *list); 271 * @param tree
124 272 *
273 * @return
274 */
275 GntTreeRow * gnt_tree_create_row(GntTree *tree, ...);
276
277 /**
278 *
279 * @param tree
280 * @param list
281 *
282 * @return
283 */
284 GntTreeRow * gnt_tree_create_row_from_list(GntTree *tree, GList *list);
285
286 /**
287 *
288 * @param tree
289 * @param col
290 * @param width
291 */
125 void gnt_tree_set_col_width(GntTree *tree, int col, int width); 292 void gnt_tree_set_col_width(GntTree *tree, int col, int width);
126 293
294 /**
295 *
296 * @param tree
297 */
127 void gnt_tree_set_column_titles(GntTree *tree, ...); 298 void gnt_tree_set_column_titles(GntTree *tree, ...);
128 299
300 /**
301 *
302 * @param tree
303 * @param set
304 */
129 void gnt_tree_set_show_title(GntTree *tree, gboolean set); 305 void gnt_tree_set_show_title(GntTree *tree, gboolean set);
130 306
307 /**
308 *
309 * @param tree
310 * @param func
311 */
131 void gnt_tree_set_compare_func(GntTree *tree, GCompareFunc func); 312 void gnt_tree_set_compare_func(GntTree *tree, GCompareFunc func);
132 313
314 /**
315 *
316 * @param tree
317 * @param key
318 * @param expanded
319 */
133 void gnt_tree_set_expanded(GntTree *tree, void *key, gboolean expanded); 320 void gnt_tree_set_expanded(GntTree *tree, void *key, gboolean expanded);
134 321
322 /**
323 *
324 * @param tree
325 * @param set
326 */
135 void gnt_tree_set_show_separator(GntTree *tree, gboolean set); 327 void gnt_tree_set_show_separator(GntTree *tree, gboolean set);
136 328
329 /**
330 *
331 * @param tree
332 * @param row
333 */
137 void gnt_tree_sort_row(GntTree *tree, void *row); 334 void gnt_tree_sort_row(GntTree *tree, void *row);
138 335
139 /* This will try to automatically adjust the width of the columns in the tree */ 336 /* This will try to automatically adjust the width of the columns in the tree */
337 /**
338 *
339 * @param tree
340 */
140 void gnt_tree_adjust_columns(GntTree *tree); 341 void gnt_tree_adjust_columns(GntTree *tree);
141 342
343 /**
344 *
345 * @param tree
346 * @param hash
347 * @param eq
348 * @param kd
349 */
142 void gnt_tree_set_hash_fns(GntTree *tree, gpointer hash, gpointer eq, gpointer kd); 350 void gnt_tree_set_hash_fns(GntTree *tree, gpointer hash, gpointer eq, gpointer kd);
143 351
144 /* This can be useful when, for example, we want to store some data 352 /* This can be useful when, for example, we want to store some data
145 * which we don't want/need to display. */ 353 * which we don't want/need to display. */
354 /**
355 *
356 * @param tree
357 * @param col
358 * @param vis
359 */
146 void gnt_tree_set_column_visible(GntTree *tree, int col, gboolean vis); 360 void gnt_tree_set_column_visible(GntTree *tree, int col, gboolean vis);
147 361
148 G_END_DECLS 362 G_END_DECLS
149 363
150 /* The following functions should NOT be used by applications. */ 364 /* The following functions should NOT be used by applications. */
151 365
152 /* This should be called by the subclasses of GntTree's in their _new function */ 366 /* This should be called by the subclasses of GntTree's in their _new function */
367 /**
368 *
369 * @param tree
370 * @param col
371 */
153 void _gnt_tree_init_internals(GntTree *tree, int col); 372 void _gnt_tree_init_internals(GntTree *tree, int col);
154 373
155 #endif /* GNT_TREE_H */ 374 #endif /* GNT_TREE_H */