From c6d0596a556e392d56c2edf525798464ae3640fa Mon Sep 17 00:00:00 2001 From: hiro Date: Mon, 31 May 2010 09:12:47 +0000 Subject: added some functions for FolderView. git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@2554 ee746299-78ed-0310-b773-934348b2243d --- src/main.c | 11 +++++++++++ src/plugin.c | 46 ++++++++++++++++++++++++++++++++++++++++++++++ src/plugin.h | 10 ++++++++++ 3 files changed, 67 insertions(+) (limited to 'src') diff --git a/src/main.c b/src/main.c index 7248747f..086a7bc2 100644 --- a/src/main.c +++ b/src/main.c @@ -1130,6 +1130,17 @@ static void plugin_init(void) syl_plugin_add_symbol("folderview", mainwin->folderview); syl_plugin_add_symbol("folderview_get_selected_item", folderview_get_selected_item); + syl_plugin_add_symbol("folderview_check_new", folderview_check_new); + syl_plugin_add_symbol("folderview_check_new_item", + folderview_check_new_item); + syl_plugin_add_symbol("folderview_check_new_all", + folderview_check_new_all); + syl_plugin_add_symbol("folderview_update_item", folderview_update_item); + syl_plugin_add_symbol("folderview_update_item_foreach", + folderview_update_item_foreach); + syl_plugin_add_symbol("folderview_update_all_updated", + folderview_update_all_updated); + syl_plugin_add_symbol("folderview_mail_popup_factory", mainwin->folderview->mail_factory); syl_plugin_add_symbol("folderview_imap_popup_factory", diff --git a/src/plugin.c b/src/plugin.c index e382bfd2..2193f405 100644 --- a/src/plugin.c +++ b/src/plugin.c @@ -36,6 +36,8 @@ enum { LAST_SIGNAL }; +#define GETFUNC(sym) { func = syl_plugin_lookup_symbol(sym); } + #define SAFE_CALL(func_ptr) { if (func_ptr) func_ptr(); } #define SAFE_CALL_RET(func_ptr) (func_ptr ? func_ptr() : NULL) #define SAFE_CALL_RET_VAL(func_ptr, retval) \ @@ -562,6 +564,50 @@ FolderItem *syl_plugin_folderview_get_selected_item(void) return NULL; } +gint syl_plugin_folderview_check_new(Folder *folder) +{ + gint (*func)(Folder *); + GETFUNC("folderview_check_new"); + return SAFE_CALL_ARG1_RET_VAL(func, folder, FALSE); +} + +gint syl_plugin_folderview_check_new_item(FolderItem *item) +{ + gint (*func)(FolderItem *); + GETFUNC("folderview_check_new_item"); + return SAFE_CALL_ARG1_RET_VAL(func, item, FALSE); +} + +gint syl_plugin_folderview_check_new_all(void) +{ + gint (*func)(void); + GETFUNC("folderview_check_new_all"); + return SAFE_CALL_RET_VAL(func, FALSE); +} + +void syl_plugin_folderview_update_item(FolderItem *item, + gboolean update_summary) +{ + void (*func)(FolderItem *, gboolean); + GETFUNC("folderview_update_item"); + SAFE_CALL_ARG2(func, item, update_summary); +} + +void syl_plugin_folderview_update_item_foreach(GHashTable *table, + gboolean update_summary) +{ + void (*func)(GHashTable *, gboolean); + GETFUNC("folderview_update_item_foreach"); + SAFE_CALL_ARG2(func, table, update_summary); +} + +void syl_plugin_folderview_update_all_updated(gboolean update_summary) +{ + void (*func)(gboolean); + GETFUNC("folderview_update_all_updated"); + SAFE_CALL_ARG1(func, update_summary); +} + gpointer syl_plugin_summary_view_get(void) { gpointer sym; diff --git a/src/plugin.h b/src/plugin.h index 678c05a4..70da79f8 100644 --- a/src/plugin.h +++ b/src/plugin.h @@ -142,6 +142,16 @@ gpointer syl_plugin_folderview_get (void); FolderItem *syl_plugin_folderview_get_selected_item (void); +gint syl_plugin_folderview_check_new (Folder *folder); +gint syl_plugin_folderview_check_new_item (FolderItem *item); +gint syl_plugin_folderview_check_new_all (void); + +void syl_plugin_folderview_update_item (FolderItem *item, + gboolean update_summary); +void syl_plugin_folderview_update_item_foreach (GHashTable *table, + gboolean update_summary); +void syl_plugin_folderview_update_all_updated (gboolean update_summary); + /* SummaryView */ gpointer syl_plugin_summary_view_get (void); void syl_plugin_sumary_select_by_msgnum (guint msgnum); -- cgit v1.2.3