2012-04-01 [colin] 3.8.0cvs36
[claws.git] / src / compose.h
index 53b37c8fb78e6ee4c7999ee0ac481d5bd48c3fdd..0c67bed6ccb35fb5635aee90b82164f59187de1b 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2007 Hiroyuki Yamamoto
+ * Copyright (C) 1999-2011 Hiroyuki Yamamoto
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -28,7 +28,9 @@ typedef struct _AttachInfo    AttachInfo;
 
 #include "procmsg.h"
 #include "procmime.h"
+#ifndef USE_NEW_ADDRBOOK
 #include "addressbook.h"
+#endif
 #include "prefs_account.h"
 #include "undo.h"
 #include "toolbar.h"
@@ -38,11 +40,12 @@ typedef struct _AttachInfo  AttachInfo;
 #include "textview.h"
 #include "folder.h"
 
-#ifdef USE_ASPELL
+#ifdef USE_ENCHANT
 #include "gtkaspell.h"
 #endif
 
 #define COMPOSE_CHECK_BEFORE_SEND_HOOKLIST "compose_check_before_send"
+#define COMPOSE_CREATED_HOOKLIST "compose_created"
 
 typedef enum
 {
@@ -51,7 +54,8 @@ typedef enum
        COMPOSE_BCC,
        COMPOSE_REPLYTO,
        COMPOSE_NEWSGROUPS,
-       COMPOSE_FOLLOWUPTO
+       COMPOSE_FOLLOWUPTO,
+       COMPOSE_INREPLYTO
 } ComposeEntryType;
 
 typedef enum
@@ -60,6 +64,7 @@ typedef enum
        COMPOSE_REPLY_WITH_QUOTE,
        COMPOSE_REPLY_WITHOUT_QUOTE,
        COMPOSE_REPLY_TO_SENDER,
+       COMPOSE_REPLY_TO_ADDRESS,
        COMPOSE_FOLLOWUP_AND_REPLY_TO,
        COMPOSE_REPLY_TO_SENDER_WITH_QUOTE,
        COMPOSE_REPLY_TO_SENDER_WITHOUT_QUOTE,
@@ -77,11 +82,23 @@ typedef enum
        COMPOSE_REEDIT
 } ComposeMode;
 
+typedef enum {
+       PREF_ACCOUNT,
+       PREF_FOLDER,
+       PREF_TEMPLATE,
+       PREF_ML,
+       PREF_MAILTO,
+       PREF_NONE
+} ComposePrefType;
+
 typedef struct {
        guint headernum;
        Compose *compose;
        GtkWidget *combo;
        GtkWidget *entry;
+       GtkWidget *button;
+       GtkWidget *hbox;
+       ComposePrefType type;
 } ComposeHeaderEntry;
 
 struct _Compose
@@ -100,6 +117,7 @@ struct _Compose
        /* Header */
        GtkWidget *table_vbox;
        GtkWidget *table;
+       GtkWidget *account_combo;
        GtkWidget *subject_entry;
        GtkWidget *paned;
 
@@ -110,7 +128,7 @@ struct _Compose
 
        /* Others */
        GtkWidget *savemsg_checkbtn;
-       GtkWidget *savemsg_entry;
+       GtkWidget *savemsg_combo;
 
        /* Headers notebook */
        GtkWidget *notebook;
@@ -122,7 +140,9 @@ struct _Compose
        GtkWidget *scrolledwin;
        GtkWidget *text;
        GtkWidget *from_name;
+#if !GTK_CHECK_VERSION(2,12,0)
        GtkTooltips *tooltips;
+#endif
 
        GtkWidget *focused_editable;
 
@@ -142,6 +162,8 @@ struct _Compose
        guint      header_nextrow;
        ComposeHeaderEntry *header_last;
 
+       GHashTable *email_hashtable;
+
        gchar   *replyto;
        gchar   *cc;
        gchar   *bcc;
@@ -156,6 +178,7 @@ struct _Compose
        gchar   *boundary;
 
        gboolean autowrap;
+       gboolean autoindent;
 
        gboolean use_to;
        gboolean use_cc;
@@ -197,12 +220,6 @@ struct _Compose
        GIOChannel *exteditor_ch;
        gint        exteditor_tag;
 
-#if USE_ASPELL
-        /* GNU/aspell spell checker */
-        GtkAspell *gtkaspell;
-       GtkWidget *aspell_options_menu;
-#endif
-
        /* Priority */
        gint priority;
 
@@ -232,6 +249,11 @@ struct _Compose
        GtkWidget *first_entry;
        
        GtkUIManager *ui_manager;
+#if USE_ENCHANT
+        /* GNU/aspell spell checker */
+        GtkAspell *gtkaspell;
+       GtkWidget *aspell_options_menu;
+#endif
 };
 
 struct _AttachInfo
@@ -241,6 +263,7 @@ struct _AttachInfo
        EncodingType encoding;
        gchar *name;
        goffset size;
+       gchar *charset;
 };
 
 typedef enum
@@ -255,7 +278,7 @@ typedef enum
 /* attache_files will be locale encode */
 Compose *compose_new                   (PrefsAccount   *account,
                                         const gchar    *mailto,
-                                        GPtrArray      *attach_files);
+                                        GList          *attach_files);
 
 Compose *compose_new_with_folderitem   (PrefsAccount   *account,
                                         FolderItem     *item,
@@ -281,7 +304,8 @@ GList *compose_get_compose_list             (void);
 
 void compose_entry_append              (Compose          *compose,
                                         const gchar      *address,
-                                        ComposeEntryType  type);
+                                        ComposeEntryType  type,
+                                        ComposePrefType   pref_type);
 
 
 gint compose_send                      (Compose          *compose);
@@ -294,6 +318,9 @@ void compose_destroy_all                (void);
 gboolean compose_draft                 (gpointer data, guint action);
 void compose_toolbar_cb                        (gint           action, 
                                         gpointer       data);
+void compose_reply_to_address          (MessageView    *msgview,
+                                        MsgInfo        *msginfo,
+                                        const gchar    *address);
 void compose_reply_from_messageview    (MessageView    *msgview, 
                                         GSList         *msginfo_list, 
                                         guint           action);
@@ -316,4 +343,6 @@ gboolean compose_close                      (Compose *compose);
 void compose_close_toolbar             (Compose *compose);
 void compose_clear_exit_drafts         (void);
 void compose_reopen_exit_drafts                (void);
+void compose_attach_from_list (Compose *compose, GList *file_list, gboolean free_data);
+void compose_check_for_email_account(Compose *compose);
 #endif /* __COMPOSE_H__ */