added a directory doc-src that contains informations about implementation
[claws.git] / src / compose.h
1 /*
2  * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
3  * Copyright (C) 1999,2000 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 "addressbook.h"
33 #include "prefs_account.h"
34
35 typedef enum
36 {
37         COMPOSE_MAIL,
38         COMPOSE_NEWS
39 } ComposeMode;
40
41 typedef enum
42 {
43         COMPOSE_TO,
44         COMPOSE_CC,
45         COMPOSE_BCC
46 } ComposeEntryType;
47
48 typedef enum
49 {
50         COMPOSE_REPLY,
51         COMPOSE_REPLY_WITH_QUOTE,
52         COMPOSE_REPLY_WITHOUT_QUOTE,
53         COMPOSE_REPLY_TO_ALL,
54         COMPOSE_REPLY_TO_ALL_WITH_QUOTE,
55         COMPOSE_REPLY_TO_ALL_WITHOUT_QUOTE,
56         COMPOSE_FORWARD,
57         COMPOSE_FORWARD_AS_ATTACH,
58         COMPOSE_NEW,
59         COMPOSE_REEDIT_DRAFT
60 } ComposeReplyMode;
61
62 struct _Compose
63 {
64         GtkWidget *window;
65         GtkWidget *vbox;
66         GtkWidget *menubar;
67
68         GtkWidget *handlebox;
69         GtkWidget *toolbar;
70         GtkWidget *send_btn;
71         GtkWidget *sendl_btn;
72         GtkWidget *draft_btn;
73         GtkWidget *insert_btn;
74         GtkWidget *attach_btn;
75         GtkWidget *sig_btn;
76         GtkWidget *exteditor_btn;
77         GtkWidget *linewrap_btn;
78         GtkWidget *addrbook_btn;
79
80         GtkWidget *vbox2;
81
82         GtkWidget *table_vbox;
83         GtkWidget *table;
84         GtkWidget *to_hbox;
85         GtkWidget *to_entry;
86         GtkWidget *newsgroups_hbox;
87         GtkWidget *newsgroups_entry;
88         GtkWidget *subject_entry;
89         GtkWidget *cc_hbox;
90         GtkWidget *cc_entry;
91         GtkWidget *bcc_hbox;
92         GtkWidget *bcc_entry;
93         GtkWidget *reply_hbox;
94         GtkWidget *reply_entry;
95         GtkWidget *followup_hbox;
96         GtkWidget *followup_entry;
97
98         GtkWidget *paned;
99
100         GtkWidget *attach_scrwin;
101         GtkWidget *attach_clist;
102
103         GtkWidget *edit_vbox;
104         GtkWidget *ruler_hbox;
105         GtkWidget *ruler;
106         GtkWidget *scrolledwin;
107         GtkWidget *text;
108
109         GtkWidget *focused_editable;
110
111         GtkWidget *popupmenu;
112
113         GtkItemFactory *popupfactory;
114
115         ComposeReplyMode mode;
116
117         MsgInfo *targetinfo;
118
119         gchar   *replyto;
120         gchar   *cc;
121         gchar   *bcc;
122         gchar   *newsgroups;
123         gchar   *followup_to;
124
125         gchar   *inreplyto;
126         gchar   *references;
127         gchar   *msgid;
128         gchar   *boundary;
129
130         gboolean use_to;
131         gboolean use_cc;
132         gboolean use_bcc;
133         gboolean use_replyto;
134         gboolean use_followupto;
135         gboolean use_attach;
136
137         /* privacy settings */
138         gboolean use_signing;
139         gboolean use_encryption;
140
141         gboolean modified;
142
143         gboolean return_receipt;
144
145         GSList *to_list;
146         GSList *newsgroup_list;
147
148         PrefsAccount *account;
149         PrefsAccount *orig_account;
150
151         /* external editor */
152         gchar *exteditor_file;
153         pid_t  exteditor_pid;
154         gint   exteditor_readdes;
155         gint   exteditor_tag;
156 };
157
158 struct _AttachInfo
159 {
160         gchar *file;
161         gchar *content_type;
162         EncodingType encoding;
163         gchar *name;
164         off_t size;
165 };
166
167 void compose_new                (PrefsAccount   *account);
168
169 void compose_new_with_recipient (PrefsAccount   *account,
170                                  const gchar    *to);
171
172 void compose_reply              (MsgInfo        *msginfo,
173                                  gboolean        quote,
174                                  gboolean        to_all);
175 void compose_forward            (MsgInfo        *msginfo,
176                                  gboolean        as_attach);
177 void compose_reedit             (MsgInfo        *msginfo);
178
179 GList *compose_get_compose_list (void);
180
181 void compose_entry_append       (Compose          *compose,
182                                  const gchar      *address,
183                                  ComposeEntryType  type);
184
185 #endif /* __COMPOSE_H__ */