Statistics
| Revision:

root / src / compose.h @ 2022

History | View | Annotate | Download (5.04 KB)

1
/*
2
 * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
3
 * Copyright (C) 1999-2008 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
        GtkWidget *prefs_common_btn;
90
        GtkWidget *prefs_account_btn;
91

    
92
        GtkWidget *vbox2;
93

    
94
        GtkWidget *table_vbox;
95
        GtkWidget *table;
96
        GtkWidget *to_hbox;
97
        GtkWidget *to_entry;
98
        GtkWidget *newsgroups_hbox;
99
        GtkWidget *newsgroups_entry;
100
        GtkWidget *subject_entry;
101
        GtkWidget *cc_hbox;
102
        GtkWidget *cc_entry;
103
        GtkWidget *bcc_hbox;
104
        GtkWidget *bcc_entry;
105
        GtkWidget *reply_hbox;
106
        GtkWidget *reply_entry;
107
        GtkWidget *followup_hbox;
108
        GtkWidget *followup_entry;
109

    
110
        GtkWidget *misc_hbox;
111
        GtkWidget *attach_toggle;
112
        GtkWidget *signing_chkbtn;
113
        GtkWidget *encrypt_chkbtn;
114

    
115
        GtkWidget *paned;
116

    
117
        GtkWidget *attach_scrwin;
118
        GtkWidget *attach_treeview;
119
        GtkListStore *attach_store;
120

    
121
        GtkWidget *edit_vbox;
122
        GtkWidget *ruler_hbox;
123
        GtkWidget *ruler;
124
        GtkWidget *scrolledwin;
125
        GtkWidget *text;
126

    
127
        GtkWidget *focused_editable;
128

    
129
        GtkWidget *popupmenu;
130

    
131
        GtkItemFactory *popupfactory;
132

    
133
        GtkWidget *tmpl_menu;
134

    
135
#if USE_GTKSPELL
136
        GtkWidget *spell_menu;
137
        gchar     *spell_lang;
138
        gboolean   check_spell;
139
#endif
140

    
141
        ComposeMode mode;
142

    
143
        MsgInfo *targetinfo;
144
        gchar *reply_target;
145
        gchar *forward_targets;
146

    
147
        gchar        *replyto;
148
        gchar        *cc;
149
        gchar        *bcc;
150
        gchar        *newsgroups;
151
        gchar        *followup_to;
152

    
153
        gchar        *ml_post;
154

    
155
        gchar        *inreplyto;
156
        gchar        *references;
157
        gchar        *msgid;
158
        gchar        *boundary;
159

    
160
        gboolean autowrap;
161

    
162
        gboolean use_to;
163
        gboolean use_cc;
164
        gboolean use_bcc;
165
        gboolean use_replyto;
166
        gboolean use_newsgroups;
167
        gboolean use_followupto;
168
        gboolean use_attach;
169

    
170
        CharSet out_encoding;
171

    
172
        /* privacy settings */
173
        gboolean use_signing;
174
        gboolean use_encryption;
175

    
176
        gboolean modified;
177

    
178
        GSList *to_list;
179
        GSList *newsgroup_list;
180

    
181
        PrefsAccount *account;
182

    
183
        UndoMain *undostruct;
184

    
185
        GtkTextTag *sig_tag;
186

    
187
        /* external editor */
188
        gchar *exteditor_file;
189
        GPid   exteditor_pid;
190
        guint  exteditor_tag;
191

    
192
        guint autosave_tag;
193

    
194
        guint lock_count;
195

    
196
        gboolean window_maximized;
197
};
198

    
199
struct _AttachInfo
200
{
201
        gchar *file;
202
        gchar *content_type;
203
        EncodingType encoding;
204
        gchar *name;
205
        gsize size;
206
};
207

    
208
Compose *compose_new                (PrefsAccount        *account,
209
                                 FolderItem        *item,
210
                                 const gchar        *mailto,
211
                                 GPtrArray        *attach_files);
212

    
213
void compose_reply                (MsgInfo        *msginfo,
214
                                 FolderItem        *item,
215
                                 ComposeMode         mode,
216
                                 const gchar        *body);
217
void compose_forward                (GSList                *mlist,
218
                                 FolderItem        *item,
219
                                 gboolean         as_attach,
220
                                 const gchar        *body);
221
void compose_redirect                (MsgInfo        *msginfo,
222
                                 FolderItem        *item);
223
void compose_reedit                (MsgInfo        *msginfo);
224

    
225
GList *compose_get_compose_list        (void);
226

    
227
void compose_entry_set                (Compose          *compose,
228
                                 const gchar          *text,
229
                                 ComposeEntryType  type);
230
void compose_entry_append        (Compose          *compose,
231
                                 const gchar          *text,
232
                                 ComposeEntryType  type);
233

    
234
void compose_lock                (Compose        *compose);
235
void compose_unlock                (Compose        *compose);
236

    
237
void compose_reflect_prefs_all        (void);
238

    
239
#endif /* __COMPOSE_H__ */