aboutsummaryrefslogtreecommitdiff
path: root/src/plugin.c
diff options
context:
space:
mode:
authorhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2010-01-21 06:08:37 +0000
committerhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2010-01-21 06:08:37 +0000
commit441b184056b95fcf0ce22a1f61c7e8ce779949cc (patch)
tree5aafb212cfe30532551871503d8fca9054b14502 /src/plugin.c
parent596eb7f3b00034bbc0a8b1001c2ca6c8743312d0 (diff)
added new plug-in APIs for compose window.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@2436 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'src/plugin.c')
-rw-r--r--src/plugin.c76
1 files changed, 76 insertions, 0 deletions
diff --git a/src/plugin.c b/src/plugin.c
index 51968572..108573b7 100644
--- a/src/plugin.c
+++ b/src/plugin.c
@@ -31,6 +31,8 @@ enum {
PLUGIN_LOAD,
PLUGIN_UNLOAD,
FOLDERVIEW_MENU_POPUP,
+ COMPOSE_CREATED,
+ COMPOSE_DESTROY,
LAST_SIGNAL
};
@@ -103,6 +105,26 @@ static void syl_plugin_class_init(SylPluginClass *klass)
G_TYPE_NONE,
1,
G_TYPE_POINTER);
+ plugin_signals[COMPOSE_CREATED] =
+ g_signal_new("compose-created",
+ G_TYPE_FROM_CLASS(gobject_class),
+ G_SIGNAL_RUN_FIRST,
+ G_STRUCT_OFFSET(SylPluginClass, compose_created),
+ NULL, NULL,
+ g_cclosure_marshal_VOID__POINTER,
+ G_TYPE_NONE,
+ 1,
+ G_TYPE_POINTER);
+ plugin_signals[COMPOSE_DESTROY] =
+ g_signal_new("compose-destroy",
+ G_TYPE_FROM_CLASS(gobject_class),
+ G_SIGNAL_RUN_FIRST,
+ G_STRUCT_OFFSET(SylPluginClass, compose_destroy),
+ NULL, NULL,
+ g_cclosure_marshal_VOID__POINTER,
+ G_TYPE_NONE,
+ 1,
+ G_TYPE_POINTER);
}
void syl_plugin_signal_connect(const gchar *name, GCallback callback,
@@ -648,6 +670,60 @@ void syl_plugin_open_message_by_new_window(MsgInfo *msginfo)
}
}
+
+gpointer syl_plugin_compose_new(PrefsAccount *account, FolderItem *item,
+ const gchar *mailto, GPtrArray *attach_files)
+{
+ gpointer (*func)(PrefsAccount *, FolderItem *, const gchar *,
+ GPtrArray *);
+
+ func = syl_plugin_lookup_symbol("compose_new");
+ return SAFE_CALL_ARG4_RET(func, account, item, mailto, attach_files);
+}
+
+void syl_plugin_compose_entry_set(gpointer compose, const gchar *text,
+ gint type)
+{
+ void (*func)(gpointer, const gchar *, gint);
+
+ func = syl_plugin_lookup_symbol("compose_entry_set");
+ SAFE_CALL_ARG3(func, compose, text, type);
+}
+
+void syl_plugin_compose_entry_append(gpointer compose, const gchar *text,
+ gint type)
+{
+ void (*func)(gpointer, const gchar *, gint);
+
+ func = syl_plugin_lookup_symbol("compose_entry_append");
+ SAFE_CALL_ARG3(func, compose, text, type);
+}
+
+gchar *syl_plugin_compose_entry_get_text(gpointer compose, gint type)
+{
+ gchar * (*func)(gpointer, gint);
+
+ func = syl_plugin_lookup_symbol("compose_entry_get_text");
+ return SAFE_CALL_ARG2_RET(func, compose, type);
+}
+
+void syl_plugin_compose_lock(gpointer compose)
+{
+ void (*func)(gpointer);
+
+ func = syl_plugin_lookup_symbol("compose_lock");
+ SAFE_CALL_ARG1(func, compose);
+}
+
+void syl_plugin_compose_unlock(gpointer compose)
+{
+ void (*func)(gpointer);
+
+ func = syl_plugin_lookup_symbol("compose_unlock");
+ SAFE_CALL_ARG1(func, compose);
+}
+
+
FolderItem *syl_plugin_folder_sel(Folder *cur_folder, gint sel_type,
const gchar *default_folder)
{