0.8.8claws113
[claws.git] / src / inc.h
1 /*
2  * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
3  * Copyright (C) 1999-2002 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 #include <time.h>
29
30 #include "mainwindow.h"
31 #include "progressdialog.h"
32 #include "prefs_account.h"
33 #include "pop.h"
34 #include "automaton.h"
35 #include "socket.h"
36
37 #define MAIL_FILTERING_HOOKLIST "mail_filtering_hooklist"
38
39 typedef struct _IncProgressDialog       IncProgressDialog;
40 typedef struct _IncSession              IncSession;
41 typedef struct _MailFilteringData       MailFilteringData;
42
43 typedef enum
44 {
45         INC_SUCCESS,
46         INC_CONNECT_ERROR,
47         INC_AUTH_FAILED,
48         INC_LOCKED,
49         INC_ERROR,
50         INC_NO_SPACE,
51         INC_IO_ERROR,
52         INC_SOCKET_ERROR,
53         INC_CANCEL
54 } IncState;
55
56 struct _IncProgressDialog
57 {
58         ProgressDialog *dialog;
59
60         MainWindow *mainwin;
61
62         gboolean show_dialog;
63
64         GList *queue_list;      /* list of IncSession */
65 };
66
67 struct _IncSession
68 {
69         Pop3State *pop3_state;
70         Automaton *atm;
71         IncState inc_state;
72
73         gpointer data;
74 };
75
76 struct _MailFilteringData
77 {
78         MsgInfo *msginfo;
79 };
80
81 #define TIMEOUT_ITV     200
82
83 void inc_mail                   (MainWindow     *mainwin,
84                                  gboolean notify);
85 void inc_all_account_mail       (MainWindow     *mainwin,
86                                  gboolean notify);
87 void inc_selective_download     (MainWindow     *mainwin, 
88                                  PrefsAccount   *acc,
89                                  gint            session);
90 void inc_progress_update        (Pop3State      *state,
91                                  Pop3Phase       phase);
92 gint inc_drop_message           (const gchar    *file,
93                                  Pop3State      *state);
94
95 void inc_pop_before_smtp        (PrefsAccount   *acc);
96
97 gboolean inc_is_active          (void);
98
99 void inc_cancel_all             (void);
100
101 void inc_lock                   (void);
102 void inc_unlock                 (void);
103
104 void inc_autocheck_timer_init   (MainWindow     *mainwin);
105 void inc_autocheck_timer_set    (void);
106 void inc_autocheck_timer_remove (void);
107
108 #endif /* __INC_H__ */