Statistics
| Revision:

root / src / compose.h @ 128

History | View | Annotate | Download (4.5 kB)

1
/*
2
 * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
3
 * Copyright (C) 1999-2005 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
27
typedef struct _Compose                Compose;
28
typedef struct _AttachInfo        AttachInfo;
29
30
#include "procmsg.h"
31
#include "procmime.h"
32
#include "folder.h"
33
#include "addressbook.h"
34
#include "prefs_account.h"
35
#include "undo.h"
36
37
typedef enum
38
{
39
        COMPOSE_ENTRY_TO,
40
        COMPOSE_ENTRY_CC,
41
        COMPOSE_ENTRY_BCC,
42
        COMPOSE_ENTRY_REPLY_TO,
43
        COMPOSE_ENTRY_SUBJECT,
44
        COMPOSE_ENTRY_NEWSGROUPS,
45
        COMPOSE_ENTRY_FOLLOWUP_TO
46
} ComposeEntryType;
47
48
typedef enum
49
{
50
        COMPOSE_REPLY             = 1,
51
        COMPOSE_REPLY_TO_SENDER   = 2,
52
        COMPOSE_REPLY_TO_ALL      = 3,
53
        COMPOSE_REPLY_TO_LIST     = 4,
54
        COMPOSE_FORWARD           = 5,
55
        COMPOSE_FORWARD_AS_ATTACH = 6,
56
        COMPOSE_NEW               = 7,
57
        COMPOSE_REDIRECT          = 8,
58
        COMPOSE_REEDIT            = 9,
59
60
        COMPOSE_WITH_QUOTE        = 1 << 16,
61
        COMPOSE_WITHOUT_QUOTE     = 2 << 16,
62
63
        COMPOSE_MODE_MASK         = 0xffff,
64
        COMPOSE_QUOTE_MODE_MASK   = 0x30000
65
} ComposeMode;
66
67
#define COMPOSE_MODE(mode)                ((mode) & COMPOSE_MODE_MASK)
68
#define COMPOSE_QUOTE_MODE(mode)        ((mode) & COMPOSE_QUOTE_MODE_MASK)
69
70
struct _Compose
71
{
72
        GtkWidget *window;
73
        GtkWidget *vbox;
74
        GtkWidget *menubar;
75
76
        GtkWidget *handlebox;
77
        GtkWidget *toolbar;
78
        GtkWidget *send_btn;
79
        GtkWidget *sendl_btn;
80
        GtkWidget *draft_btn;
81
        GtkWidget *insert_btn;
82
        GtkWidget *attach_btn;
83
        GtkWidget *sig_btn;
84
        GtkWidget *exteditor_btn;
85
        GtkWidget *linewrap_btn;
86
        GtkWidget *addrbook_btn;
87
88
        GtkWidget *vbox2;
89
90
        GtkWidget *table_vbox;
91
        GtkWidget *table;
92
        GtkWidget *to_hbox;
93
        GtkWidget *to_entry;
94
        GtkWidget *newsgroups_hbox;
95
        GtkWidget *newsgroups_entry;
96
        GtkWidget *subject_entry;
97
        GtkWidget *cc_hbox;
98
        GtkWidget *cc_entry;
99
        GtkWidget *bcc_hbox;
100
        GtkWidget *bcc_entry;
101
        GtkWidget *reply_hbox;
102
        GtkWidget *reply_entry;
103
        GtkWidget *followup_hbox;
104
        GtkWidget *followup_entry;
105
106
        GtkWidget *paned;
107
108
        GtkWidget *attach_scrwin;
109
        GtkWidget *attach_clist;
110
111
        GtkWidget *edit_vbox;
112
        GtkWidget *ruler_hbox;
113
        GtkWidget *ruler;
114
        GtkWidget *scrolledwin;
115
        GtkWidget *text;
116
117
        GtkWidget *focused_editable;
118
119
        GtkWidget *popupmenu;
120
121
        GtkItemFactory *popupfactory;
122
123
        GtkWidget *tmpl_menu;
124
125
        ComposeMode mode;
126
127
        MsgInfo *targetinfo;
128
        MsgInfo *replyinfo;
129
130
        gchar        *replyto;
131
        gchar        *cc;
132
        gchar        *bcc;
133
        gchar        *newsgroups;
134
        gchar        *followup_to;
135
136
        gchar        *ml_post;
137
138
        gchar        *inreplyto;
139
        gchar        *references;
140
        gchar        *msgid;
141
        gchar        *boundary;
142
143
        gboolean autowrap;
144
145
        gboolean use_to;
146
        gboolean use_cc;
147
        gboolean use_bcc;
148
        gboolean use_replyto;
149
        gboolean use_newsgroups;
150
        gboolean use_followupto;
151
        gboolean use_attach;
152
153
        /* privacy settings */
154
        gboolean use_signing;
155
        gboolean use_encryption;
156
157
        gboolean modified;
158
159
        GSList *to_list;
160
        GSList *newsgroup_list;
161
162
        PrefsAccount *account;
163
164
        UndoMain *undostruct;
165
166
        gchar *sig_str;
167
168
        /* external editor */
169
        gchar *exteditor_file;
170
        pid_t  exteditor_pid;
171
        gint   exteditor_readdes;
172
        gint   exteditor_tag;
173
};
174
175
struct _AttachInfo
176
{
177
        gchar *file;
178
        gchar *content_type;
179
        EncodingType encoding;
180
        gchar *name;
181
        off_t size;
182
};
183
184
void compose_new                (PrefsAccount        *account,
185
                                 FolderItem        *item,
186
                                 const gchar        *mailto,
187
                                 GPtrArray        *attach_files);
188
189
void compose_reply                (MsgInfo        *msginfo,
190
                                 FolderItem        *item,
191
                                 ComposeMode         mode,
192
                                 const gchar        *body);
193
void compose_forward                (GSList                *mlist,
194
                                 FolderItem        *item,
195
                                 gboolean         as_attach,
196
                                 const gchar        *body);
197
void compose_redirect                (MsgInfo        *msginfo,
198
                                 FolderItem        *item);
199
void compose_reedit                (MsgInfo        *msginfo);
200
201
GList *compose_get_compose_list        (void);
202
203
void compose_entry_set                (Compose          *compose,
204
                                 const gchar          *text,
205
                                 ComposeEntryType  type);
206
void compose_entry_append        (Compose          *compose,
207
                                 const gchar          *text,
208
                                 ComposeEntryType  type);
209
210
void compose_reflect_prefs_all        (void);
211
212
#endif /* __COMPOSE_H__ */