finch/libgnt/gntcheckbox.h

changeset 39360
e7bed293aad5
parent 39302
64aabebb476b
child 39361
a1068caa3600
equal deleted inserted replaced
39302:64aabebb476b 39360:e7bed293aad5
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., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
21 */
22
23 #ifndef GNT_CHECK_BOX_H
24 #define GNT_CHECK_BOX_H
25 /**
26 * SECTION:gntcheckbox
27 * @section_id: libgnt-gntcheckbox
28 * @short_description: <filename>gntcheckbox.h</filename>
29 * @title: Checkbox
30 */
31
32 #include "gntbutton.h"
33 #include "gnt.h"
34 #include "gntcolors.h"
35 #include "gntkeys.h"
36
37 #define GNT_TYPE_CHECK_BOX (gnt_check_box_get_type())
38 #define GNT_CHECK_BOX(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GNT_TYPE_CHECK_BOX, GntCheckBox))
39 #define GNT_CHECK_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GNT_TYPE_CHECK_BOX, GntCheckBoxClass))
40 #define GNT_IS_CHECK_BOX(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GNT_TYPE_CHECK_BOX))
41 #define GNT_IS_CHECK_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), GNT_TYPE_CHECK_BOX))
42 #define GNT_CHECK_BOX_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GNT_TYPE_CHECK_BOX, GntCheckBoxClass))
43
44 #define GNT_CHECK_BOX_FLAGS(obj) (GNT_CHECK_BOX(obj)->priv.flags)
45 #define GNT_CHECK_BOX_SET_FLAGS(obj, flags) (GNT_CHECK_BOX_FLAGS(obj) |= flags)
46 #define GNT_CHECK_BOX_UNSET_FLAGS(obj, flags) (GNT_CHECK_BOX_FLAGS(obj) &= ~(flags))
47
48 typedef struct _GntCheckBox GntCheckBox;
49 typedef struct _GntCheckBoxPriv GntCheckBoxPriv;
50 typedef struct _GntCheckBoxClass GntCheckBoxClass;
51
52 struct _GntCheckBox
53 {
54 GntButton parent;
55 gboolean checked;
56 };
57
58 struct _GntCheckBoxClass
59 {
60 GntButtonClass parent;
61
62 void (*toggled)(void);
63
64 /*< private >*/
65 void (*gnt_reserved1)(void);
66 void (*gnt_reserved2)(void);
67 void (*gnt_reserved3)(void);
68 void (*gnt_reserved4)(void);
69 };
70
71 G_BEGIN_DECLS
72
73 /**
74 * gnt_check_box_get_type:
75 *
76 * Returns: GType for GntCheckBox
77 */
78 GType gnt_check_box_get_type(void);
79
80 /**
81 * gnt_check_box_new:
82 * @text: The text for the checkbox.
83 *
84 * Create a new checkbox.
85 *
86 * Returns: The newly created checkbox.
87 */
88 GntWidget * gnt_check_box_new(const char *text);
89
90 /**
91 * gnt_check_box_set_checked:
92 * @box: The checkbox.
93 * @set: %TRUE if the checkbox should be selected, %FALSE otherwise.
94 *
95 * Set whether the checkbox should be checked or not.
96 */
97 void gnt_check_box_set_checked(GntCheckBox *box, gboolean set);
98
99 /**
100 * gnt_check_box_get_checked:
101 * @box: The checkbox.
102 *
103 * Return the checked state of the checkbox.
104 *
105 * Returns: %TRUE if the checkbox is selected, %FALSE otherwise.
106 */
107 gboolean gnt_check_box_get_checked(GntCheckBox *box);
108
109 G_END_DECLS
110
111 #endif /* GNT_CHECK_BOX_H */

mercurial