#include <config.h>
#include <modest-runtime.h>
+#include <modest-platform.h>
+
#include <tny-camel-header.h>
#include <tny-camel-mime-part.h>
#include <tny-camel-msg.h>
-/* MODES_PLATFORM_ID: 1 ==> gtk, 2==> maemo */
-#if MODEST_PLATFORM_ID==1
-#include <tny-gnome-device.h>
-#elif MODEST_PLATFORM_ID==2
-#include <tny-maemo-device.h>
-#endif
-
#include "modest-tny-platform-factory.h"
#include "modest-tny-account-store.h"
+#ifdef MODEST_USE_MOZEMBED
+#include <widgets/modest-mozembed-msg-view.h>
+#else
+#include <widgets/modest-gtkhtml-msg-view.h>
+#endif
/* 'private'/'protected' functions */
static void modest_tny_platform_factory_class_init (ModestTnyPlatformFactoryClass *klass);
static TnyMsgView* modest_tny_platform_factory_new_msg_view (TnyPlatformFactory *self);
static TnyMsg* modest_tny_platform_factory_new_msg (TnyPlatformFactory *self);
static TnyMimePart* modest_tny_platform_factory_new_mime_part (TnyPlatformFactory *self);
-static TnyHeader* modest_tny_platform_factory_new_header (TnyPlatformFactory *self);
-
/* list my signals */
enum {
klass->new_msg_view_func = modest_tny_platform_factory_new_msg_view;
klass->new_msg_func = modest_tny_platform_factory_new_msg;
klass->new_mime_part_func = modest_tny_platform_factory_new_mime_part;
- klass->new_header_func = modest_tny_platform_factory_new_header;
-
return;
}
static TnyDevice *
modest_tny_platform_factory_new_device (TnyPlatformFactory *self)
{
-/* MODES_PLATFORM_ID: 1 ==> gtk, 2==> maemo */
-#if MODEST_PLATFORM_ID==1
- return TNY_DEVICE (tny_gnome_device_new ());
-#elif MODEST_PLATFORM_ID==2
- return TNY_DEVICE (tny_maemo_device_new ());
-#else
- g_return_val_if_reached (NULL);
-#endif /* MODEST_PLATFORM */
+ return modest_platform_get_new_device ();
}
static TnyMsgView*
modest_tny_platform_factory_new_msg_view (TnyPlatformFactory *self)
{
- /* TODO */
- return NULL;
+ /* Here we'll select one of the implementations available */
+#ifdef MODEST_USE_MOZEMBED
+ return g_object_new (MODEST_TYPE_MOZEMBED_MSG_VIEW, NULL);
+#else
+ return g_object_new (MODEST_TYPE_GTKHTML_MSG_VIEW, NULL);
+#endif
}
static TnyMsg*
}
-static TnyHeader*
-modest_tny_platform_factory_new_header (TnyPlatformFactory *self)
-{
- return tny_camel_header_new ();
-}