[gaim-migrate @ 5234]
[pidgin-git.git] / src / multi.h
blob9879a19c5b02399f97a0c5f2ca8f1341a820cc59
1 /*
2 * gaim
4 * Copyright (C) 1998-1999, Mark Spencer <markster@marko.net>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 #ifndef _MULTI_H_
23 #define _MULTI_H_
25 #include "core.h"
27 /* ok. now the fun begins. first we create a connection structure */
28 struct gaim_connection {
29 int edittype; /* XXX CUI: this is ui-specific and should be removed */
31 /* we need to do either oscar or TOC */
32 /* we make this as an int in case if we want to add more protocols later */
33 int protocol;
34 struct prpl *prpl;
35 guint32 flags;
37 /* erg. */
38 char *checkbox;
40 /* all connections need an input watcher */
41 int inpa;
43 /* all connections need a list of chats, even if they don't have chat */
44 GSList *buddy_chats;
46 /* each connection then can have its own protocol-specific data */
47 void *proto_data;
49 struct gaim_account *account;
51 char username[64];
52 char displayname[128];
53 char password[32];
54 guint keepalive;
56 /* stuff needed for per-connection idle times */
57 guint idle_timer;
58 time_t login_time;
59 time_t login_time_official;
60 time_t lastsent;
61 int is_idle;
63 char *away; /* set by protos, is NULL when not away, or set *
64 * to "" or a custom message when away */
65 char *away_state; /* updated by serv_set_away, keeps the last set *
66 * away type */
67 int is_auto_away; /* used by idle.c */
69 int evil; /* warning level for AIM (why is this here?) */
70 gboolean wants_to_die; /* defaults to FALSE */
73 #define OPT_CONN_HTML 0x00000001
74 /* set this flag on a gc if you want serv_got_im to autoreply when away */
75 #define OPT_CONN_AUTO_RESP 0x00000002
77 struct proto_user_opt {
78 char *label;
79 char *def;
80 int pos;
83 struct proto_actions_menu {
84 char *label;
85 void (*callback)(struct gaim_connection *);
86 struct gaim_connection *gc;
89 struct proto_buddy_menu {
90 char *label;
91 void (*callback)(struct gaim_connection *, char *);
92 struct gaim_connection *gc;
95 struct proto_chat_entry {
96 char *label;
97 char *def;
98 gboolean is_int;
99 int min;
100 int max;
103 /* now that we have our struct, we're going to need lots of them. Maybe even a list of them. */
104 extern GSList *connections;
106 /* number of accounts that are currently in the process of connecting */
107 extern int connecting_count;
109 struct gaim_account *gaim_account_new(const char *, int, int);
110 struct gaim_connection *new_gaim_conn(struct gaim_account *);
111 void destroy_gaim_conn(struct gaim_connection *);
113 void regenerate_user_list();
115 void account_online(struct gaim_connection *);
116 void account_offline(struct gaim_connection *);
118 void auto_login();
120 void set_login_progress(struct gaim_connection *, float, char *);
121 void hide_login_progress(struct gaim_connection *, char *);
122 void hide_login_progress_notice(struct gaim_connection *, char *);
123 void hide_login_progress_error(struct gaim_connection *, char *);
125 #endif /* _MULTI_H_ */