* Fixes NB#91689. fixes a wrong check for ASCII
[modest] / src / modest-formatter.h
index a74b54b..15c00ed 100644 (file)
@@ -58,7 +58,7 @@ struct _ModestFormatterClass
 
 GType modest_formatter_get_type (void);
 
 
 GType modest_formatter_get_type (void);
 
-ModestFormatter* modest_formatter_new (const gchar *content_type);
+ModestFormatter* modest_formatter_new (const gchar *content_type, const gchar *signature);
 
 /**
  * modest_formatter_cite:
 
 /**
  * modest_formatter_cite:
@@ -74,13 +74,13 @@ ModestFormatter* modest_formatter_new (const gchar *content_type);
  * Original message
  * ----------------
  * Date: 1970/01/01
  * Original message
  * ----------------
  * Date: 1970/01/01
- * From: somemail@modest.org
+ * From: somemailATmodest.org
  * Body: "This is the body of the text"
  * </para><para>
  * Cited message
  * -------------
  * Body:
  * Body: "This is the body of the text"
  * </para><para>
  * Cited message
  * -------------
  * Body:
- * On 1970/01/01 somemail@modest.org wrote:
+ * On 1970/01/01 somemailATmodest.org wrote:
  * This is the body of the text
  * </para></programlisting>
  *
  * This is the body of the text
  * </para></programlisting>
  *
@@ -94,6 +94,7 @@ TnyMsg * modest_formatter_cite   (ModestFormatter *self, TnyMimePart *part, TnyH
  * @self: a #ModestFormatter
  * @part: a non-NULL #TnyMimePart with the body of the original message
  * @header: a non-NULL #TnyHeader of the original message
  * @self: a #ModestFormatter
  * @part: a non-NULL #TnyMimePart with the body of the original message
  * @header: a non-NULL #TnyHeader of the original message
+ * @attachments: a #GList of attachments in original message
  * 
  * Creates a new message with a text body made from the body of the
  * original message quoted. This function is locale-sensitive.
  * 
  * Creates a new message with a text body made from the body of the
  * original message quoted. This function is locale-sensitive.
@@ -103,19 +104,20 @@ TnyMsg * modest_formatter_cite   (ModestFormatter *self, TnyMimePart *part, TnyH
  * Original message
  * ----------------
  * Date: 1970/01/01
  * Original message
  * ----------------
  * Date: 1970/01/01
- * From: somemail@modest.org
+ * From: somemailATmodest.org
  * Body: "This is the body of the text"
  * </para><para>
  * Quoted message
  * -------------
  * Body:
  * Body: "This is the body of the text"
  * </para><para>
  * Quoted message
  * -------------
  * Body:
- * On 1970/01/01 somemail@modest.org wrote:
+ * ------ Original message -----
  * > This is the body of the text
  * > This is the body of the text
+ * > Attachment: file1.txt
  * </para></programlisting>
  *
  * Returns: a newly formatted #TnyMsg or NULL in case of error
  **/
  * </para></programlisting>
  *
  * Returns: a newly formatted #TnyMsg or NULL in case of error
  **/
-TnyMsg * modest_formatter_quote  (ModestFormatter *self, TnyMimePart *part, TnyHeader *header);
+TnyMsg * modest_formatter_quote  (ModestFormatter *self, TnyMimePart *part, TnyHeader *header, GList *attachments);
 
 
 /**
 
 
 /**
@@ -123,6 +125,7 @@ TnyMsg * modest_formatter_quote  (ModestFormatter *self, TnyMimePart *part, TnyH
  * @self: a #ModestFormatter
  * @part: a non-NULL #TnyMimePart with the body of the original message
  * @header: a non-NULL #TnyHeader of the original message
  * @self: a #ModestFormatter
  * @part: a non-NULL #TnyMimePart with the body of the original message
  * @header: a non-NULL #TnyHeader of the original message
+ * @attachments: a #GList of attachments
  * 
  * Creates a new message with a text body made from the body of the
  * original message inlined ready to be forwarded. This function is
  * 
  * Creates a new message with a text body made from the body of the
  * original message inlined ready to be forwarded. This function is
@@ -133,8 +136,8 @@ TnyMsg * modest_formatter_quote  (ModestFormatter *self, TnyMimePart *part, TnyH
  * Original message
  * ----------------
  * Date: 1970/01/01
  * Original message
  * ----------------
  * Date: 1970/01/01
- * From: somemail@modest.org
- * To: mymail@modest.org
+ * From: somemailATmodest.org
+ * To: mymailATmodest.org
  * Subject: Mail subject
  * Body: "This is the body of the text"
  * </para><para>
  * Subject: Mail subject
  * Body: "This is the body of the text"
  * </para><para>
@@ -142,17 +145,17 @@ TnyMsg * modest_formatter_quote  (ModestFormatter *self, TnyMimePart *part, TnyH
  * -------------
  * Body:
  * -----Forwarded Message-----
  * -------------
  * Body:
  * -----Forwarded Message-----
- * From: somemail@modest.org
+ * From: somemailATmodest.org
  * Sent: 1970/01/01
  * Sent: 1970/01/01
- * To: mymail@modest.org
+ * To: mymailATmodest.org
  * Subject: Fw: Mail subject
  * Subject: Fw: Mail subject
- * On 1970/01/01 somemail@modest.org wrote:
+ * On 1970/01/01 somemailATmodest.org wrote:
  * This is the body of the text
  * </para></programlisting>
  *
  * Returns: a newly formatted #TnyMsg or NULL in case of error
  **/
  * This is the body of the text
  * </para></programlisting>
  *
  * Returns: a newly formatted #TnyMsg or NULL in case of error
  **/
-TnyMsg * modest_formatter_inline (ModestFormatter *self, TnyMimePart *part, TnyHeader *header);
+TnyMsg * modest_formatter_inline (ModestFormatter *self, TnyMimePart *part, TnyHeader *header, GList *attachments);
 
 /**
  * modest_formatter_attach:
 
 /**
  * modest_formatter_attach:
@@ -164,8 +167,42 @@ TnyMsg * modest_formatter_inline (ModestFormatter *self, TnyMimePart *part, TnyH
  *
  * Returns: a newly formatted #TnyMsg or NULL in case of error
  **/
  *
  * Returns: a newly formatted #TnyMsg or NULL in case of error
  **/
-TnyMsg * modest_formatter_attach (ModestFormatter *self, TnyMimePart *part, TnyHeader *header);
+TnyMsg * modest_formatter_attach (ModestFormatter *self, TnyMsg *msg, TnyHeader *header);
 
 
+/**
+ * modest_formatter_create_message:
+ * @self: a #ModestFormatter
+ * @single_body: a #gboolean
+ * @has_attachments: a #gboolean
+ * @has_images: a #gboolean
+ *
+ * Creates an empty #TnyMsg with the expected parts for Modest
+ * formatters and body embedders.
+ *
+ * If @has_attachments is %TRUE, the mail will be formatted as
+ * "multipart/mixed", and attachments will be stored as parts
+ * of it. The body will be just another multipart. If %FALSE,
+ * the bodies will be stored directly as the message.
+ *
+ * If @single_body is %TRUE, the body will be stored as a
+ * "multipart/alternative", and the parts will be the different
+ * alternatives. If %FALSE, this body will be stored directly.
+ * 
+ * If @has_images is %TRUE, the body will be embedded in a 
+ * multipart/related, that will also host attached images.
+ */
+TnyMsg * modest_formatter_create_message (ModestFormatter *self, gboolean single_body, 
+                                         gboolean has_attachments, gboolean has_images);
+
+/**
+ * modest_formatter_create_body_part:
+ * @self: a #ModestFormatter
+ *
+ * Obtains a new formatted body part for @msg, or
+ * @msg itself if the body is intended to be stored directly
+ * in it.
+ */ 
+TnyMimePart * modest_formatter_create_body_part (ModestFormatter *self, TnyMsg *msg);
 
 G_END_DECLS
 
 
 G_END_DECLS