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.
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
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/>.
21 #include <camel/camel.h>
23 #include <e-util/e-util.h>
25 #include <em-format/e-mail-formatter-enums.h>
27 /* Standard GObject macros */
28 #define E_TYPE_MAIL_PART \
29 (e_mail_part_get_type ())
30 #define E_MAIL_PART(obj) \
31 (G_TYPE_CHECK_INSTANCE_CAST \
32 ((obj), E_TYPE_MAIL_PART, EMailPart))
33 #define E_MAIL_PART_CLASS(cls) \
34 (G_TYPE_CHECK_CLASS_CAST \
35 ((cls), E_TYPE_MAIL_PART, EMailPartClass))
36 #define E_IS_MAIL_PART(obj) \
37 (G_TYPE_CHECK_INSTANCE_TYPE \
38 ((obj), E_TYPE_MAIL_PART))
39 #define E_IS_MAIL_PART_CLASS(cls) \
40 (G_TYPE_CHECK_CLASS_TYPE \
41 ((cls), E_TYPE_MAIL_PART))
42 #define E_MAIL_PART_GET_CLASS(obj) \
43 (G_TYPE_INSTANCE_GET_CLASS \
44 ((obj), E_TYPE_MAIL_PART, EMailPartClass))
48 struct _EMailPartList
;
50 typedef struct _EMailPart EMailPart
;
51 typedef struct _EMailPartClass EMailPartClass
;
52 typedef struct _EMailPartPrivate EMailPartPrivate
;
54 typedef struct _EMailPartValidityPair EMailPartValidityPair
;
56 struct _EMailPartValidityPair
{
57 EMailPartValidityFlags validity_type
;
58 CamelCipherValidity
*validity
;
63 EMailPartPrivate
*priv
;
65 GQueue validities
; /* element-type: EMailPartValidityPair */
67 /* Whether the part should be rendered or not.
68 * This is used for example to prevent images
69 * related to text/html parts from being
70 * rendered as attachments. */
73 /* Force attachment to be expanded, even without
74 * content-disposition: inline */
75 guint force_inline
: 1;
77 /* Force attachment to be collapsed, even with
78 * content-disposition: inline */
79 guint force_collapse
: 1;
81 /* Does part contain an error message? */
85 struct _EMailPartClass
{
86 GObjectClass parent_class
;
88 void (*bind_dom_element
) (EMailPart
*part
,
91 const gchar
*element_id
);
92 void (*web_view_loaded
) (EMailPart
*part
,
96 GType
e_mail_part_get_type (void) G_GNUC_CONST
;
97 EMailPart
* e_mail_part_new (CamelMimePart
*mime_part
,
99 const gchar
* e_mail_part_get_id (EMailPart
*part
);
100 const gchar
* e_mail_part_get_cid (EMailPart
*part
);
101 void e_mail_part_set_cid (EMailPart
*part
,
103 gboolean
e_mail_part_id_has_prefix (EMailPart
*part
,
104 const gchar
*prefix
);
105 gboolean
e_mail_part_id_has_suffix (EMailPart
*part
,
106 const gchar
*suffix
);
107 gboolean
e_mail_part_id_has_substr (EMailPart
*part
,
108 const gchar
*substr
);
109 CamelMimePart
* e_mail_part_ref_mime_part (EMailPart
*part
);
110 const gchar
* e_mail_part_get_mime_type (EMailPart
*part
);
111 void e_mail_part_set_mime_type (EMailPart
*part
,
112 const gchar
*mime_type
);
113 gboolean e_mail_part_get_converted_to_utf8
115 void e_mail_part_set_converted_to_utf8
117 gboolean converted_to_utf8
);
118 gboolean
e_mail_part_should_show_inline (EMailPart
*part
);
119 struct _EMailPartList
*
120 e_mail_part_ref_part_list (EMailPart
*part
);
121 void e_mail_part_set_part_list (EMailPart
*part
,
122 struct _EMailPartList
*part_list
);
123 gboolean
e_mail_part_get_is_attachment (EMailPart
*part
);
124 void e_mail_part_set_is_attachment (EMailPart
*part
,
125 gboolean is_attachment
);
126 void e_mail_part_bind_dom_element (EMailPart
*part
,
129 const gchar
*element_id
);
130 void e_mail_part_web_view_loaded (EMailPart
*part
,
132 void e_mail_part_update_validity (EMailPart
*part
,
133 CamelCipherValidity
*validity
,
134 EMailPartValidityFlags validity_type
);
135 CamelCipherValidity
*
136 e_mail_part_get_validity (EMailPart
*part
,
137 EMailPartValidityFlags validity_type
);
138 gboolean
e_mail_part_has_validity (EMailPart
*part
);
139 EMailPartValidityFlags
140 e_mail_part_get_validity_flags (EMailPart
*part
);
141 void e_mail_part_verify_validity_sender
143 CamelInternetAddress
*from_address
);
147 #endif /* E_MAIL_PART_H */