[gaim-migrate @ 3063]
[pidgin-git.git] / src / multi.h
blob0a51c6a84615d87c852e1e679967cf4ecc5241e1
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 /* buddy list stuff. there is still a global groups for the buddy list, but
44 * we need to maintain our own set of buddies, and our own permit/deny lists */
45 GSList *groups;
46 GSList *permit;
47 GSList *deny;
48 int permdeny;
50 /* all connections need a list of chats, even if they don't have chat */
51 GSList *buddy_chats;
53 /* each connection then can have its own protocol-specific data */
54 void *proto_data;
56 struct aim_user *user;
58 char username[64];
59 char displayname[128];
60 char password[32];
61 guint keepalive;
62 /* stuff needed for per-connection idle times */
63 guint idle_timer;
64 time_t login_time;
65 time_t lastsent;
66 int is_idle;
67 time_t correction_time;
69 char *away;
70 int is_auto_away;
72 int evil;
73 gboolean wants_to_die; /* defaults to FALSE */
76 #define OPT_CONN_HTML 0x00000001
78 struct proto_user_opt {
79 char *label;
80 char *def;
81 int pos;
84 struct proto_buddy_menu {
85 char *label;
86 void (*callback)(struct gaim_connection *, char *);
87 struct gaim_connection *gc;
90 struct proto_chat_entry {
91 char *label;
92 char *def;
93 gboolean is_int;
94 int min;
95 int max;
98 /* now that we have our struct, we're going to need lots of them. Maybe even a list of them. */
99 extern GSList *connections;
101 struct aim_user *new_user(const char *, int, int);
102 struct gaim_connection *new_gaim_conn(struct aim_user *);
103 void destroy_gaim_conn(struct gaim_connection *);
105 void regenerate_user_list();
107 void account_online(struct gaim_connection *);
108 void account_offline(struct gaim_connection *);
110 void auto_login();
112 void set_login_progress(struct gaim_connection *, float, char *);
113 void hide_login_progress(struct gaim_connection *, char *);
114 void hide_login_progress_notice(struct gaim_connection *, char *);
116 #endif /* _MULTI_H_ */