pidgin/gtkstatusbox.h

changeset 40682
edbc992e77be
parent 40676
50284e37698c
child 41124
95555046173e
equal deleted inserted replaced
40681:675b8605dca2 40682:edbc992e77be
1 /* pidgin 1 /*
2 * Pidgin - Internet Messenger
3 * Copyright (C) Pidgin Developers <devel@pidgin.im>
2 * 4 *
3 * Pidgin is the legal property of its developers, whose names are too numerous 5 * Pidgin is the legal property of its developers, whose names are too numerous
4 * to list here. Please refer to the COPYRIGHT file distributed with this 6 * to list here. Please refer to the COPYRIGHT file distributed with this
5 * source distribution. 7 * source distribution.
6 * 8 *
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details. 17 * GNU General Public License for more details.
16 * 18 *
17 * You should have received a copy of the GNU General Public License 19 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software 20 * along with this program; if not, see <https://www.gnu.org/licenses/>.
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
20 */ 21 */
21 22
22 #if !defined(PIDGIN_GLOBAL_HEADER_INSIDE) && !defined(PIDGIN_COMPILATION) 23 #if !defined(PIDGIN_GLOBAL_HEADER_INSIDE) && !defined(PIDGIN_COMPILATION)
23 # error "only <pidgin.h> may be included directly" 24 # error "only <pidgin.h> may be included directly"
24 #endif 25 #endif
25 26
26 #ifndef __PIDGIN_STATUS_BOX_H__ 27 #ifndef PIDGIN_STATUS_BOX_H
27 #define __PIDGIN_STATUS_BOX_H__ 28 #define PIDGIN_STATUS_BOX_H
29
28 /** 30 /**
29 * SECTION:gtkstatusbox 31 * SECTION:gtkstatusbox
30 * @section_id: pidgin-gtkstatusbox 32 * @section_id: pidgin-gtkstatusbox
31 * @short_description: <filename>gtkstatusbox.h</filename> 33 * @short_description: <filename>gtkstatusbox.h</filename>
32 * @title: Status Selection Widget 34 * @title: Status Selection Widget
38 40
39 #include <purple.h> 41 #include <purple.h>
40 42
41 G_BEGIN_DECLS 43 G_BEGIN_DECLS
42 44
43 #define PIDGIN_TYPE_STATUS_BOX (pidgin_status_box_get_type ()) 45 #define PIDGIN_TYPE_STATUS_BOX (pidgin_status_box_get_type ())
44 #define PIDGIN_STATUS_BOX(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PIDGIN_TYPE_STATUS_BOX, PidginStatusBox)) 46 G_DECLARE_FINAL_TYPE(PidginStatusBox, pidgin_status_box, PIDGIN, STATUS_BOX,
45 #define PIDGIN_STATUS_BOX_CLASS(vtable) (G_TYPE_CHECK_CLASS_CAST ((vtable), PIDGIN_TYPE_STATUS_BOX, PidginStatusBoxClass)) 47 GtkContainer);
46 #define PIDGIN_IS_STATUS_BOX(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PIDGIN_TYPE_STATUS_BOX))
47 #define PIDGIN_IS_STATUS_BOX_CLASS(vtable) (G_TYPE_CHECK_CLASS_TYPE ((vtable), PIDGIN_TYPE_STATUS_BOX))
48 #define PIDGIN_STATUS_BOX_GET_CLASS(inst) (G_TYPE_INSTANCE_GET_CLASS ((inst), PIDGIN_TYPE_STATUS_BOX, PidginStatusBoxClass))
49 48
50 /** 49 GtkWidget *pidgin_status_box_new(void);
51 * PidginStatusBoxItemType: 50 GtkWidget *pidgin_status_box_new_with_account(PurpleAccount *account);
52 *
53 * This is a hidden field in the GtkStatusBox that identifies the
54 * item in the list store. The item could be a normal
55 * PurpleStatusPrimitive, or it could be something special like the
56 * "Custom..." item, or "Saved..." or a GtkSeparator.
57 */
58 typedef enum
59 {
60 PIDGIN_STATUS_BOX_TYPE_SEPARATOR,
61 PIDGIN_STATUS_BOX_TYPE_PRIMITIVE,
62 PIDGIN_STATUS_BOX_TYPE_POPULAR,
63 PIDGIN_STATUS_BOX_TYPE_SAVED_POPULAR,
64 PIDGIN_STATUS_BOX_TYPE_CUSTOM,
65 PIDGIN_STATUS_BOX_TYPE_SAVED,
66 PIDGIN_STATUS_BOX_NUM_TYPES
67 } PidginStatusBoxItemType;
68 51
69 typedef struct _PidginStatusBox PidginStatusBox; 52 void pidgin_status_box_set_connecting(PidginStatusBox *status_box, gboolean connecting);
70 typedef struct _PidginStatusBoxClass PidginStatusBoxClass;
71 53
72 /** 54 gchar *pidgin_status_box_get_message(PidginStatusBox *status_box);
73 * PidginStatusBox:
74 * @store: This GtkListStore contains only one row--the currently
75 * selected status.
76 * @dropdown_store: This is the dropdown GtkListStore that contains the
77 * available statuses, plus some recently used statuses, plus
78 * the "Custom..." and "Saved..." options.
79 * @token_status_account: This will be non-NULL and contain a sample account
80 * when all enabled accounts use the same statuses
81 */
82 struct _PidginStatusBox
83 {
84 GtkContainer parent_instance;
85
86 /*< public >*/
87 GtkListStore *store;
88 GtkListStore *dropdown_store;
89
90 PurpleAccount *account;
91
92 PurpleAccount *token_status_account;
93
94 GtkWidget *vbox;
95 gboolean editor_visible;
96 GtkWidget *editor;
97 GtkWidget *input;
98 GtkTextBuffer *buffer;
99
100 GdkCursor *hand_cursor;
101 GdkCursor *arrow_cursor;
102 int icon_size;
103 gboolean icon_opaque;
104
105
106 GtkWidget *cell_view;
107 GtkCellRenderer *icon_rend;
108 GtkCellRenderer *text_rend;
109
110 GdkPixbuf *error_pixbuf;
111 int connecting_index;
112 GdkPixbuf *connecting_pixbufs[9];
113 int typing_index;
114 GdkPixbuf *typing_pixbufs[6];
115
116 gboolean network_available;
117 gboolean connecting;
118 guint typing;
119
120 GtkTreeIter iter;
121 char *error;
122
123 /*
124 * These widgets are made for renderin'
125 * That's just what they'll do
126 * One of these days these widgets
127 * Are gonna render all over you
128 */
129 GtkWidget *hbox;
130 GtkWidget *toggle_button;
131 GtkWidget *vsep;
132 GtkWidget *arrow;
133
134 GtkWidget *popup_window;
135 GtkWidget *popup_frame;
136 GtkWidget *scrolled_window;
137 GtkWidget *cell_view_frame;
138 GtkTreeViewColumn *column;
139 GtkWidget *tree_view;
140 gboolean popup_in_progress;
141 GtkTreeRowReference *active_row;
142 };
143
144 struct _PidginStatusBoxClass
145 {
146 GtkContainerClass parent_class;
147
148 /* signals */
149 void (* changed) (GtkComboBox *combo_box);
150
151 /*< private >*/
152 void (*_gtk_reserved0) (void);
153 void (*_gtk_reserved1) (void);
154 void (*_gtk_reserved2) (void);
155 void (*_gtk_reserved3) (void);
156 };
157
158
159 GType pidgin_status_box_get_type (void) G_GNUC_CONST;
160 GtkWidget *pidgin_status_box_new (void);
161 GtkWidget *pidgin_status_box_new_with_account (PurpleAccount *account);
162
163 void
164 pidgin_status_box_add(PidginStatusBox *status_box, PidginStatusBoxItemType type, GdkPixbuf *pixbuf, const char *text, const char *sec_text, gpointer data);
165
166 void
167 pidgin_status_box_add_separator(PidginStatusBox *status_box);
168
169 void
170 pidgin_status_box_set_network_available(PidginStatusBox *status_box, gboolean available);
171
172 void
173 pidgin_status_box_set_connecting(PidginStatusBox *status_box, gboolean connecting);
174
175 void
176 pidgin_status_box_pulse_connecting(PidginStatusBox *status_box);
177
178 char *pidgin_status_box_get_message(PidginStatusBox *status_box);
179 55
180 G_END_DECLS 56 G_END_DECLS
181 57
182 #endif /* __GTK_PIDGIN_STATUS_COMBO_BOX_H__ */ 58 #endif /* PIDGIN_STATUS_BOX_H */

mercurial