Statistics
| Revision:

root / src / compose.h @ 128

History | View | Annotate | Download (4.5 kB)

1 1 hiro
/*
2 1 hiro
 * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
3 73 hiro
 * Copyright (C) 1999-2005 Hiroyuki Yamamoto
4 1 hiro
 *
5 1 hiro
 * This program is free software; you can redistribute it and/or modify
6 1 hiro
 * it under the terms of the GNU General Public License as published by
7 1 hiro
 * the Free Software Foundation; either version 2 of the License, or
8 1 hiro
 * (at your option) any later version.
9 1 hiro
 *
10 1 hiro
 * This program is distributed in the hope that it will be useful,
11 1 hiro
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 1 hiro
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 1 hiro
 * GNU General Public License for more details.
14 1 hiro
 *
15 1 hiro
 * You should have received a copy of the GNU General Public License
16 1 hiro
 * along with this program; if not, write to the Free Software
17 1 hiro
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 1 hiro
 */
19 1 hiro
20 1 hiro
#ifndef __COMPOSE_H__
21 1 hiro
#define __COMPOSE_H__
22 1 hiro
23 1 hiro
#include <glib.h>
24 1 hiro
#include <gtk/gtkwidget.h>
25 1 hiro
#include <gtk/gtkitemfactory.h>
26 1 hiro
27 1 hiro
typedef struct _Compose                Compose;
28 1 hiro
typedef struct _AttachInfo        AttachInfo;
29 1 hiro
30 1 hiro
#include "procmsg.h"
31 1 hiro
#include "procmime.h"
32 1 hiro
#include "folder.h"
33 1 hiro
#include "addressbook.h"
34 1 hiro
#include "prefs_account.h"
35 1 hiro
#include "undo.h"
36 1 hiro
37 1 hiro
typedef enum
38 1 hiro
{
39 1 hiro
        COMPOSE_ENTRY_TO,
40 1 hiro
        COMPOSE_ENTRY_CC,
41 1 hiro
        COMPOSE_ENTRY_BCC,
42 1 hiro
        COMPOSE_ENTRY_REPLY_TO,
43 1 hiro
        COMPOSE_ENTRY_SUBJECT,
44 1 hiro
        COMPOSE_ENTRY_NEWSGROUPS,
45 1 hiro
        COMPOSE_ENTRY_FOLLOWUP_TO
46 1 hiro
} ComposeEntryType;
47 1 hiro
48 1 hiro
typedef enum
49 1 hiro
{
50 1 hiro
        COMPOSE_REPLY             = 1,
51 1 hiro
        COMPOSE_REPLY_TO_SENDER   = 2,
52 1 hiro
        COMPOSE_REPLY_TO_ALL      = 3,
53 1 hiro
        COMPOSE_REPLY_TO_LIST     = 4,
54 1 hiro
        COMPOSE_FORWARD           = 5,
55 1 hiro
        COMPOSE_FORWARD_AS_ATTACH = 6,
56 1 hiro
        COMPOSE_NEW               = 7,
57 1 hiro
        COMPOSE_REDIRECT          = 8,
58 1 hiro
        COMPOSE_REEDIT            = 9,
59 1 hiro
60 1 hiro
        COMPOSE_WITH_QUOTE        = 1 << 16,
61 1 hiro
        COMPOSE_WITHOUT_QUOTE     = 2 << 16,
62 1 hiro
63 1 hiro
        COMPOSE_MODE_MASK         = 0xffff,
64 1 hiro
        COMPOSE_QUOTE_MODE_MASK   = 0x30000
65 1 hiro
} ComposeMode;
66 1 hiro
67 1 hiro
#define COMPOSE_MODE(mode)                ((mode) & COMPOSE_MODE_MASK)
68 1 hiro
#define COMPOSE_QUOTE_MODE(mode)        ((mode) & COMPOSE_QUOTE_MODE_MASK)
69 1 hiro
70 1 hiro
struct _Compose
71 1 hiro
{
72 1 hiro
        GtkWidget *window;
73 1 hiro
        GtkWidget *vbox;
74 1 hiro
        GtkWidget *menubar;
75 1 hiro
76 1 hiro
        GtkWidget *handlebox;
77 1 hiro
        GtkWidget *toolbar;
78 1 hiro
        GtkWidget *send_btn;
79 1 hiro
        GtkWidget *sendl_btn;
80 1 hiro
        GtkWidget *draft_btn;
81 1 hiro
        GtkWidget *insert_btn;
82 1 hiro
        GtkWidget *attach_btn;
83 1 hiro
        GtkWidget *sig_btn;
84 1 hiro
        GtkWidget *exteditor_btn;
85 1 hiro
        GtkWidget *linewrap_btn;
86 1 hiro
        GtkWidget *addrbook_btn;
87 1 hiro
88 1 hiro
        GtkWidget *vbox2;
89 1 hiro
90 1 hiro
        GtkWidget *table_vbox;
91 1 hiro
        GtkWidget *table;
92 1 hiro
        GtkWidget *to_hbox;
93 1 hiro
        GtkWidget *to_entry;
94 1 hiro
        GtkWidget *newsgroups_hbox;
95 1 hiro
        GtkWidget *newsgroups_entry;
96 1 hiro
        GtkWidget *subject_entry;
97 1 hiro
        GtkWidget *cc_hbox;
98 1 hiro
        GtkWidget *cc_entry;
99 1 hiro
        GtkWidget *bcc_hbox;
100 1 hiro
        GtkWidget *bcc_entry;
101 1 hiro
        GtkWidget *reply_hbox;
102 1 hiro
        GtkWidget *reply_entry;
103 1 hiro
        GtkWidget *followup_hbox;
104 1 hiro
        GtkWidget *followup_entry;
105 1 hiro
106 1 hiro
        GtkWidget *paned;
107 1 hiro
108 1 hiro
        GtkWidget *attach_scrwin;
109 1 hiro
        GtkWidget *attach_clist;
110 1 hiro
111 1 hiro
        GtkWidget *edit_vbox;
112 1 hiro
        GtkWidget *ruler_hbox;
113 1 hiro
        GtkWidget *ruler;
114 1 hiro
        GtkWidget *scrolledwin;
115 1 hiro
        GtkWidget *text;
116 1 hiro
117 1 hiro
        GtkWidget *focused_editable;
118 1 hiro
119 1 hiro
        GtkWidget *popupmenu;
120 1 hiro
121 1 hiro
        GtkItemFactory *popupfactory;
122 1 hiro
123 1 hiro
        GtkWidget *tmpl_menu;
124 1 hiro
125 1 hiro
        ComposeMode mode;
126 1 hiro
127 1 hiro
        MsgInfo *targetinfo;
128 1 hiro
        MsgInfo *replyinfo;
129 1 hiro
130 1 hiro
        gchar        *replyto;
131 1 hiro
        gchar        *cc;
132 1 hiro
        gchar        *bcc;
133 1 hiro
        gchar        *newsgroups;
134 1 hiro
        gchar        *followup_to;
135 1 hiro
136 1 hiro
        gchar        *ml_post;
137 1 hiro
138 1 hiro
        gchar        *inreplyto;
139 1 hiro
        gchar        *references;
140 1 hiro
        gchar        *msgid;
141 1 hiro
        gchar        *boundary;
142 1 hiro
143 1 hiro
        gboolean autowrap;
144 1 hiro
145 1 hiro
        gboolean use_to;
146 1 hiro
        gboolean use_cc;
147 1 hiro
        gboolean use_bcc;
148 1 hiro
        gboolean use_replyto;
149 1 hiro
        gboolean use_newsgroups;
150 1 hiro
        gboolean use_followupto;
151 1 hiro
        gboolean use_attach;
152 1 hiro
153 1 hiro
        /* privacy settings */
154 1 hiro
        gboolean use_signing;
155 1 hiro
        gboolean use_encryption;
156 1 hiro
157 1 hiro
        gboolean modified;
158 1 hiro
159 1 hiro
        GSList *to_list;
160 1 hiro
        GSList *newsgroup_list;
161 1 hiro
162 1 hiro
        PrefsAccount *account;
163 1 hiro
164 1 hiro
        UndoMain *undostruct;
165 1 hiro
166 1 hiro
        gchar *sig_str;
167 1 hiro
168 1 hiro
        /* external editor */
169 1 hiro
        gchar *exteditor_file;
170 1 hiro
        pid_t  exteditor_pid;
171 1 hiro
        gint   exteditor_readdes;
172 1 hiro
        gint   exteditor_tag;
173 1 hiro
};
174 1 hiro
175 1 hiro
struct _AttachInfo
176 1 hiro
{
177 1 hiro
        gchar *file;
178 1 hiro
        gchar *content_type;
179 1 hiro
        EncodingType encoding;
180 1 hiro
        gchar *name;
181 1 hiro
        off_t size;
182 1 hiro
};
183 1 hiro
184 1 hiro
void compose_new                (PrefsAccount        *account,
185 1 hiro
                                 FolderItem        *item,
186 1 hiro
                                 const gchar        *mailto,
187 1 hiro
                                 GPtrArray        *attach_files);
188 1 hiro
189 1 hiro
void compose_reply                (MsgInfo        *msginfo,
190 1 hiro
                                 FolderItem        *item,
191 1 hiro
                                 ComposeMode         mode,
192 1 hiro
                                 const gchar        *body);
193 1 hiro
void compose_forward                (GSList                *mlist,
194 1 hiro
                                 FolderItem        *item,
195 1 hiro
                                 gboolean         as_attach,
196 1 hiro
                                 const gchar        *body);
197 1 hiro
void compose_redirect                (MsgInfo        *msginfo,
198 1 hiro
                                 FolderItem        *item);
199 1 hiro
void compose_reedit                (MsgInfo        *msginfo);
200 1 hiro
201 1 hiro
GList *compose_get_compose_list        (void);
202 1 hiro
203 1 hiro
void compose_entry_set                (Compose          *compose,
204 1 hiro
                                 const gchar          *text,
205 1 hiro
                                 ComposeEntryType  type);
206 1 hiro
void compose_entry_append        (Compose          *compose,
207 1 hiro
                                 const gchar          *text,
208 1 hiro
                                 ComposeEntryType  type);
209 1 hiro
210 1 hiro
void compose_reflect_prefs_all        (void);
211 1 hiro
212 1 hiro
#endif /* __COMPOSE_H__ */