root / src / compose.h @ 1029
History | View | Annotate | Download (4.9 kB)
| 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
| 18 | */ |
| 19 | |
| 20 | #ifndef __COMPOSE_H__
|
| 21 | #define __COMPOSE_H__
|
| 22 | |
| 23 | #include <glib.h> |
| 24 | #include <gtk/gtkwidget.h> |
| 25 | #include <gtk/gtkitemfactory.h> |
| 26 | #include <gtk/gtktexttag.h> |
| 27 | #include <gtk/gtkliststore.h> |
| 28 | |
| 29 | typedef struct _Compose Compose; |
| 30 | typedef struct _AttachInfo AttachInfo; |
| 31 | |
| 32 | #include "procmsg.h" |
| 33 | #include "procmime.h" |
| 34 | #include "folder.h" |
| 35 | #include "addressbook.h" |
| 36 | #include "prefs_account.h" |
| 37 | #include "undo.h" |
| 38 | #include "codeconv.h" |
| 39 | |
| 40 | typedef enum |
| 41 | {
|
| 42 | COMPOSE_ENTRY_TO, |
| 43 | COMPOSE_ENTRY_CC, |
| 44 | COMPOSE_ENTRY_BCC, |
| 45 | COMPOSE_ENTRY_REPLY_TO, |
| 46 | COMPOSE_ENTRY_SUBJECT, |
| 47 | COMPOSE_ENTRY_NEWSGROUPS, |
| 48 | COMPOSE_ENTRY_FOLLOWUP_TO |
| 49 | } ComposeEntryType; |
| 50 | |
| 51 | typedef enum |
| 52 | {
|
| 53 | COMPOSE_REPLY = 1,
|
| 54 | COMPOSE_REPLY_TO_SENDER = 2,
|
| 55 | COMPOSE_REPLY_TO_ALL = 3,
|
| 56 | COMPOSE_REPLY_TO_LIST = 4,
|
| 57 | COMPOSE_FORWARD = 5,
|
| 58 | COMPOSE_FORWARD_AS_ATTACH = 6,
|
| 59 | COMPOSE_NEW = 7,
|
| 60 | COMPOSE_REDIRECT = 8,
|
| 61 | COMPOSE_REEDIT = 9,
|
| 62 | |
| 63 | COMPOSE_WITH_QUOTE = 1 << 16, |
| 64 | COMPOSE_WITHOUT_QUOTE = 2 << 16, |
| 65 | |
| 66 | COMPOSE_MODE_MASK = 0xffff,
|
| 67 | COMPOSE_QUOTE_MODE_MASK = 0x30000
|
| 68 | } ComposeMode; |
| 69 | |
| 70 | #define COMPOSE_MODE(mode) ((mode) & COMPOSE_MODE_MASK)
|
| 71 | #define COMPOSE_QUOTE_MODE(mode) ((mode) & COMPOSE_QUOTE_MODE_MASK)
|
| 72 | |
| 73 | struct _Compose
|
| 74 | {
|
| 75 | GtkWidget *window; |
| 76 | GtkWidget *vbox; |
| 77 | GtkWidget *menubar; |
| 78 | |
| 79 | GtkWidget *toolbar; |
| 80 | GtkWidget *send_btn; |
| 81 | GtkWidget *sendl_btn; |
| 82 | GtkWidget *draft_btn; |
| 83 | GtkWidget *insert_btn; |
| 84 | GtkWidget *attach_btn; |
| 85 | GtkWidget *sig_btn; |
| 86 | GtkWidget *exteditor_btn; |
| 87 | GtkWidget *linewrap_btn; |
| 88 | GtkWidget *addrbook_btn; |
| 89 | |
| 90 | GtkWidget *vbox2; |
| 91 | |
| 92 | GtkWidget *table_vbox; |
| 93 | GtkWidget *table; |
| 94 | GtkWidget *to_hbox; |
| 95 | GtkWidget *to_entry; |
| 96 | GtkWidget *newsgroups_hbox; |
| 97 | GtkWidget *newsgroups_entry; |
| 98 | GtkWidget *subject_entry; |
| 99 | GtkWidget *cc_hbox; |
| 100 | GtkWidget *cc_entry; |
| 101 | GtkWidget *bcc_hbox; |
| 102 | GtkWidget *bcc_entry; |
| 103 | GtkWidget *reply_hbox; |
| 104 | GtkWidget *reply_entry; |
| 105 | GtkWidget *followup_hbox; |
| 106 | GtkWidget *followup_entry; |
| 107 | |
| 108 | GtkWidget *misc_hbox; |
| 109 | GtkWidget *attach_toggle; |
| 110 | GtkWidget *signing_chkbtn; |
| 111 | GtkWidget *encrypt_chkbtn; |
| 112 | |
| 113 | GtkWidget *paned; |
| 114 | |
| 115 | GtkWidget *attach_scrwin; |
| 116 | GtkWidget *attach_treeview; |
| 117 | GtkListStore *attach_store; |
| 118 | |
| 119 | GtkWidget *edit_vbox; |
| 120 | GtkWidget *ruler_hbox; |
| 121 | GtkWidget *ruler; |
| 122 | GtkWidget *scrolledwin; |
| 123 | GtkWidget *text; |
| 124 | |
| 125 | GtkWidget *focused_editable; |
| 126 | |
| 127 | GtkWidget *popupmenu; |
| 128 | |
| 129 | GtkItemFactory *popupfactory; |
| 130 | |
| 131 | GtkWidget *tmpl_menu; |
| 132 | |
| 133 | #if USE_GTKSPELL
|
| 134 | GtkWidget *spell_menu; |
| 135 | gchar *spell_lang; |
| 136 | gboolean check_spell; |
| 137 | #endif
|
| 138 | |
| 139 | ComposeMode mode; |
| 140 | |
| 141 | MsgInfo *targetinfo; |
| 142 | MsgInfo *replyinfo; |
| 143 | |
| 144 | gchar *replyto; |
| 145 | gchar *cc; |
| 146 | gchar *bcc; |
| 147 | gchar *newsgroups; |
| 148 | gchar *followup_to; |
| 149 | |
| 150 | gchar *ml_post; |
| 151 | |
| 152 | gchar *inreplyto; |
| 153 | gchar *references; |
| 154 | gchar *msgid; |
| 155 | gchar *boundary; |
| 156 | |
| 157 | gboolean autowrap; |
| 158 | |
| 159 | gboolean use_to; |
| 160 | gboolean use_cc; |
| 161 | gboolean use_bcc; |
| 162 | gboolean use_replyto; |
| 163 | gboolean use_newsgroups; |
| 164 | gboolean use_followupto; |
| 165 | gboolean use_attach; |
| 166 | |
| 167 | CharSet out_encoding; |
| 168 | |
| 169 | /* privacy settings */
|
| 170 | gboolean use_signing; |
| 171 | gboolean use_encryption; |
| 172 | |
| 173 | gboolean modified; |
| 174 | |
| 175 | GSList *to_list; |
| 176 | GSList *newsgroup_list; |
| 177 | |
| 178 | PrefsAccount *account; |
| 179 | |
| 180 | UndoMain *undostruct; |
| 181 | |
| 182 | GtkTextTag *sig_tag; |
| 183 | |
| 184 | /* external editor */
|
| 185 | gchar *exteditor_file; |
| 186 | GPid exteditor_pid; |
| 187 | guint exteditor_tag; |
| 188 | |
| 189 | guint autosave_tag; |
| 190 | |
| 191 | guint lock_count; |
| 192 | }; |
| 193 | |
| 194 | struct _AttachInfo
|
| 195 | {
|
| 196 | gchar *file; |
| 197 | gchar *content_type; |
| 198 | EncodingType encoding; |
| 199 | gchar *name; |
| 200 | off_t size; |
| 201 | }; |
| 202 | |
| 203 | Compose *compose_new (PrefsAccount *account, |
| 204 | FolderItem *item, |
| 205 | const gchar *mailto,
|
| 206 | GPtrArray *attach_files); |
| 207 | |
| 208 | void compose_reply (MsgInfo *msginfo,
|
| 209 | FolderItem *item, |
| 210 | ComposeMode mode, |
| 211 | const gchar *body);
|
| 212 | void compose_forward (GSList *mlist,
|
| 213 | FolderItem *item, |
| 214 | gboolean as_attach, |
| 215 | const gchar *body);
|
| 216 | void compose_redirect (MsgInfo *msginfo,
|
| 217 | FolderItem *item); |
| 218 | void compose_reedit (MsgInfo *msginfo);
|
| 219 | |
| 220 | GList *compose_get_compose_list (void);
|
| 221 | |
| 222 | void compose_entry_set (Compose *compose,
|
| 223 | const gchar *text,
|
| 224 | ComposeEntryType type); |
| 225 | void compose_entry_append (Compose *compose,
|
| 226 | const gchar *text,
|
| 227 | ComposeEntryType type); |
| 228 | |
| 229 | void compose_lock (Compose *compose);
|
| 230 | void compose_unlock (Compose *compose);
|
| 231 | |
| 232 | void compose_reflect_prefs_all (void); |
| 233 | |
| 234 | #endif /* __COMPOSE_H__ */ |