source: protocols/yahoo/yahoo2_types.h @ 52b3a99

Last change on this file since 52b3a99 was b7d3cc34, checked in by Wilmer van der Gaast <wilmer@…>, at 2005-11-06T18:23:18Z

Initial repository (0.99 release tree)

  • Property mode set to 100644
File size: 5.2 KB
Line 
1/*
2 * libyahoo2: yahoo2_types.h
3 *
4 * Copyright (C) 2002-2004, Philip S Tellis <philip.tellis AT gmx.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 YAHOO2_TYPES_H
23#define YAHOO2_TYPES_H
24
25#include "yahoo_list.h"
26
27#ifdef __cplusplus
28extern "C" {
29#endif
30
31enum yahoo_status {
32        YAHOO_STATUS_AVAILABLE = 0,
33        YAHOO_STATUS_BRB,
34        YAHOO_STATUS_BUSY,
35        YAHOO_STATUS_NOTATHOME,
36        YAHOO_STATUS_NOTATDESK,
37        YAHOO_STATUS_NOTINOFFICE,
38        YAHOO_STATUS_ONPHONE,
39        YAHOO_STATUS_ONVACATION,
40        YAHOO_STATUS_OUTTOLUNCH,
41        YAHOO_STATUS_STEPPEDOUT,
42        YAHOO_STATUS_INVISIBLE = 12,
43        YAHOO_STATUS_CUSTOM = 99,
44        YAHOO_STATUS_IDLE = 999,
45        YAHOO_STATUS_OFFLINE = 0x5a55aa56, /* don't ask */
46        YAHOO_STATUS_NOTIFY = 0x16
47};
48#define YAHOO_STATUS_GAME       0x2             /* Games don't fit into the regular status model */
49
50enum yahoo_login_status {
51        YAHOO_LOGIN_OK = 0,
52        YAHOO_LOGIN_UNAME = 3,
53        YAHOO_LOGIN_PASSWD = 13,
54        YAHOO_LOGIN_LOCK = 14,
55        YAHOO_LOGIN_DUPL = 99,
56        YAHOO_LOGIN_SOCK = -1
57};
58
59enum yahoo_error {
60        E_CUSTOM = 0,
61
62        /* responses from ignore buddy */
63        E_IGNOREDUP = 2,
64        E_IGNORENONE = 3,
65        E_IGNORECONF = 12,
66       
67        /* conference */
68        E_CONFNOTAVAIL = 20
69};
70
71enum yahoo_log_level {
72        YAHOO_LOG_NONE = 0,
73        YAHOO_LOG_FATAL,
74        YAHOO_LOG_ERR,
75        YAHOO_LOG_WARNING,
76        YAHOO_LOG_NOTICE,
77        YAHOO_LOG_INFO,
78        YAHOO_LOG_DEBUG
79};
80
81
82/* Yahoo style/color directives */
83#define YAHOO_COLOR_BLACK "\033[30m"
84#define YAHOO_COLOR_BLUE "\033[31m"
85#define YAHOO_COLOR_LIGHTBLUE "\033[32m"
86#define YAHOO_COLOR_GRAY "\033[33m"
87#define YAHOO_COLOR_GREEN "\033[34m"
88#define YAHOO_COLOR_PINK "\033[35m"
89#define YAHOO_COLOR_PURPLE "\033[36m"
90#define YAHOO_COLOR_ORANGE "\033[37m"
91#define YAHOO_COLOR_RED "\033[38m"
92#define YAHOO_COLOR_OLIVE "\033[39m"
93#define YAHOO_COLOR_ANY "\033[#"
94#define YAHOO_STYLE_ITALICON "\033[2m"
95#define YAHOO_STYLE_ITALICOFF "\033[x2m"
96#define YAHOO_STYLE_BOLDON "\033[1m"
97#define YAHOO_STYLE_BOLDOFF "\033[x1m"
98#define YAHOO_STYLE_UNDERLINEON "\033[4m"
99#define YAHOO_STYLE_UNDERLINEOFF "\033[x4m"
100#define YAHOO_STYLE_URLON "\033[lm"
101#define YAHOO_STYLE_URLOFF "\033[xlm"
102
103enum yahoo_connection_type {
104        YAHOO_CONNECTION_PAGER=0,
105        YAHOO_CONNECTION_FT,
106        YAHOO_CONNECTION_YAB,
107        YAHOO_CONNECTION_WEBCAM_MASTER,
108        YAHOO_CONNECTION_WEBCAM,
109        YAHOO_CONNECTION_CHATCAT,
110        YAHOO_CONNECTION_SEARCH
111};
112
113enum yahoo_webcam_direction_type {
114        YAHOO_WEBCAM_DOWNLOAD=0,
115        YAHOO_WEBCAM_UPLOAD
116};
117
118/* chat member attribs */
119#define YAHOO_CHAT_MALE 0x8000
120#define YAHOO_CHAT_FEMALE 0x10000
121#define YAHOO_CHAT_FEMALE 0x10000
122#define YAHOO_CHAT_DUNNO 0x400
123#define YAHOO_CHAT_WEBCAM 0x10
124
125enum yahoo_webcam_conn_type { Y_WCM_DIALUP, Y_WCM_DSL, Y_WCM_T1 };
126
127struct yahoo_webcam {
128        int direction;     /* Uploading or downloading */
129        int conn_type;     /* 0=Dialup, 1=DSL/Cable, 2=T1/Lan */
130
131        char *user;        /* user we are viewing */
132        char *server;      /* webcam server to connect to */
133        int   port;        /* webcam port to connect on */
134        char *key;         /* key to connect to the server with */
135        char *description; /* webcam description */
136        char *my_ip;       /* own ip number */
137};
138
139struct yahoo_webcam_data {
140        unsigned int data_size;
141        unsigned int to_read;
142        unsigned int timestamp;
143        unsigned char packet_type;
144};
145
146struct yahoo_data {
147        char  *user;
148        char  *password;
149
150        char  *cookie_y;
151        char  *cookie_t;
152        char  *cookie_c;
153        char  *login_cookie;
154
155        YList *buddies;
156        YList *ignore;
157        YList *identities;
158        char  *login_id;
159
160        int   current_status;
161        int   initial_status;
162        int   logged_in;
163
164        int   session_id;
165
166        int   client_id;
167
168        char  *rawbuddylist;
169        char  *ignorelist;
170
171        void  *server_settings;
172};
173
174struct yab {
175        char *id;
176        char *fname;
177        char *lname;
178        char *nname;
179        char *email;
180        char *hphone;
181        char *wphone;
182        char *mphone;
183        int  dbid;
184};
185
186struct yahoo_buddy {
187        char *group;
188        char *id;
189        char *real_name;
190        struct yab *yab_entry;
191};
192
193enum yahoo_search_type {
194        YAHOO_SEARCH_KEYWORD = 0,
195        YAHOO_SEARCH_YID,
196        YAHOO_SEARCH_NAME
197};
198
199enum yahoo_search_gender {
200        YAHOO_GENDER_NONE = 0,
201        YAHOO_GENDER_MALE,
202        YAHOO_GENDER_FEMALE
203};
204
205enum yahoo_search_agerange {
206        YAHOO_AGERANGE_NONE = 0
207};
208
209struct yahoo_found_contact {
210        char *id;
211        char *gender;
212        char *location;
213        int age;
214        int online;
215};
216
217/*
218 * Function pointer to be passed to http get/post and send file
219 */
220typedef void (*yahoo_get_fd_callback)(int id, int fd, int error, void *data);
221
222/*
223 * Function pointer to be passed to yahoo_get_url_handle
224 */
225typedef void (*yahoo_get_url_handle_callback)(int id, int fd, int error,
226                const char *filename, unsigned long size, void *data);
227
228
229struct yahoo_chat_member {
230        char *id;
231        int  age;
232        int  attribs;
233        char *alias;
234        char *location;
235};
236
237#ifdef __cplusplus
238}
239#endif
240
241#endif
Note: See TracBrowser for help on using the repository browser.