aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mail/ChangeLog7
-rw-r--r--mail/em-event.c23
-rw-r--r--mail/em-event.h16
3 files changed, 45 insertions, 1 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index 0a0ca074e2..54ef0fc7d3 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,3 +1,8 @@
+2007-01-22 Raghavendran R <raghavguru7@gmail.com>
+
+ * em-event.[c,h]: (em_event_target_new_composer):
+ Creates and returns an event target (composer).
+
2007-01-22 Srinivasa Ragavan <sragavan@novell.com>
** GtkPrint migration patch from Ebby Wiselyn.
@@ -29,7 +34,7 @@
- rest will be taken care by sub_row_expanded()
(sub_folderinfo_free): Once fillin is over, expand the node - iff
node is non-null.
-
+
2006-12-22 Simon Zheng <simon.zheng@sun.com>
* mail/em-account-editor.c: (emae_setup_service):
diff --git a/mail/em-event.c b/mail/em-event.c
index 9ca6d8e940..228fcf78db 100644
--- a/mail/em-event.c
+++ b/mail/em-event.c
@@ -77,6 +77,12 @@ eme_target_free(EEvent *ep, EEventTarget *t)
camel_object_unref(s->message);
g_free(s->uid);
break; }
+ case EM_EVENT_TARGET_COMPOSER : {
+ EMEventTargetComposer *s = (EMEventTargetComposer *)t;
+
+ if (s->composer)
+ g_object_unref (s->composer);
+ break; }
}
((EEventClass *)eme_parent)->target_free(ep, t);
@@ -139,6 +145,17 @@ em_event_target_new_folder (EMEvent *eme, const char *uri, guint32 flags)
return t;
}
+EMEventTargetComposer *
+em_event_target_new_composer (EMEvent *eme, const EMsgComposer *composer, guint32 flags)
+{
+ EMEventTargetComposer *t = e_event_target_new(&eme->popup, EM_EVENT_TARGET_COMPOSER, sizeof(*t));
+
+ t->composer = g_object_ref(composer);
+ t->target.mask = ~flags;
+
+ return t;
+}
+
EMEventTargetMessage *
em_event_target_new_message(EMEvent *eme, CamelFolder *folder, CamelMimeMessage *message, const char *uid, guint32 flags)
{
@@ -167,6 +184,11 @@ static const EEventHookTargetMask emeh_folder_masks[] = {
};
+static const EEventHookTargetMask emeh_composer_masks[] = {
+ { "sendoption", EM_EVENT_COMPOSER_SEND_OPTION },
+ { 0 }
+};
+
static const EEventHookTargetMask emeh_message_masks[] = {
{ "replyall", EM_EVENT_MESSAGE_REPLY_ALL },
{ 0 }
@@ -175,6 +197,7 @@ static const EEventHookTargetMask emeh_message_masks[] = {
static const EEventHookTargetMap emeh_targets[] = {
{ "folder", EM_EVENT_TARGET_FOLDER, emeh_folder_masks },
{ "message", EM_EVENT_TARGET_MESSAGE, emeh_message_masks },
+ { "composer", EM_EVENT_TARGET_COMPOSER, emeh_composer_masks},
{ 0 }
};
diff --git a/mail/em-event.h b/mail/em-event.h
index aa772fb063..59171746f2 100644
--- a/mail/em-event.h
+++ b/mail/em-event.h
@@ -26,6 +26,7 @@
#include <glib-object.h>
#include "e-util/e-event.h"
+#include "composer/e-msg-composer.h"
#ifdef __cplusplus
extern "C" {
@@ -42,6 +43,7 @@ typedef struct _EMEventClass EMEventClass;
enum _em_event_target_t {
EM_EVENT_TARGET_FOLDER,
EM_EVENT_TARGET_MESSAGE,
+ EM_EVENT_TARGET_COMPOSER,
};
/* Flags that describe TARGET_FOLDER */
@@ -54,6 +56,11 @@ enum {
EM_EVENT_MESSAGE_REPLY_ALL = 1<< 0,
};
+/* Flags that describe TARGET_COMPOSER */
+enum {
+ EM_EVENT_COMPOSER_SEND_OPTION = 1<< 0,
+};
+
typedef struct _EMEventTargetFolder EMEventTargetFolder;
struct _EMEventTargetFolder {
@@ -70,6 +77,14 @@ struct _EMEventTargetMessage {
struct _CamelMimeMessage *message;
};
+typedef struct _EMEventTargetComposer EMEventTargetComposer;
+
+struct _EMEventTargetComposer {
+ EEventTarget target;
+
+ EMsgComposer *composer;
+};
+
typedef struct _EEventItem EMEventItem;
/* The object */
@@ -88,6 +103,7 @@ GType em_event_get_type(void);
EMEvent *em_event_peek(void);
EMEventTargetFolder *em_event_target_new_folder(EMEvent *emp, const char *uri, guint32 flags);
+EMEventTargetComposer *em_event_target_new_composer(EMEvent *emp, const EMsgComposer *composer, guint32 flags);
EMEventTargetMessage *em_event_target_new_message(EMEvent *emp, struct _CamelFolder *folder, struct _CamelMimeMessage *message, const char *uid, guint32 flags);
/* ********************************************************************** */