1 /*
2  * e-mail-reader-utils.h
3  *
4  * This program is free software; you can redistribute it and/or modify it
5  * under the terms of the GNU Lesser General Public License as published by
6  * the Free Software Foundation.
7  *
8  * This program is distributed in the hope that it will be useful, but
9  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
10  * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
11  * for more details.
12  *
13  * You should have received a copy of the GNU Lesser General Public License
14  * along with this program; if not, see <http://www.gnu.org/licenses/>.
15  *
16  *
17  * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
18  *
19  */
20 
21 /* Miscellaneous utility functions used by EMailReader actions. */
22 
23 #ifndef E_MAIL_READER_UTILS_H
24 #define E_MAIL_READER_UTILS_H
25 
26 #include <mail/e-mail-reader.h>
27 
28 G_BEGIN_DECLS
29 
30 gboolean	e_mail_reader_confirm_delete	(EMailReader *reader);
31 void		e_mail_reader_delete_folder	(EMailReader *reader,
32 						 CamelFolder *folder);
33 void		e_mail_reader_delete_folder_name
34 						(EMailReader *reader,
35 						 CamelStore *store,
36 						 const gchar *folder_name);
37 void		e_mail_reader_expunge_folder	(EMailReader *reader,
38 						 CamelFolder *folder);
39 void		e_mail_reader_expunge_folder_name
40 						(EMailReader *reader,
41 						 CamelStore *store,
42 						 const gchar *folder_name);
43 void		e_mail_reader_empty_junk_folder	(EMailReader *reader,
44 						 CamelFolder *folder);
45 void		e_mail_reader_empty_junk_folder_name
46 						(EMailReader *reader,
47 						 CamelStore *store,
48 						 const gchar *folder_name);
49 void		e_mail_reader_refresh_folder	(EMailReader *reader,
50 						 CamelFolder *folder);
51 void		e_mail_reader_refresh_folder_name
52 						(EMailReader *reader,
53 						 CamelStore *store,
54 						 const gchar *folder_name);
55 void		e_mail_reader_unsubscribe_folder_name
56 						(EMailReader *reader,
57 						 CamelStore *store,
58 						 const gchar *folder_name);
59 guint		e_mail_reader_mark_selected	(EMailReader *reader,
60 						 guint32 mask,
61 						 guint32 set);
62 typedef enum {
63 	E_IGNORE_THREAD_WHOLE_SET,
64 	E_IGNORE_THREAD_WHOLE_UNSET,
65 	E_IGNORE_THREAD_SUBSET_SET,
66 	E_IGNORE_THREAD_SUBSET_UNSET
67 } EIgnoreThreadKind;
68 
69 void		e_mail_reader_mark_selected_ignore_thread
70 						(EMailReader *reader,
71 						 EIgnoreThreadKind kind);
72 guint		e_mail_reader_open_selected	(EMailReader *reader);
73 void		e_mail_reader_print		(EMailReader *reader,
74 						 GtkPrintOperationAction action);
75 void		e_mail_reader_remove_attachments
76 						(EMailReader *reader);
77 void		e_mail_reader_remove_duplicates	(EMailReader *reader);
78 void		e_mail_reader_edit_messages	(EMailReader *reader,
79 						 CamelFolder *folder,
80 						 GPtrArray *uids,
81 						 gboolean replace,
82 						 gboolean keep_signature);
83 void		e_mail_reader_forward_messages	(EMailReader *reader,
84 						 CamelFolder *folder,
85 						 GPtrArray *uids,
86 						 EMailForwardStyle style);
87 void		e_mail_reader_reply_to_message	(EMailReader *reader,
88 						 CamelMimeMessage *message,
89 						 EMailReplyType reply_type);
90 void		e_mail_reader_save_messages	(EMailReader *reader);
91 void		e_mail_reader_select_next_message
92 						(EMailReader *reader,
93 						 gboolean or_else_previous);
94 void		e_mail_reader_select_previous_message
95 						(EMailReader *reader,
96 						 gboolean or_else_next);
97 void		e_mail_reader_create_filter_from_selected
98 						(EMailReader *reader,
99 						 gint filter_type);
100 void		e_mail_reader_create_vfolder_from_selected
101 						(EMailReader *reader,
102 						 gint filter_type);
103 
104 void		e_mail_reader_parse_message	(EMailReader *reader,
105 						 CamelFolder *folder,
106 						 const gchar *message_uid,
107 						 CamelMimeMessage *message,
108 						 GCancellable *cancellable,
109 						 GAsyncReadyCallback callback,
110 						 gpointer user_data);
111 EMailPartList *	e_mail_reader_parse_message_finish
112 						(EMailReader *reader,
113 						 GAsyncResult *result,
114 						 GError **error);
115 gboolean	e_mail_reader_utils_get_mark_seen_setting
116 						(EMailReader *reader,
117 						 gint *out_timeout_interval);
118 void		e_mail_reader_utils_get_selection_or_message
119 						(EMailReader *reader,
120 						 CamelMimeMessage *preloaded_message,
121 						 GCancellable *cancellable,
122 						 GAsyncReadyCallback callback,
123 						 gpointer user_data);
124 CamelMimeMessage *
125 		e_mail_reader_utils_get_selection_or_message_finish
126 						(EMailReader *reader,
127 						 GAsyncResult *result,
128 						 gboolean *out_is_selection,
129 						 CamelFolder **out_folder,
130 						 const gchar **out_message_uid, /* free with camel_pstring_free() */
131 						 EMailPartList **out_part_list,
132 						 EMailPartValidityFlags *out_orig_validity_pgp_sum,
133 						 EMailPartValidityFlags *out_orig_validity_smime_sum,
134 						 GError **error);
135 
136 G_END_DECLS
137 
138 #endif /* E_MAIL_READER_UTILS_H */
139