X-Git-Url: http://git.maemo.org/git/?p=modest;a=blobdiff_plain;f=src%2Fmodest-mail-operation.h;h=ea7519ef06c655837194b6007f8896a90f838d78;hp=3e483dd339fc88d42c8331b181b14db9d555f2cf;hb=4c17eac51757809148b84e229bede6323aac270a;hpb=4a2c0a363e35c5d1c673aa34ea1fddb28ddde1e5 diff --git a/src/modest-mail-operation.h b/src/modest-mail-operation.h index 3e483dd..ea7519e 100644 --- a/src/modest-mail-operation.h +++ b/src/modest-mail-operation.h @@ -30,9 +30,8 @@ #ifndef __MODEST_MAIL_OPERATION_H__ #define __MODEST_MAIL_OPERATION_H__ -#include #include -#include +#include "modest-tny-attachment.h" /* other include files */ G_BEGIN_DECLS @@ -48,6 +47,35 @@ G_BEGIN_DECLS typedef struct _ModestMailOperation ModestMailOperation; typedef struct _ModestMailOperationClass ModestMailOperationClass; +typedef enum _ModestMailOperationForwardType ModestMailOperationForwardType; +typedef enum _ModestMailOperationReplyType ModestMailOperationReplyType; +typedef enum _ModestMailOperationReplyMode ModestMailOperationReplyMode; +typedef enum _ModestMailOperationStatus ModestMailOperationStatus; + +enum _ModestMailOperationForwardType { + MODEST_MAIL_OPERATION_FORWARD_TYPE_INLINE, + MODEST_MAIL_OPERATION_FORWARD_TYPE_ATTACHMENT +}; + +enum _ModestMailOperationReplyType { + MODEST_MAIL_OPERATION_REPLY_TYPE_CITE, + MODEST_MAIL_OPERATION_REPLY_TYPE_QUOTE +}; + +enum _ModestMailOperationReplyMode { + MODEST_MAIL_OPERATION_REPLY_MODE_SENDER, + MODEST_MAIL_OPERATION_REPLY_MODE_LIST, + MODEST_MAIL_OPERATION_REPLY_MODE_ALL +}; + +enum _ModestMailOperationStatus { + MODEST_MAIL_OPERATION_STATUS_INVALID, + MODEST_MAIL_OPERATION_STATUS_SUCCESS, + MODEST_MAIL_OPERATION_STATUS_FAILED, + MODEST_MAIL_OPERATION_STATUS_IN_PROGRESS, + MODEST_MAIL_OPERATION_STATUS_CANCELLED +}; + struct _ModestMailOperation { GObject parent; /* insert public members, if any */ @@ -63,17 +91,36 @@ struct _ModestMailOperationClass { GType modest_mail_operation_get_type (void) G_GNUC_CONST; /* typical parameter-less _new function */ -ModestMailOperation* modest_mail_operation_new (void); +ModestMailOperation* modest_mail_operation_new (TnyAccount *account); /* fill in other public functions, eg.: */ -ModestMailOperation* modest_mail_operation_send_mail (TnyTransportAccount *transport_account, - const gchar *from, - const gchar *to, - const gchar *cc, - const gchar *bcc, - const gchar *subject, - const gchar *body, - const GList *attachments_list); +void modest_mail_operation_send_mail (ModestMailOperation *mail_operation, + TnyMsg* msg); + +void modest_mail_operation_send_new_mail (ModestMailOperation *mail_operation, + const gchar *from, + const gchar *to, + const gchar *cc, + const gchar *bcc, + const gchar *subject, + const gchar *body, + const GList *attachments_list); + +TnyMsg* modest_mail_operation_create_forward_mail (TnyMsg *msg, + ModestMailOperationForwardType forward_type); + +TnyMsg* modest_mail_operation_create_reply_mail (TnyMsg *msg, + ModestMailOperationReplyType reply_type, + ModestMailOperationReplyMode reply_mode); + +void modest_mail_operation_update_account (ModestMailOperation *mail_operation); + +/* Functions to control mail operations */ +ModestMailOperationStatus modest_mail_operation_get_status (ModestMailOperation *mail_operation); + +const GError* modest_mail_operation_get_error (ModestMailOperation *mail_operation); + +void modest_mail_operation_cancel (ModestMailOperation *mail_operation); G_END_DECLS