Improved commentary.
[irreco.git] / irreco / src / core / irreco_listbox.h
blob3a4e7699a187008e075c4b63e9e941ee7bd8f957
1 /*
2 * irreco - Ir Remote Control
3 * Copyright (C) 2007 Arto Karppinen (arto.karppinen@iki.fi)
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version 2
8 * of the License, or (at your option) any later version.
9 *
10 * This program 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 General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 /**
21 * @addtogroup IrrecoListbox
22 * @{
25 /**
26 * @file
27 * Header file of @ref IrrecoListbox.
32 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*/
33 /* Typedef */
34 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*/
36 * Make sure that typedefs are available before we include anything elese.
38 * This makes sure that whatever other structures that depend on structures
39 * defined in this file will compile OK recardles of header inclusion order.
41 #ifndef __IRRECO_LISTBOX_H_TYPEDEF__
42 #define __IRRECO_LISTBOX_H_TYPEDEF__
44 typedef struct _IrrecoListbox IrrecoListbox;
45 typedef struct _IrrecoListboxClass IrrecoListboxClass;
47 #define IRRECO_TYPE_LISTBOX irreco_listbox_get_type()
49 #define IRRECO_LISTBOX(obj) \
50 (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
51 IRRECO_TYPE_LISTBOX, IrrecoListbox))
53 #define IRRECO_LISTBOX_CLASS(klass) \
54 (G_TYPE_CHECK_CLASS_CAST ((klass), \
55 IRRECO_TYPE_LISTBOX, IrrecoListboxClass))
57 #define IRRECO_IS_LISTBOX(obj) \
58 (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
59 IRRECO_TYPE_LISTBOX))
61 #define IRRECO_IS_LISTBOX_CLASS(klass) \
62 (G_TYPE_CHECK_CLASS_TYPE ((klass), \
63 IRRECO_TYPE_LISTBOX))
65 #define IRRECO_LISTBOX_GET_CLASS(obj) \
66 (G_TYPE_INSTANCE_GET_CLASS ((obj), \
67 IRRECO_TYPE_LISTBOX, IrrecoListboxClass))
69 #endif /* __IRRECO_LISTBOX_H_TYPEDEF__ */
73 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*/
74 /* Include */
75 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*/
76 #ifndef __IRRECO_LISTBOX_H__
77 #define __IRRECO_LISTBOX_H__
78 #include "irreco.h"
82 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*/
83 /* Datatypes */
84 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*/
86 struct _IrrecoListbox {
87 GtkScrolledWindow parent;
89 GtkWidget *tree_view;
90 GtkListStore *list_store;
91 GtkTreeSelection *tree_selection;
93 GtkWidget *vscrollbar;
94 GtkWidget *hscrollbar;
96 gint data_col_id;
97 gint text_col_id;
99 gint min_width;
100 gint max_width;
101 gint min_height;
102 gint max_height;
104 gboolean select_new_rows;
107 struct _IrrecoListboxClass {
108 GtkScrolledWindowClass parent_class;
113 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*/
114 /* Prototypes */
115 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*/
116 GType irreco_listbox_get_type (void);
117 void irreco_listbox_set_select_new_rows(IrrecoListbox *self,
118 gboolean select_new_rows);
119 void irreco_listbox_set_autosize (IrrecoListbox *self,
120 gint min_width,
121 gint max_width,
122 gint min_height,
123 gint max_height);
124 void irreco_listbox_clear (IrrecoListbox *self);
125 gboolean irreco_listbox_get_iter (IrrecoListbox * irreco_listbox,
126 gint index,
127 GtkTreeIter * iter);
128 gboolean irreco_listbox_set_selection (IrrecoListbox *self,
129 gint index);
130 gboolean irreco_listbox_get_selection (IrrecoListbox *self,
131 gint *index,
132 gchar **label,
133 gpointer *user_data);
134 gint irreco_listbox_get_selection_index (IrrecoListbox *self);
135 gchar* irreco_listbox_get_selection_label (IrrecoListbox *self);
136 gpointer irreco_listbox_get_selection_data (IrrecoListbox *self);
137 gboolean irreco_listbox_move_selected_up (IrrecoListbox *self);
138 gboolean irreco_listbox_move_selected_down (IrrecoListbox *self);
139 gboolean irreco_listbox_move (IrrecoListbox *self,
140 gint from_index,
141 gint to_index);
142 gboolean irreco_listbox_remove_selected (IrrecoListbox *self);
143 gboolean irreco_listbox_remove (IrrecoListbox *self,
144 gint index);
149 #endif /* __IRRECO_LISTBOX_H__ */
151 /** @} */