2 * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
3 * Copyright (C) 1999-2003 Hiroyuki Yamamoto
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
34 typedef struct _Session Session;
36 #define SESSION(obj) ((Session *)obj)
56 SESSION_MSG_SEND_DATA,
57 SESSION_MSG_RECV_DATA,
63 typedef gint (*RecvMsgNotify) (Session *session,
66 typedef gint (*RecvDataProgressiveNotify) (Session *session,
70 typedef gint (*RecvDataNotify) (Session *session,
73 typedef gint (*SendDataProgressiveNotify) (Session *session,
77 typedef gint (*SendDataNotify) (Session *session,
96 time_t last_access_time;
102 GIOChannel *write_ch;
108 /* virtual methods to parse server responses */
109 gint (*recv_msg) (Session *session,
112 gint (*recv_data_finished) (Session *session,
115 gint (*send_data_finished) (Session *session,
118 void (*destroy) (Session *session);
120 /* notification functions */
121 RecvMsgNotify recv_msg_notify;
122 RecvDataProgressiveNotify recv_data_progressive_notify;
123 RecvDataNotify recv_data_notify;
124 SendDataProgressiveNotify send_data_progressive_notify;
125 SendDataNotify send_data_notify;
127 gpointer recv_msg_notify_data;
128 gpointer recv_data_progressive_notify_data;
129 gpointer recv_data_notify_data;
130 gpointer send_data_progressive_notify_data;
131 gpointer send_data_notify_data;
134 void session_init (Session *session);
135 gint session_connect (Session *session,
138 gint session_disconnect (Session *session);
139 void session_destroy (Session *session);
141 void session_set_recv_message_notify (Session *session,
142 RecvMsgNotify notify_func,
144 void session_set_recv_data_progressive_notify
146 RecvDataProgressiveNotify notify_func,
148 void session_set_recv_data_notify (Session *session,
149 RecvDataNotify notify_func,
151 void session_set_send_data_progressive_notify
153 SendDataProgressiveNotify notify_func,
155 void session_set_send_data_notify (Session *session,
156 SendDataNotify notify_func,
159 gint session_send_msg (Session *session,
162 gint session_send_data (Session *session,
165 gint session_recv_data (Session *session,
167 gboolean unescape_dot);
170 gint session_start_tls (Session *session);
173 #endif /* __SESSION_H__ */