-
-#include <camel/camel-url.h>
-
-#if MODEST_PLATFORM_ID==2 /* maemo */
-#include <libosso.h>
-#endif /* MODEST_PLATFORM==2 */
-
-/* return values */
-#define MODEST_ERR_NONE 0
-#define MODEST_ERR_OPTIONS 1
-#define MODEST_ERR_CONF 2
-#define MODEST_ERR_UI 3
-#define MODEST_ERR_HILDON 4
-#define MODEST_ERR_RUN 5
-#define MODEST_ERR_SEND 6
-
-static gboolean hildon_init (); /* NOP if HILDON is not defined */
-static int start_ui (const gchar* mailto, const gchar *cc,
- const gchar *bcc, const gchar* subject, const gchar *body,
- TnyAccountStore *account_store);
-
-static int send_mail (const gchar* mailto, const gchar *cc, const gchar *bcc,
- const gchar* subject, const gchar *body);
-
+#include <modest-tny-account.h>
+#include <modest-tny-msg.h>
+#include <modest-account-mgr.h>
+#include <modest-account-mgr-helpers.h>
+
+#include <widgets/modest-main-window.h>
+#include <widgets/modest-msg-edit-window.h>
+
+typedef enum {
+ MODEST_ERR_NONE = 0, /* no error */
+ MODEST_ERR_OPTIONS = 1, /* error in the options */
+ MODEST_ERR_CONF = 2, /* error getting confuration db */
+ MODEST_ERR_UI = 3, /* error in the UI */
+ MODEST_ERR_HILDON = 4, /* error with Hildon (maemo-only) */
+ MODEST_ERR_RUN = 5, /* error running */
+ MODEST_ERR_SEND = 6, /* error sending mail */
+ MODEST_ERR_PARAM = 7, /* error in one or more of the parameters */
+ MODEST_ERR_INIT = 8 /* error in initialization */
+} ModestErrorCode;
+
+static gchar* check_account (const gchar *account);
+
+static ModestErrorCode start_ui (const gchar *account,
+ const gchar* mailto, const gchar *cc,
+ const gchar *bcc, const gchar* subject, const gchar *body);
+
+static ModestErrorCode send_mail (const gchar* account,
+ const gchar* mailto, const gchar *cc, const gchar *bcc,
+ const gchar* subject, const gchar *body);