* check for a valid foldername
[modest] / src / modest-tny-send-queue.h
index 148797d..5688ebe 100644 (file)
@@ -50,12 +50,22 @@ G_BEGIN_DECLS
 typedef struct _ModestTnySendQueue      ModestTnySendQueue;
 typedef struct _ModestTnySendQueueClass ModestTnySendQueueClass;
 
+typedef enum {
+       MODEST_TNY_SEND_QUEUE_UNKNONW,
+       MODEST_TNY_SEND_QUEUE_WAITING,
+       MODEST_TNY_SEND_QUEUE_SUSPENDED,
+       MODEST_TNY_SEND_QUEUE_SENDING,
+       MODEST_TNY_SEND_QUEUE_FAILED
+} ModestTnySendQueueStatus;
+
 struct _ModestTnySendQueue {
        TnyCamelSendQueue  parent;
 };
 
 struct _ModestTnySendQueueClass {
        TnyCamelSendQueueClass parent_class;
+
+       void (*status_changed)(ModestTnySendQueue *self, const gchar *msg_id, ModestTnySendQueueStatus status);
 };
 
 /**
@@ -82,14 +92,47 @@ ModestTnySendQueue*    modest_tny_send_queue_new        (TnyCamelTransportAccoun
 
 
 /**
- * modest_tny_send_queue_flush:
+ * modest_tny_send_queue_try_to_send:
  * @self: a valid #ModestTnySendQueue instance
  * 
- * (try to) send the messages in the outbox folder 
- * 
+ * 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.
  */
-void modest_tny_send_queue_flush (ModestTnySendQueue* self);
+ModestTnySendQueueStatus
+modest_tny_send_queue_get_msg_status (ModestTnySendQueue *self, const gchar *msg_id);
 
+gchar *
+modest_tny_send_queue_get_msg_id (TnyHeader *header);
 
 G_END_DECLS