X-Git-Url: http://git.maemo.org/git/?p=modest;a=blobdiff_plain;f=src%2Fmodest-tny-send-queue.h;h=51e1fef5d4877bae5a9f8207c08c1ddcdee1ff65;hp=1c3f4b66602386920032b1a03b17fd04d3d31b9c;hb=fd067def87340f018ddaa4a10a81ce2d717906d3;hpb=53ede89ac00d6116a9fda93c78b00d56b036b36c diff --git a/src/modest-tny-send-queue.h b/src/modest-tny-send-queue.h index 1c3f4b6..51e1fef 100644 --- a/src/modest-tny-send-queue.h +++ b/src/modest-tny-send-queue.h @@ -65,6 +65,7 @@ struct _ModestTnySendQueue { struct _ModestTnySendQueueClass { TnyCamelSendQueueClass parent_class; + /* Signals */ void (*status_changed)(ModestTnySendQueue *self, const gchar *msg_id, ModestTnySendQueueStatus status); }; @@ -90,28 +91,6 @@ GType modest_tny_send_queue_get_type (void) G_GNUC_CONST; ModestTnySendQueue* modest_tny_send_queue_new (TnyCamelTransportAccount *account); - -/** - * modest_tny_send_queue_ADD: - * @self: a valid #ModestTnySendQueue instance - * @msg: a valid #TnyMsg instance to send - * - * Add @msg to outbox folder waiting to be sent by - * its account send queue. - */ -void modest_tny_send_queue_add (ModestTnySendQueue *self, TnyMsg *msg, GError **err); - -/** - * 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 @@ -144,6 +123,65 @@ modest_tny_send_queue_get_msg_status (ModestTnySendQueue *self, const gchar *msg gchar * modest_tny_send_queue_get_msg_id (TnyHeader *header); +/** + * modest_tny_all_send_queues_get_msg_status: + * @header: a #TnyHeader + * + * obtain status of message (searching for it in all queues) + * + * Returns: a #ModestTnySendQueueStatus + */ +ModestTnySendQueueStatus +modest_tny_all_send_queues_get_msg_status (TnyHeader *header); + + +/** + * modest_tny_send_queue_to_string: + * @self: a valid #ModestTnySendQueue instance + * + * get a string representation of a send queue (for debugging) + * + * Returns: a newly allocated string, or NULL in case of error + */ +gchar* modest_tny_send_queue_to_string (ModestTnySendQueue *self); + +typedef void (*ModestTnySendQueueWakeupFunc) (ModestTnySendQueue *self, gboolean cancelled, GError *err, gpointer userdata); + +/** + * modest_tny_send_queue_wakeup: + * @self: a valid #ModestTnySendQueue instance + * + * Wakes up all suspended messages in the send queue. This means that + * the send queue will try to send them again. Note that you'd + * probably need a tny_send_queue_flush to force it + */ +void modest_tny_send_queue_wakeup (ModestTnySendQueue *self, + ModestTnySendQueueWakeupFunc callback, + gpointer userdata); + +/** + * modest_tny_send_queue_get_requested_send_receive: + * @self: a #ModestTnySendQueue + * + * gets if the last request to send queue was an interactive send + * receive or not. + * + * Returns: %TRUE if last request was an interactive send receive, + * %FALSE otherwise. + */ +gboolean modest_tny_send_queue_get_requested_send_receive (ModestTnySendQueue *self); + +/** + * modest_tny_send_queue_set_requested_send_receive: + * @self: a #ModestTnySendQueue + * @requested_send_receive: mode. + * + * this should be called on each call to process the queue, to distinguish if the + * action was an interactive send receive. + */ +void modest_tny_send_queue_set_requested_send_receive (ModestTnySendQueue *self, gboolean requested_send_receive); + + G_END_DECLS #endif /* __MODEST_TNY_SEND_QUEUE_H__ */