86241b73e6cd6b68d94f1c21db63851e9ea2b086
[claws.git] / src / inc.h
1 /*
2  * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
3  * Copyright (C) 1999,2000 Hiroyuki Yamamoto
4  *
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.
9  *
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.
14  *
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.
18  */
19
20 #ifndef __INC_H__
21 #define __INC_H__
22
23 #ifdef HAVE_CONFIG_H
24 #  include "config.h"
25 #endif
26
27 #include <glib.h>
28
29 #include "mainwindow.h"
30 #include "progressdialog.h"
31 #include "prefs_account.h"
32 #include "pop.h"
33 #include "automaton.h"
34 #include "socket.h"
35
36 typedef struct _IncProgressDialog       IncProgressDialog;
37 typedef struct _IncSession              IncSession;
38 typedef struct _Pop3State               Pop3State;
39
40 typedef enum
41 {
42         INC_SUCCESS,
43         INC_ERROR,
44         INC_NOSPACE,
45         INC_CANCEL
46 } IncState;
47
48 struct _IncProgressDialog
49 {
50         ProgressDialog *dialog;
51
52         MainWindow *mainwin;
53
54         GList *queue_list;      /* list of IncSession */
55 };
56
57 struct _IncSession
58 {
59         Pop3State *pop3_state;
60         Automaton *atm;
61
62         gpointer data;
63 };
64
65 struct _Pop3State
66 {
67         gboolean cancelled;
68         PrefsAccount *ac_prefs;
69         GHashTable *folder_table;
70
71         gchar *prev_folder;
72
73         SockInfo *sockinfo;
74
75         gchar *greeting;
76         gchar *user;
77         gchar *pass;
78         gint count;
79         gint new;
80         gint bytes;
81         gint cur_msg;
82
83         /* UIDL */
84         GHashTable *id_table;
85         GSList *id_list;
86         GSList *new_id_list;
87
88         gint error_val;
89         IncState inc_state;
90
91         IncSession *session;
92 };
93
94 #define TIMEOUT_ITV     200
95
96 void inc_mail                   (MainWindow     *mainwin);
97 void inc_all_account_mail       (MainWindow     *mainwin);
98 void inc_progress_update        (Pop3State      *state,
99                                  Pop3Phase       phase);
100 gint inc_drop_message           (const gchar    *file,
101                                  Pop3State      *state);
102
103 #endif /* __INC_H__ */