Mercurial > pidgin
annotate src/prpl.h @ 2107:f3a162033356
[gaim-migrate @ 2117]
i feel the earth
move
under my feet
committer: Tailor Script <tailor@pidgin.im>
author | Eric Warmenhoven <eric@warmenhoven.org> |
---|---|
date | Thu, 02 Aug 2001 01:40:35 +0000 |
parents | a93aeb6f813d |
children | 56c4382f2909 |
rev | line source |
---|---|
981 | 1 /* |
2 * gaim | |
3 * | |
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. | |
10 * | |
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. | |
15 * | |
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 | |
19 * | |
20 */ | |
21 | |
22 #ifndef _GAIMPRPL_H_ | |
23 #define _GAIMPRPL_H_ | |
24 | |
25 #include "multi.h" | |
2050
ddd696ccb46b
[gaim-migrate @ 2060]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1920
diff
changeset
|
26 #include <stdio.h> |
981 | 27 |
28 #define PROTO_TOC 0 | |
29 #define PROTO_OSCAR 1 | |
30 #define PROTO_YAHOO 2 | |
31 #define PROTO_ICQ 3 | |
32 #define PROTO_MSN 4 | |
33 #define PROTO_IRC 5 | |
34 #define PROTO_FTP 6 | |
1003
f8f7f3ed2edb
[gaim-migrate @ 1013]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1000
diff
changeset
|
35 #define PROTO_VGATE 7 |
1083
12478dd1e9d7
[gaim-migrate @ 1093]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1075
diff
changeset
|
36 #define PROTO_JABBER 8 |
1318
4d4fef0928ce
[gaim-migrate @ 1328]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1083
diff
changeset
|
37 #define PROTO_NAPSTER 9 |
1626
59c7e7831ccd
[gaim-migrate @ 1636]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1500
diff
changeset
|
38 #define PROTO_ZEPHYR 10 |
2059
0b3d7233a356
[gaim-migrate @ 2069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2050
diff
changeset
|
39 /* DON'T TAKE AN UNASSIGNED NUMBER! Talk to Eric or Rob if you'd like |
0b3d7233a356
[gaim-migrate @ 2069]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2050
diff
changeset
|
40 * to create a new PRPL. */ |
981 | 41 |
1878
75643b9f4261
[gaim-migrate @ 1888]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1815
diff
changeset
|
42 #define DEFAULT_PROTO PROTO_OSCAR |
75643b9f4261
[gaim-migrate @ 1888]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1815
diff
changeset
|
43 |
1772
896432d66303
[gaim-migrate @ 1782]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1769
diff
changeset
|
44 /* These should all be stuff that some plugins can do and others can't */ |
896432d66303
[gaim-migrate @ 1782]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1769
diff
changeset
|
45 /* TOC/Oscar send HTML-encoded messages; most other protocols don't */ |
896432d66303
[gaim-migrate @ 1782]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1769
diff
changeset
|
46 #define OPT_PROTO_HTML 0x00000001 |
896432d66303
[gaim-migrate @ 1782]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1769
diff
changeset
|
47 /* TOC/Oscar have signon time, and the server's time needs to be adjusted to match |
896432d66303
[gaim-migrate @ 1782]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1769
diff
changeset
|
48 * your computer's time. We wouldn't need this if everyone used NTP. */ |
896432d66303
[gaim-migrate @ 1782]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1769
diff
changeset
|
49 #define OPT_PROTO_CORRECT_TIME 0x00000002 |
896432d66303
[gaim-migrate @ 1782]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1769
diff
changeset
|
50 /* Jabber lets you choose what name you want for chat. So it shouldn't be pulling |
896432d66303
[gaim-migrate @ 1782]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1769
diff
changeset
|
51 * the alias for when you're in chat; it gets annoying. */ |
896432d66303
[gaim-migrate @ 1782]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1769
diff
changeset
|
52 #define OPT_PROTO_UNIQUE_CHATNAME 0x00000004 |
896432d66303
[gaim-migrate @ 1782]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1769
diff
changeset
|
53 /* IRC, Jabber let you have chat room topics */ |
896432d66303
[gaim-migrate @ 1782]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1769
diff
changeset
|
54 #define OPT_PROTO_CHAT_TOPIC 0x00000008 |
896432d66303
[gaim-migrate @ 1782]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1769
diff
changeset
|
55 /* IRC and Zephyr don't require passwords, so there's no need for a password prompt */ |
896432d66303
[gaim-migrate @ 1782]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1769
diff
changeset
|
56 #define OPT_PROTO_NO_PASSWORD 0x00000010 |
1370
776bb4c6c0b8
[gaim-migrate @ 1380]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1355
diff
changeset
|
57 |
1401
bf041349b11e
[gaim-migrate @ 1411]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1370
diff
changeset
|
58 #define GAIM_AWAY_CUSTOM "Custom" |
bf041349b11e
[gaim-migrate @ 1411]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1370
diff
changeset
|
59 |
1000
91b7377e7b45
[gaim-migrate @ 1010]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
981
diff
changeset
|
60 typedef void (*proto_init)(struct prpl *); |
91b7377e7b45
[gaim-migrate @ 1010]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
981
diff
changeset
|
61 |
981 | 62 struct prpl { |
63 int protocol; | |
1370
776bb4c6c0b8
[gaim-migrate @ 1380]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1355
diff
changeset
|
64 int options; |
981 | 65 char *(* name)(); |
66 | |
1032
643a4d81c18a
[gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
67 /* returns the XPM associated with the given user class */ |
1030
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1003
diff
changeset
|
68 char **(* list_icon)(int); |
1401
bf041349b11e
[gaim-migrate @ 1411]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1370
diff
changeset
|
69 GList *(* away_states)(); |
1499
de0b946e86a4
[gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1443
diff
changeset
|
70 GList *(* actions)(); |
de0b946e86a4
[gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1443
diff
changeset
|
71 void (* do_action)(struct gaim_connection *, char *); |
1333
b332d8f46b84
[gaim-migrate @ 1343]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1318
diff
changeset
|
72 |
b332d8f46b84
[gaim-migrate @ 1343]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1318
diff
changeset
|
73 /* when UI plugins come, these will have to be reconciled by returning |
b332d8f46b84
[gaim-migrate @ 1343]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1318
diff
changeset
|
74 * structs indicating what kinds of information they want displayed. */ |
1769
68eddf56f419
[gaim-migrate @ 1779]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1713
diff
changeset
|
75 /* new thought though. instead of UI plugins, just do like X-Chat does; |
68eddf56f419
[gaim-migrate @ 1779]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1713
diff
changeset
|
76 * have different src- dirs in src: src-common, src-gtk, src-cli, etc. |
68eddf56f419
[gaim-migrate @ 1779]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1713
diff
changeset
|
77 * then have a prpl-base and prpl-UI stuff. people don't need to change |
68eddf56f419
[gaim-migrate @ 1779]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1713
diff
changeset
|
78 * their UIs all that often anyway. */ |
1499
de0b946e86a4
[gaim-migrate @ 1509]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1443
diff
changeset
|
79 void (* buddy_menu)(GtkWidget *, struct gaim_connection *, char *); |
1075
2fe18b2d6105
[gaim-migrate @ 1085]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1064
diff
changeset
|
80 void (* user_opts)(GtkWidget *, struct aim_user *); |
1333
b332d8f46b84
[gaim-migrate @ 1343]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1318
diff
changeset
|
81 void (* draw_new_user)(GtkWidget *); |
b332d8f46b84
[gaim-migrate @ 1343]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1318
diff
changeset
|
82 void (* do_new_user)(); |
1898
73d73939f698
[gaim-migrate @ 1908]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1878
diff
changeset
|
83 void (* draw_join_chat)(struct gaim_connection *, GtkWidget *); |
73d73939f698
[gaim-migrate @ 1908]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1878
diff
changeset
|
84 void (* insert_convo)(struct gaim_connection *, struct conversation *); |
73d73939f698
[gaim-migrate @ 1908]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1878
diff
changeset
|
85 void (* remove_convo)(struct gaim_connection *, struct conversation *); |
1030
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1003
diff
changeset
|
86 |
1333
b332d8f46b84
[gaim-migrate @ 1343]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1318
diff
changeset
|
87 /* all the server-related functions */ |
981 | 88 void (* login) (struct aim_user *); |
89 void (* close) (struct gaim_connection *); | |
90 void (* send_im) (struct gaim_connection *, char *who, char *message, int away); | |
91 void (* set_info) (struct gaim_connection *, char *info); | |
92 void (* get_info) (struct gaim_connection *, char *who); | |
1401
bf041349b11e
[gaim-migrate @ 1411]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1370
diff
changeset
|
93 void (* set_away) (struct gaim_connection *, char *state, char *message); |
981 | 94 void (* get_away_msg) (struct gaim_connection *, char *who); |
95 void (* set_dir) (struct gaim_connection *, char *first, | |
96 char *middle, | |
97 char *last, | |
98 char *maiden, | |
99 char *city, | |
100 char *state, | |
101 char *country, | |
102 int web); | |
103 void (* get_dir) (struct gaim_connection *, char *who); | |
104 void (* dir_search) (struct gaim_connection *, char *first, | |
105 char *middle, | |
106 char *last, | |
107 char *maiden, | |
108 char *city, | |
109 char *state, | |
110 char *country, | |
111 char *email); | |
112 void (* set_idle) (struct gaim_connection *, int idletime); | |
113 void (* change_passwd) (struct gaim_connection *, char *old, char *new); | |
114 void (* add_buddy) (struct gaim_connection *, char *name); | |
115 void (* add_buddies) (struct gaim_connection *, GList *buddies); | |
116 void (* remove_buddy) (struct gaim_connection *, char *name); | |
117 void (* add_permit) (struct gaim_connection *, char *name); | |
118 void (* add_deny) (struct gaim_connection *, char *name); | |
1038
daad2440a642
[gaim-migrate @ 1048]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1032
diff
changeset
|
119 void (* rem_permit) (struct gaim_connection *, char *name); |
daad2440a642
[gaim-migrate @ 1048]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1032
diff
changeset
|
120 void (* rem_deny) (struct gaim_connection *, char *name); |
daad2440a642
[gaim-migrate @ 1048]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1032
diff
changeset
|
121 void (* set_permit_deny)(struct gaim_connection *); |
981 | 122 void (* warn) (struct gaim_connection *, char *who, int anonymous); |
123 void (* accept_chat) (struct gaim_connection *, int id); | |
124 void (* join_chat) (struct gaim_connection *, int id, char *name); | |
125 void (* chat_invite) (struct gaim_connection *, int id, char *who, char *message); | |
126 void (* chat_leave) (struct gaim_connection *, int id); | |
127 void (* chat_whisper) (struct gaim_connection *, int id, char *who, char *message); | |
128 void (* chat_send) (struct gaim_connection *, int id, char *message); | |
129 void (* keepalive) (struct gaim_connection *); | |
1920
5bed3bc833b5
[gaim-migrate @ 1930]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1898
diff
changeset
|
130 void (* chat_set_topic) (struct gaim_connection *, int id, char *topic); |
1713
14caa7df478c
[gaim-migrate @ 1723]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1626
diff
changeset
|
131 |
14caa7df478c
[gaim-migrate @ 1723]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1626
diff
changeset
|
132 char *(* normalize)(const char *); |
981 | 133 }; |
134 | |
135 extern GSList *protocols; | |
136 | |
1000
91b7377e7b45
[gaim-migrate @ 1010]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
981
diff
changeset
|
137 /* this is mostly just for aim.c, when it initializes the protocols */ |
981 | 138 void static_proto_init(); |
139 | |
1000
91b7377e7b45
[gaim-migrate @ 1010]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
981
diff
changeset
|
140 /* this is what should actually load the protocol. pass it the protocol's initializer */ |
1443
336fc98b7f90
[gaim-migrate @ 1453]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1426
diff
changeset
|
141 void load_protocol(proto_init, int); |
1047
ece2d1543b20
[gaim-migrate @ 1057]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1038
diff
changeset
|
142 void unload_protocol(struct prpl *); |
1000
91b7377e7b45
[gaim-migrate @ 1010]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
981
diff
changeset
|
143 |
981 | 144 struct prpl *find_prpl(int); |
1815
f15d449b3167
[gaim-migrate @ 1825]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1806
diff
changeset
|
145 void do_proto_menu(); |
981 | 146 |
1333
b332d8f46b84
[gaim-migrate @ 1343]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1318
diff
changeset
|
147 void register_user(gpointer, gpointer); |
1355
04874e92af24
[gaim-migrate @ 1365]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1333
diff
changeset
|
148 void prepare_regbox_for_next(); |
1333
b332d8f46b84
[gaim-migrate @ 1343]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1318
diff
changeset
|
149 |
1064
b0b40b5faede
[gaim-migrate @ 1074]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1047
diff
changeset
|
150 void do_ask_dialog(const char *, void *, void *, void *); |
1500
a054c28735fb
[gaim-migrate @ 1510]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1499
diff
changeset
|
151 void do_prompt_dialog(const char *, void *, void *, void *); |
2050
ddd696ccb46b
[gaim-migrate @ 2060]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1920
diff
changeset
|
152 |
ddd696ccb46b
[gaim-migrate @ 2060]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1920
diff
changeset
|
153 /* UI for file transfer */ |
ddd696ccb46b
[gaim-migrate @ 2060]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1920
diff
changeset
|
154 #define FT_EXIST_DNE 0 |
ddd696ccb46b
[gaim-migrate @ 2060]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1920
diff
changeset
|
155 #define FT_EXIST_OVERWRITE 1 |
ddd696ccb46b
[gaim-migrate @ 2060]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1920
diff
changeset
|
156 #define FT_EXIST_RESUME 2 |
ddd696ccb46b
[gaim-migrate @ 2060]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1920
diff
changeset
|
157 typedef void (*ft_callback)(struct gaim_connection *, const char *, gint, gpointer); |
ddd696ccb46b
[gaim-migrate @ 2060]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1920
diff
changeset
|
158 |
ddd696ccb46b
[gaim-migrate @ 2060]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1920
diff
changeset
|
159 void ft_receive_request(struct gaim_connection *, const char *, gboolean, gboolean, |
ddd696ccb46b
[gaim-migrate @ 2060]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1920
diff
changeset
|
160 char *, guint size, ft_callback, gpointer); |
ddd696ccb46b
[gaim-migrate @ 2060]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1920
diff
changeset
|
161 void ft_send_request(struct gaim_connection *, const char *, gboolean, char *, ft_callback, gpointer); |
ddd696ccb46b
[gaim-migrate @ 2060]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1920
diff
changeset
|
162 gpointer ft_meter(gpointer, const char *, gfloat); |
ddd696ccb46b
[gaim-migrate @ 2060]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1920
diff
changeset
|
163 |
981 | 164 #endif |