Statistics
| Revision:

root / src / inc.h @ 880

History | View | Annotate | Download (2.3 kB)

1 1 hiro
/*
2 1 hiro
 * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
3 1 hiro
 * Copyright (C) 1999-2004 Hiroyuki Yamamoto
4 1 hiro
 *
5 1 hiro
 * This program is free software; you can redistribute it and/or modify
6 1 hiro
 * it under the terms of the GNU General Public License as published by
7 1 hiro
 * the Free Software Foundation; either version 2 of the License, or
8 1 hiro
 * (at your option) any later version.
9 1 hiro
 *
10 1 hiro
 * This program is distributed in the hope that it will be useful,
11 1 hiro
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 1 hiro
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 1 hiro
 * GNU General Public License for more details.
14 1 hiro
 *
15 1 hiro
 * You should have received a copy of the GNU General Public License
16 1 hiro
 * along with this program; if not, write to the Free Software
17 1 hiro
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 1 hiro
 */
19 1 hiro
20 1 hiro
#ifndef __INC_H__
21 1 hiro
#define __INC_H__
22 1 hiro
23 1 hiro
#ifdef HAVE_CONFIG_H
24 1 hiro
#  include "config.h"
25 1 hiro
#endif
26 1 hiro
27 1 hiro
#include <glib.h>
28 1 hiro
29 1 hiro
#include "mainwindow.h"
30 1 hiro
#include "progressdialog.h"
31 1 hiro
#include "prefs_account.h"
32 1 hiro
#include "session.h"
33 1 hiro
#include "pop.h"
34 1 hiro
35 1 hiro
typedef struct _IncProgressDialog        IncProgressDialog;
36 1 hiro
typedef struct _IncSession                IncSession;
37 1 hiro
38 1 hiro
typedef enum
39 1 hiro
{
40 1 hiro
        INC_SUCCESS,
41 1 hiro
        INC_CONNECT_ERROR,
42 1 hiro
        INC_AUTH_FAILED,
43 1 hiro
        INC_LOCKED,
44 1 hiro
        INC_ERROR,
45 1 hiro
        INC_NO_SPACE,
46 1 hiro
        INC_IO_ERROR,
47 1 hiro
        INC_SOCKET_ERROR,
48 1 hiro
        INC_EOF,
49 1 hiro
        INC_TIMEOUT,
50 1 hiro
        INC_CANCEL
51 1 hiro
} IncState;
52 1 hiro
53 1 hiro
struct _IncProgressDialog
54 1 hiro
{
55 1 hiro
        ProgressDialog *dialog;
56 1 hiro
57 1 hiro
        MainWindow *mainwin;
58 1 hiro
59 1 hiro
        gboolean show_dialog;
60 1 hiro
61 461 hiro
        GTimeVal progress_tv;
62 461 hiro
        GTimeVal folder_tv;
63 1 hiro
64 1 hiro
        GList *queue_list;        /* list of IncSession */
65 1 hiro
        gint cur_row;
66 1 hiro
};
67 1 hiro
68 1 hiro
struct _IncSession
69 1 hiro
{
70 1 hiro
        Session *session;
71 1 hiro
        IncState inc_state;
72 1 hiro
73 1 hiro
        GHashTable *folder_table;        /* table of destination folders */
74 1 hiro
        GHashTable *tmp_folder_table;        /* for progressive update */
75 1 hiro
76 1 hiro
        gint cur_total_bytes;
77 1 hiro
78 1 hiro
        gpointer data;
79 1 hiro
};
80 1 hiro
81 1 hiro
#define TIMEOUT_ITV        200
82 1 hiro
83 1 hiro
void inc_mail                        (MainWindow        *mainwin);
84 1 hiro
gint inc_account_mail                (MainWindow        *mainwin,
85 1 hiro
                                 PrefsAccount        *account);
86 1 hiro
void inc_all_account_mail        (MainWindow        *mainwin,
87 1 hiro
                                 gboolean         autocheck);
88 1 hiro
void inc_progress_update        (Pop3Session        *session);
89 1 hiro
90 1 hiro
gboolean inc_is_active                (void);
91 1 hiro
92 1 hiro
void inc_cancel_all                (void);
93 1 hiro
94 1 hiro
void inc_lock                        (void);
95 1 hiro
void inc_unlock                        (void);
96 1 hiro
97 1 hiro
void inc_autocheck_timer_init        (MainWindow        *mainwin);
98 1 hiro
void inc_autocheck_timer_set        (void);
99 1 hiro
void inc_autocheck_timer_remove        (void);
100 1 hiro
101 1 hiro
#endif /* __INC_H__ */