inc.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. /*
  2. * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
  3. * Copyright (C) 1999-2009 Hiroyuki Yamamoto and the Claws Mail team
  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 3 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, see <http://www.gnu.org/licenses/>.
  17. *
  18. */
  19. #ifndef __INC_H__
  20. #define __INC_H__
  21. #ifdef HAVE_CONFIG_H
  22. # include "config.h"
  23. #endif
  24. #include <glib.h>
  25. #include "mainwindow.h"
  26. #include "progressdialog.h"
  27. #include "prefs_account.h"
  28. #include "session.h"
  29. #include "pop.h"
  30. typedef struct _IncProgressDialog IncProgressDialog;
  31. typedef struct _IncSession IncSession;
  32. typedef enum
  33. {
  34. INC_SUCCESS,
  35. INC_CONNECT_ERROR,
  36. INC_AUTH_FAILED,
  37. INC_LOCKED,
  38. INC_ERROR,
  39. INC_NO_SPACE,
  40. INC_IO_ERROR,
  41. INC_SOCKET_ERROR,
  42. INC_EOF,
  43. INC_TIMEOUT,
  44. INC_CANCEL
  45. } IncState;
  46. struct _IncProgressDialog
  47. {
  48. ProgressDialog *dialog;
  49. MainWindow *mainwin;
  50. gboolean show_dialog;
  51. GTimeVal progress_tv;
  52. GTimeVal folder_tv;
  53. GList *queue_list; /* list of IncSession */
  54. gint cur_row;
  55. };
  56. struct _IncSession
  57. {
  58. Session *session;
  59. IncState inc_state;
  60. gint cur_total_bytes;
  61. gpointer data;
  62. };
  63. #define TIMEOUT_ITV 200
  64. void inc_mail (MainWindow *mainwin,
  65. gboolean notify);
  66. gint inc_account_mail (MainWindow *mainwin,
  67. PrefsAccount *account);
  68. void inc_all_account_mail (MainWindow *mainwin,
  69. gboolean autocheck,
  70. gboolean notify);
  71. void inc_progress_update (Pop3Session *session);
  72. void inc_pop_before_smtp (PrefsAccount *acc);
  73. gboolean inc_is_active (void);
  74. void inc_cancel_all (void);
  75. extern guint inc_lock_count;
  76. #define inc_lock() { \
  77. inc_lock_real(); \
  78. debug_print("called inc_lock (lock count %d)\n", inc_lock_count); \
  79. }
  80. #define inc_unlock() { \
  81. inc_unlock_real(); \
  82. debug_print("called inc_unlock (lock count %d)\n", inc_lock_count); \
  83. }
  84. void inc_lock_real (void);
  85. void inc_unlock_real (void);
  86. void inc_autocheck_timer_init (MainWindow *mainwin);
  87. void inc_autocheck_timer_set (void);
  88. void inc_autocheck_timer_remove (void);
  89. gboolean inc_offline_should_override(gboolean force_ask, const gchar *msg);
  90. #endif /* __INC_H__ */