diff options
-rw-r--r-- | mail/ChangeLog | 7 | ||||
-rw-r--r-- | mail/em-event.c | 17 | ||||
-rw-r--r-- | mail/em-event.h | 15 | ||||
-rw-r--r-- | mail/em-folder-browser.c | 15 |
4 files changed, 54 insertions, 0 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog index c65af1896a..c2f0e4689f 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,10 @@ +2009-02-01 Johnny Jacob <jjohnny@novell.com> + + * em-event.h (struct _EMEventTargetFolderBrowser): Added. + * em-event.c (em_event_target_new_folder_browser): Added. + (EEventHookTargetMask emeh_folder_browser_masks): Added. + * em-folder-browser.c (emfb_init): New e-plugin Hook point. + 2009-01-30 Srinivasa Ragavan <sragavan@novell.com> * message-list.c: (regen_list_exec): Fix compiler warnings diff --git a/mail/em-event.c b/mail/em-event.c index 0c5a61b454..fe7f5bd1fd 100644 --- a/mail/em-event.c +++ b/mail/em-event.c @@ -32,6 +32,7 @@ #include "em-event.h" #include "composer/e-msg-composer.h" #include "libedataserver/e-msgport.h" +#include "em-folder-browser.h" #include <camel/camel-store.h> #include <camel/camel-folder.h> @@ -147,6 +148,16 @@ em_event_target_new_folder (EMEvent *eme, const char *uri, unsigned int new) return t; } +EMEventTargetFolderBrowser * +em_event_target_new_folder_browser (EMEvent *eme, EMFolderBrowser *emfb) +{ + EMEventTargetFolderBrowser *t = e_event_target_new(&eme->popup, EM_EVENT_TARGET_FOLDER_BROWSER, sizeof(*t)); + + t->emfb = emfb; + + return t; +} + EMEventTargetComposer * em_event_target_new_composer (EMEvent *eme, const EMsgComposer *composer, guint32 flags) { @@ -210,6 +221,10 @@ static const EEventHookTargetMask emeh_folder_masks[] = { { NULL } }; +static const EEventHookTargetMask emeh_folder_browser_masks[] = { + { "folderbrowser", EM_EVENT_FOLDER_BROWSER }, + { NULL } +}; static const EEventHookTargetMask emeh_composer_masks[] = { { "sendoption", EM_EVENT_COMPOSER_SEND_OPTION }, @@ -230,8 +245,10 @@ static const EEventHookTargetMask emeh_custom_icon_masks[] = { { "customicon", EM_EVENT_CUSTOM_ICON }, { NULL } }; + static const EEventHookTargetMap emeh_targets[] = { { "folder", EM_EVENT_TARGET_FOLDER, emeh_folder_masks }, + { "folderbrowser", EM_EVENT_TARGET_FOLDER_BROWSER, emeh_folder_browser_masks }, { "message", EM_EVENT_TARGET_MESSAGE, emeh_message_masks }, { "composer", EM_EVENT_TARGET_COMPOSER, emeh_composer_masks}, { "sendreceive", EM_EVENT_TARGET_SEND_RECEIVE, emeh_send_receive_masks}, diff --git a/mail/em-event.h b/mail/em-event.h index 3afc0146bb..10da5a669d 100644 --- a/mail/em-event.h +++ b/mail/em-event.h @@ -44,12 +44,18 @@ typedef struct _EMEventClass EMEventClass; /* Current target description */ enum _em_event_target_t { EM_EVENT_TARGET_FOLDER, + EM_EVENT_TARGET_FOLDER_BROWSER, EM_EVENT_TARGET_MESSAGE, EM_EVENT_TARGET_COMPOSER, EM_EVENT_TARGET_SEND_RECEIVE, EM_EVENT_TARGET_CUSTOM_ICON, }; +/* Flags for FOLDER BROWSER Events*/ +enum { + EM_EVENT_FOLDER_BROWSER = 1<< 0, +}; + /* Flags that describe TARGET_FOLDER */ enum { EM_EVENT_FOLDER_NEWMAIL = 1<< 0, @@ -102,6 +108,15 @@ struct _EMEventTargetComposer { struct _EMsgComposer *composer; }; +typedef struct _EMEventTargetFolderBrowser EMEventTargetFolderBrowser; + +struct _EMEventTargetFolderBrowser { + EEventTarget target; + + struct _EMFolderBrowser *emfb; +}; + + typedef struct _EMEventTargetSendReceive EMEventTargetSendReceive; struct _EMEventTargetSendReceive { diff --git a/mail/em-folder-browser.c b/mail/em-folder-browser.c index b7c53268cc..b0b507b1a3 100644 --- a/mail/em-folder-browser.c +++ b/mail/em-folder-browser.c @@ -88,6 +88,7 @@ #include "em-folder-utils.h" #include "em-subscribe-editor.h" #include "em-menu.h" +#include "em-event.h" #include "message-list.h" #include "mail-component.h" @@ -486,6 +487,9 @@ emfb_init(GObject *o) RuleContext *search_context = mail_component_peek_search_context (mail_component_peek ()); struct _EMFolderBrowserPrivate *p; + EMEvent *eme; + EMEventTargetFolderBrowser *target; + p = emfb->priv = g_malloc0(sizeof(struct _EMFolderBrowserPrivate)); emfb->view.preview_active = TRUE; @@ -566,6 +570,17 @@ emfb_init(GObject *o) gtk_paned_pack2 (GTK_PANED (emfb->vpane), p->preview, TRUE, FALSE); gtk_widget_show(p->preview); + /** @HookPoint-EMFolderBrower: Folder Browser + * @Id: emfb.created + * @Class: org.gnome.evolution.mail.events:1.0 + * @Target: EMFolderBrowser + */ + + eme = em_event_peek(); + target = em_event_target_new_folder_browser (eme, emfb); + + e_event_emit((EEvent *)eme, "emfb.created", (EEventTarget *)target); + g_signal_connect (((EMFolderView *) emfb)->list->tree, "key_press", G_CALLBACK(emfb_list_key_press), emfb); g_signal_connect (((EMFolderView *) emfb)->list, "message_selected", G_CALLBACK (emfb_list_message_selected), emfb); |