2005-02-25 [paul] 1.0.1cvs15.12
[claws.git] / src / inc.h
1 /*
2  * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
3  * Copyright (C) 1999-2004 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 #include <sys/time.h>
30
31 #include "mainwindow.h"
32 #include "progressdialog.h"
33 #include "prefs_account.h"
34 #include "session.h"
35 #include "pop.h"
36
37 typedef struct _IncProgressDialog       IncProgressDialog;
38 typedef struct _IncSession              IncSession;
39
40 typedef enum
41 {
42         INC_SUCCESS,
43         INC_CONNECT_ERROR,
44         INC_AUTH_FAILED,
45         INC_LOCKED,
46         INC_ERROR,
47         INC_NO_SPACE,
48         INC_IO_ERROR,
49         INC_SOCKET_ERROR,
50         INC_EOF,
51         INC_TIMEOUT,
52         INC_CANCEL
53 } IncState;
54
55 struct _IncProgressDialog
56 {
57         ProgressDialog *dialog;
58
59         MainWindow *mainwin;
60
61         gboolean show_dialog;
62
63         struct timeval progress_tv;
64         struct timeval folder_tv;
65
66         GList *queue_list;      /* list of IncSession */
67         gint cur_row;
68 };
69
70 struct _IncSession
71 {
72         Session *session;
73         IncState inc_state;
74
75         gint cur_total_bytes;
76
77         gpointer data;
78 };
79
80 #define TIMEOUT_ITV     200
81
82 void inc_mail                   (MainWindow     *mainwin,
83                                  gboolean        notify);
84 gint inc_account_mail           (MainWindow     *mainwin,
85                                  PrefsAccount   *account);
86 void inc_all_account_mail       (MainWindow     *mainwin,
87                                  gboolean        autocheck,
88                                  gboolean        notify);
89 void inc_progress_update        (Pop3Session    *session);
90
91 void inc_pop_before_smtp        (PrefsAccount   *acc);
92
93 gboolean inc_is_active          (void);
94
95 void inc_cancel_all             (void);
96
97 void inc_lock                   (void);
98 void inc_unlock                 (void);
99
100 void inc_autocheck_timer_init   (MainWindow     *mainwin);
101 void inc_autocheck_timer_set    (void);
102 void inc_autocheck_timer_remove (void);
103
104 #endif /* __INC_H__ */