compose.h 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315
  1. /*
  2. * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
  3. * Copyright (C) 1999-2006 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  18. */
  19. #ifndef __COMPOSE_H__
  20. #define __COMPOSE_H__
  21. typedef struct _Compose Compose;
  22. typedef struct _AttachInfo AttachInfo;
  23. #include <glib.h>
  24. #include <gtk/gtkwidget.h>
  25. #include <gtk/gtkitemfactory.h>
  26. #include "procmsg.h"
  27. #include "procmime.h"
  28. #include "addressbook.h"
  29. #include "prefs_account.h"
  30. #include "undo.h"
  31. #include "toolbar.h"
  32. #include "messageview.h"
  33. #include "codeconv.h"
  34. #include "template.h"
  35. #include "textview.h"
  36. #ifdef USE_ASPELL
  37. #include "gtkaspell.h"
  38. #endif
  39. typedef enum
  40. {
  41. COMPOSE_TO,
  42. COMPOSE_CC,
  43. COMPOSE_BCC,
  44. COMPOSE_REPLYTO,
  45. COMPOSE_NEWSGROUPS,
  46. COMPOSE_FOLLOWUPTO
  47. } ComposeEntryType;
  48. typedef enum
  49. {
  50. COMPOSE_REPLY,
  51. COMPOSE_REPLY_WITH_QUOTE,
  52. COMPOSE_REPLY_WITHOUT_QUOTE,
  53. COMPOSE_REPLY_TO_SENDER,
  54. COMPOSE_FOLLOWUP_AND_REPLY_TO,
  55. COMPOSE_REPLY_TO_SENDER_WITH_QUOTE,
  56. COMPOSE_REPLY_TO_SENDER_WITHOUT_QUOTE,
  57. COMPOSE_REPLY_TO_ALL,
  58. COMPOSE_REPLY_TO_ALL_WITH_QUOTE,
  59. COMPOSE_REPLY_TO_ALL_WITHOUT_QUOTE,
  60. COMPOSE_REPLY_TO_LIST,
  61. COMPOSE_REPLY_TO_LIST_WITH_QUOTE,
  62. COMPOSE_REPLY_TO_LIST_WITHOUT_QUOTE,
  63. COMPOSE_FORWARD,
  64. COMPOSE_FORWARD_AS_ATTACH,
  65. COMPOSE_FORWARD_INLINE,
  66. COMPOSE_NEW,
  67. COMPOSE_REDIRECT,
  68. COMPOSE_REEDIT
  69. } ComposeMode;
  70. typedef struct {
  71. guint headernum;
  72. Compose *compose;
  73. GtkWidget *combo;
  74. GtkWidget *entry;
  75. } ComposeHeaderEntry;
  76. struct _Compose
  77. {
  78. /* start with window widget don`t change order */
  79. GtkWidget *window;
  80. GtkWidget *vbox;
  81. GtkWidget *menubar;
  82. /* Toolbar handlebox */
  83. GtkWidget *handlebox;
  84. Toolbar *toolbar;
  85. GtkWidget *vbox2;
  86. /* Header */
  87. GtkWidget *table_vbox;
  88. GtkWidget *table;
  89. GtkWidget *subject_entry;
  90. GtkWidget *paned;
  91. /* Attachments */
  92. GtkWidget *attach_scrwin;
  93. GtkWidget *attach_clist;
  94. /* Others */
  95. GtkWidget *savemsg_checkbtn;
  96. GtkWidget *savemsg_entry;
  97. /* Textedit */
  98. GtkWidget *edit_vbox;
  99. GtkWidget *ruler_hbox;
  100. GtkWidget *ruler;
  101. GtkWidget *scrolledwin;
  102. GtkWidget *text;
  103. GtkWidget *from_name;
  104. GtkTooltips *tooltips;
  105. GtkWidget *focused_editable;
  106. GtkWidget *popupmenu;
  107. GtkItemFactory *popupfactory;
  108. GtkWidget *tmpl_menu;
  109. ComposeMode mode;
  110. MsgInfo *targetinfo;
  111. MsgInfo *replyinfo;
  112. MsgInfo *autosaved_draft;
  113. MsgInfo *fwdinfo;
  114. GtkWidget *header_table;
  115. GSList *header_list;
  116. guint header_nextrow;
  117. ComposeHeaderEntry *header_last;
  118. gchar *replyto;
  119. gchar *cc;
  120. gchar *bcc;
  121. gchar *newsgroups;
  122. gchar *followup_to;
  123. gchar *ml_post;
  124. gchar *inreplyto;
  125. gchar *references;
  126. gchar *msgid;
  127. gchar *boundary;
  128. gboolean autowrap;
  129. gboolean use_to;
  130. gboolean use_cc;
  131. gboolean use_bcc;
  132. gboolean use_replyto;
  133. gboolean use_newsgroups;
  134. gboolean use_followupto;
  135. gboolean use_attach;
  136. CharSet out_encoding;
  137. /* privacy settings */
  138. gboolean use_signing;
  139. gboolean use_encryption;
  140. gchar *privacy_system;
  141. gboolean modified;
  142. gboolean sending;
  143. gboolean return_receipt;
  144. gboolean batch;
  145. GSList *to_list;
  146. GSList *newsgroup_list;
  147. PrefsAccount *account;
  148. UndoMain *undostruct;
  149. gchar *sig_str;
  150. /* external editor */
  151. gchar *exteditor_file;
  152. pid_t exteditor_pid;
  153. GIOChannel *exteditor_ch;
  154. gint exteditor_tag;
  155. #if USE_ASPELL
  156. /* GNU/aspell spell checker */
  157. GtkAspell *gtkaspell;
  158. GtkWidget *aspell_options_menu;
  159. #endif
  160. /* Priority */
  161. gint priority;
  162. gchar *redirect_filename;
  163. gboolean remove_references;
  164. guint draft_timeout_tag;
  165. GtkTextTag *no_wrap_tag;
  166. GtkTextTag *no_join_tag;
  167. GMutex *mutex;
  168. gchar *orig_charset;
  169. gint set_cursor_pos;
  170. gboolean updating;
  171. gboolean deferred_destroy;
  172. ComposeMode rmode;
  173. };
  174. struct _AttachInfo
  175. {
  176. gchar *file;
  177. gchar *content_type;
  178. EncodingType encoding;
  179. gchar *name;
  180. off_t size;
  181. };
  182. /*#warning FIXME_GTK2 */
  183. /* attache_files will be locale encode */
  184. Compose *compose_new (PrefsAccount *account,
  185. const gchar *mailto,
  186. GPtrArray *attach_files);
  187. Compose *compose_new_with_folderitem (PrefsAccount *account,
  188. FolderItem *item,
  189. const gchar *mailto);
  190. Compose *compose_new_with_list (PrefsAccount *account,
  191. GList *listAddress);
  192. Compose *compose_reply_mode (ComposeMode mode,
  193. GSList *msginfo_list,
  194. gchar *body);
  195. /* remove */
  196. Compose *compose_followup_and_reply_to (MsgInfo *msginfo,
  197. gboolean quote,
  198. gboolean to_all,
  199. gboolean to_sender,
  200. const gchar *body);
  201. Compose *compose_reply (MsgInfo *msginfo,
  202. gboolean quote,
  203. gboolean to_all,
  204. gboolean to_ml,
  205. gboolean to_sender,
  206. const gchar *body);
  207. Compose *compose_forward (PrefsAccount *account,
  208. MsgInfo *msginfo,
  209. gboolean as_attach,
  210. const gchar *body,
  211. gboolean no_extedit,
  212. gboolean batch);
  213. Compose *compose_forward_multiple (PrefsAccount *account,
  214. GSList *msginfo_list);
  215. /* remove end */
  216. Compose *compose_redirect (PrefsAccount *account,
  217. MsgInfo *msginfo,
  218. gboolean batch);
  219. Compose *compose_reedit (MsgInfo *msginfo,
  220. gboolean batch);
  221. GList *compose_get_compose_list (void);
  222. void compose_template_apply_fields(Compose *compose, Template *tmpl);
  223. void compose_entry_append (Compose *compose,
  224. const gchar *address,
  225. ComposeEntryType type);
  226. void compose_entry_mark_default_to (Compose *compose,
  227. const gchar *address);
  228. gint compose_send (Compose *compose);
  229. void compose_update_actions_menu (Compose *compose);
  230. void compose_update_privacy_systems_menu(Compose *compose);
  231. void compose_reflect_prefs_all (void);
  232. void compose_reflect_prefs_pixmap_theme (void);
  233. void compose_destroy_all (void);
  234. void compose_draft (gpointer data);
  235. void compose_toolbar_cb (gint action,
  236. gpointer data);
  237. void compose_reply_from_messageview (MessageView *msgview,
  238. GSList *msginfo_list,
  239. guint action);
  240. void compose_action_cb (void *data);
  241. void compose_set_position (Compose *compose,
  242. gint pos);
  243. gboolean compose_search_string (Compose *compose,
  244. const gchar *str,
  245. gboolean case_sens);
  246. gboolean compose_search_string_backward (Compose *compose,
  247. const gchar *str,
  248. gboolean case_sens);
  249. gint compose_queue (Compose *compose,
  250. gint *msgnum,
  251. FolderItem **item,
  252. gchar **msgpath,
  253. gboolean remove_reedit_target);
  254. gboolean compose_close (Compose *compose);
  255. #endif /* __COMPOSE_H__ */