X-Git-Url: http://git.maemo.org/git/?a=blobdiff_plain;f=src%2Fmodest-tny-send-queue.h;h=8b9af1b771d6803c577cb1a06c1af18b31099b09;hb=f12789961e471f75c7ba2461e7420262c6023376;hp=c16386dd872531a13a37edf766a277f8337ed9c7;hpb=9dad1c303142af16fc5bf973e0a0418970391c7c;p=modest diff --git a/src/modest-tny-send-queue.h b/src/modest-tny-send-queue.h index c16386d..8b9af1b 100644 --- a/src/modest-tny-send-queue.h +++ b/src/modest-tny-send-queue.h @@ -27,17 +27,16 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -#ifndef __MODEST_TNY_SEND_QUEUE_H__ -#define __MODEST_TNY_SEND_QUEUE_H__ - -#include #include #include #include +#include #include #include +#ifndef __MODEST_TNY_SEND_QUEUE_H__ +#define __MODEST_TNY_SEND_QUEUE_H__ + G_BEGIN_DECLS /* convenience macros */ @@ -51,26 +50,85 @@ G_BEGIN_DECLS typedef struct _ModestTnySendQueue ModestTnySendQueue; typedef struct _ModestTnySendQueueClass ModestTnySendQueueClass; +typedef enum { + MODEST_TNY_SEND_QUEUE_WAITING, + MODEST_TNY_SEND_QUEUE_SUSPENDED, + MODEST_TNY_SEND_QUEUE_SENDING, + MODEST_TNY_SEND_QUEUE_FAILED +} ModestTnySendQueueStatus; + struct _ModestTnySendQueue { - GObject parent; + TnyCamelSendQueue parent; }; struct _ModestTnySendQueueClass { - GObjectClass parent_class; - - void (*add_func) (TnySendQueue *self, TnyMsg *msg); - TnyFolder* (*get_sentbox_func) (TnySendQueue *self); - TnyFolder* (*get_outbox_func) (TnySendQueue *self); - void (*cancel_func) (TnySendQueue *self, gboolean remove); + TnyCamelSendQueueClass parent_class; + + void (*status_changed)(ModestTnySendQueue *self, const gchar *msg_id, ModestTnySendQueueStatus status); }; -/* member functions */ +/** + * modest_tny_send_queue_get_type: + * + * get the #GType for #ModestTnySendQueue + * + * Returns: the #GType + */ GType modest_tny_send_queue_get_type (void) G_GNUC_CONST; -/* typical parameter-less _new function */ -/* if this is a kind of GtkWidget, it should probably return at GtkWidget* */ -ModestTnySendQueue* modest_tny_send_queue_new (TnyCamelTransportAccount *trans_account); +/** + * modest_tny_send_queue_new: + * @account: a valid camel transport account + * + * create a new modest #ModestTnySendQueue object. + * + * Returns: a new #ModestTnySendQueue instance, or NULL in case + * of any error + */ +ModestTnySendQueue* modest_tny_send_queue_new (TnyCamelTransportAccount *account); + + + +/** + * modest_tny_send_queue_try_to_send: + * @self: a valid #ModestTnySendQueue instance + * + * Try to send the messages that are in the queue's outbox folder. + * This is not always necessary because the queue tries to send + * messages as soon as a message is added, and as soon as the queue + * is instantiated. + */ +void modest_tny_send_queue_try_to_send (ModestTnySendQueue* self); + +/** + * modest_tny_send_queue_sending_in_progress: + * @self: a valid #ModestTnySendQueue instance + * + * Checks if sending operation is currently in progress on @self send queue. + */ +gboolean modest_tny_send_queue_sending_in_progress (ModestTnySendQueue* self); + +/** + * modest_tny_send_queue_msg_is_being_sent: + * @self: a valid #ModestTnySendQueue instance + * @msg_id: the message id ti check. + * + * Checks if message identifies with @msg_id is currently being sent. + */ +gboolean modest_tny_send_queue_msg_is_being_sent (ModestTnySendQueue* self, const gchar *msg_id); + +/** + * modest_tny_send_queue_get_msg_status: + * @self: a valid #ModestTnySendQueue instance + * @msg_id: The message id to check + * + * Returns the status of the message identified with @msg_id. The status tells + * whether the message is currently being sent, is waiting for being sent or + * sending the message failed. + */ +ModestTnySendQueueStatus +modest_tny_send_queue_get_msg_status (ModestTnySendQueue *self, const gchar *msg_id); G_END_DECLS