/* Generated by GOB (v2.0.15)   (do not edit directly) */

#include <glib.h>
#include <glib-object.h>


#include <time.h>
#include "mn-mailbox.h"

#ifndef __MN_MESSAGE_H__
#define __MN_MESSAGE_H__

#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */



typedef enum
{
  MN_MESSAGE_NEW	= 1 << 0	/* unseen message */
} MNMessageFlags;

typedef struct _MNMessageAction MNMessageAction;

typedef void (*MNMessageActionResultCallback) (MNMessageAction *action, GError *err, gpointer data);

typedef struct
{
  MNMessageAction		*action;
  MNMessage			*message;
  MNMessageActionResultCallback	callback;
  gpointer			data;
} MNMessageActionRequest;

struct _MNMessageAction
{
  const char	*name;
  const char	*icon;
  const char	*label;
  const char	*error_message;

  gboolean (*can_perform) (MNMessage *message);
  void (*perform) (MNMessage *message, MNMessageActionRequest *request);
  void (*done) (MNMessage *message, GError *err);
};

#define MN_MESSAGE_ACTION_ERROR		(mn_message_action_error_quark())

typedef enum
{
  MN_MESSAGE_ACTION_ERROR_OTHER,
  MN_MESSAGE_ACTION_ERROR_CANCELLED
} MNMessageActionError;


/*
 * Type checking and casting macros
 */
#define MN_TYPE_MESSAGE	(mn_message_get_type())
#define MN_MESSAGE(obj)	G_TYPE_CHECK_INSTANCE_CAST((obj), mn_message_get_type(), MNMessage)
#define MN_MESSAGE_CONST(obj)	G_TYPE_CHECK_INSTANCE_CAST((obj), mn_message_get_type(), MNMessage const)
#define MN_MESSAGE_CLASS(klass)	G_TYPE_CHECK_CLASS_CAST((klass), mn_message_get_type(), MNMessageClass)
#define MN_IS_MESSAGE(obj)	G_TYPE_CHECK_INSTANCE_TYPE((obj), mn_message_get_type ())

#define MN_MESSAGE_GET_CLASS(obj)	G_TYPE_INSTANCE_GET_CLASS((obj), mn_message_get_type(), MNMessageClass)

/*
 * Main object structure
 */
#ifndef __TYPEDEF_MN_MESSAGE__
#define __TYPEDEF_MN_MESSAGE__
typedef struct _MNMessage MNMessage;
#endif
struct _MNMessage {
	GObject __parent__;
	/*< public >*/
	MNMailbox * mailbox;
	time_t sent_time;
	char * id;
	char * mid;
	char * from;
	char * subject;
	char * uri;
	MNMessageFlags flags;
};

/*
 * Class definition
 */
typedef struct _MNMessageClass MNMessageClass;
struct _MNMessageClass {
	GObjectClass __parent__;
	gboolean (* builtin_can_open) (MNMessage * self);
	void (* builtin_open) (MNMessage * self, MNMessageActionRequest * request);
	gboolean (* builtin_can_mark_as_read) (MNMessage * self);
	void (* builtin_mark_as_read) (MNMessage * self, MNMessageActionRequest * request);
	gboolean (* builtin_can_mark_as_spam) (MNMessage * self);
	void (* builtin_mark_as_spam) (MNMessage * self, MNMessageActionRequest * request);
	gboolean (* builtin_can_delete) (MNMessage * self);
	void (* builtin_delete) (MNMessage * self, MNMessageActionRequest * request);
};


/*
 * Public methods
 */
GType	mn_message_get_type	(void) G_GNUC_CONST;
#line 203 "src/mn-message.gob"
MNMessageAction * 	mn_message_get_action	(const char * name);
#line 112 "mn-message.h"
#line 345 "src/mn-message.gob"
gboolean 	mn_message_can_perform_action	(MNMessage * self,
					MNMessageAction * action);
#line 116 "mn-message.h"
#line 352 "src/mn-message.gob"
void 	mn_message_perform_action	(MNMessage * self,
					MNMessageAction * action,
					MNMessageActionResultCallback callback,
					gpointer data);
#line 122 "mn-message.h"
#line 434 "src/mn-message.gob"
GQuark 	mn_message_action_error_quark	(void);
#line 125 "mn-message.h"
#line 511 "src/mn-message.gob"
void 	mn_message_consider_as_read	(MNMessage * self);
#line 128 "mn-message.h"
#line 545 "src/mn-message.gob"
void 	mn_message_consider_as_read_list	(GList * messages);
#line 131 "mn-message.h"
#line 569 "src/mn-message.gob"
MNMessage * 	mn_message_new	(MNMailbox * mailbox,
					time_t sent_time,
					const char * id,
					const char * mid,
					const char * from,
					const char * subject,
					const char * uri,
					MNMessageFlags flags);
#line 141 "mn-message.h"
#line 590 "src/mn-message.gob"
xmlNode * 	mn_message_xml_node_new	(MNMessage * self);
#line 144 "mn-message.h"

/*
 * Argument wrapping macros
 */
#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
#define MN_MESSAGE_PROP_MAILBOX(arg)    	"mailbox", __extension__ ({MNMailbox * z = (arg); z;})
#define MN_MESSAGE_GET_PROP_MAILBOX(arg)	"mailbox", __extension__ ({MNMailbox * *z = (arg); z;})
#define MN_MESSAGE_PROP_SENT_TIME(arg)    	"sent_time", __extension__ ({time_t z = (arg); z;})
#define MN_MESSAGE_GET_PROP_SENT_TIME(arg)	"sent_time", __extension__ ({time_t *z = (arg); z;})
#define MN_MESSAGE_PROP_ID(arg)    	"id", __extension__ ({gchar *z = (arg); z;})
#define MN_MESSAGE_GET_PROP_ID(arg)	"id", __extension__ ({gchar **z = (arg); z;})
#define MN_MESSAGE_PROP_MID(arg)    	"mid", __extension__ ({gchar *z = (arg); z;})
#define MN_MESSAGE_GET_PROP_MID(arg)	"mid", __extension__ ({gchar **z = (arg); z;})
#define MN_MESSAGE_PROP_FROM(arg)    	"from", __extension__ ({gchar *z = (arg); z;})
#define MN_MESSAGE_GET_PROP_FROM(arg)	"from", __extension__ ({gchar **z = (arg); z;})
#define MN_MESSAGE_PROP_SUBJECT(arg)    	"subject", __extension__ ({gchar *z = (arg); z;})
#define MN_MESSAGE_GET_PROP_SUBJECT(arg)	"subject", __extension__ ({gchar **z = (arg); z;})
#define MN_MESSAGE_PROP_URI(arg)    	"uri", __extension__ ({gchar *z = (arg); z;})
#define MN_MESSAGE_GET_PROP_URI(arg)	"uri", __extension__ ({gchar **z = (arg); z;})
#define MN_MESSAGE_GET_PROP_FILENAME(arg)	"filename", __extension__ ({gchar **z = (arg); z;})
#define MN_MESSAGE_PROP_FLAGS(arg)    	"flags", __extension__ ({guint z = (arg); z;})
#define MN_MESSAGE_GET_PROP_FLAGS(arg)	"flags", __extension__ ({guint *z = (arg); z;})
#else /* __GNUC__ && !__STRICT_ANSI__ */
#define MN_MESSAGE_PROP_MAILBOX(arg)    	"mailbox",(MNMailbox * )(arg)
#define MN_MESSAGE_GET_PROP_MAILBOX(arg)	"mailbox",(MNMailbox * *)(arg)
#define MN_MESSAGE_PROP_SENT_TIME(arg)    	"sent_time",(time_t )(arg)
#define MN_MESSAGE_GET_PROP_SENT_TIME(arg)	"sent_time",(time_t *)(arg)
#define MN_MESSAGE_PROP_ID(arg)    	"id",(gchar *)(arg)
#define MN_MESSAGE_GET_PROP_ID(arg)	"id",(gchar **)(arg)
#define MN_MESSAGE_PROP_MID(arg)    	"mid",(gchar *)(arg)
#define MN_MESSAGE_GET_PROP_MID(arg)	"mid",(gchar **)(arg)
#define MN_MESSAGE_PROP_FROM(arg)    	"from",(gchar *)(arg)
#define MN_MESSAGE_GET_PROP_FROM(arg)	"from",(gchar **)(arg)
#define MN_MESSAGE_PROP_SUBJECT(arg)    	"subject",(gchar *)(arg)
#define MN_MESSAGE_GET_PROP_SUBJECT(arg)	"subject",(gchar **)(arg)
#define MN_MESSAGE_PROP_URI(arg)    	"uri",(gchar *)(arg)
#define MN_MESSAGE_GET_PROP_URI(arg)	"uri",(gchar **)(arg)
#define MN_MESSAGE_GET_PROP_FILENAME(arg)	"filename",(gchar **)(arg)
#define MN_MESSAGE_PROP_FLAGS(arg)    	"flags",(guint )(arg)
#define MN_MESSAGE_GET_PROP_FLAGS(arg)	"flags",(guint *)(arg)
#endif /* __GNUC__ && !__STRICT_ANSI__ */


#ifdef __cplusplus
}
#endif /* __cplusplus */

#endif
