Statistics
| Revision:

root / src / compose.h @ 1

History | View | Annotate | Download (4.52 KB)

1
/*
2
 * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
3
 * Copyright (C) 1999-2004 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
        gboolean paste_as_quotation;
160

    
161
        GSList *to_list;
162
        GSList *newsgroup_list;
163

    
164
        PrefsAccount *account;
165

    
166
        UndoMain *undostruct;
167

    
168
        gchar *sig_str;
169

    
170
        /* external editor */
171
        gchar *exteditor_file;
172
        pid_t  exteditor_pid;
173
        gint   exteditor_readdes;
174
        gint   exteditor_tag;
175
};
176

    
177
struct _AttachInfo
178
{
179
        gchar *file;
180
        gchar *content_type;
181
        EncodingType encoding;
182
        gchar *name;
183
        off_t size;
184
};
185

    
186
void compose_new                (PrefsAccount        *account,
187
                                 FolderItem        *item,
188
                                 const gchar        *mailto,
189
                                 GPtrArray        *attach_files);
190

    
191
void compose_reply                (MsgInfo        *msginfo,
192
                                 FolderItem        *item,
193
                                 ComposeMode         mode,
194
                                 const gchar        *body);
195
void compose_forward                (GSList                *mlist,
196
                                 FolderItem        *item,
197
                                 gboolean         as_attach,
198
                                 const gchar        *body);
199
void compose_redirect                (MsgInfo        *msginfo,
200
                                 FolderItem        *item);
201
void compose_reedit                (MsgInfo        *msginfo);
202

    
203
GList *compose_get_compose_list        (void);
204

    
205
void compose_entry_set                (Compose          *compose,
206
                                 const gchar          *text,
207
                                 ComposeEntryType  type);
208
void compose_entry_append        (Compose          *compose,
209
                                 const gchar          *text,
210
                                 ComposeEntryType  type);
211

    
212
void compose_reflect_prefs_all        (void);
213

    
214
#endif /* __COMPOSE_H__ */