diff options
| author | Simeon Simeonov | 2018-02-26 11:23:00 +0100 |
|---|---|---|
| committer | Simeon Simeonov | 2018-02-26 11:23:00 +0100 |
| commit | 0b3cbf57875fd692e4ba0b336fefa4bee1ed00dc (patch) | |
| tree | af916a30553c78ce9d4f2d8658656a175c5b6921 /src/plugin.h | |
Initial commit for sylpheed 3.7.0
Diffstat (limited to 'src/plugin.h')
| -rw-r--r-- | src/plugin.h | 376 |
1 files changed, 376 insertions, 0 deletions
diff --git a/src/plugin.h b/src/plugin.h new file mode 100644 index 0000000..9b28dc5 --- /dev/null +++ b/src/plugin.h | |||
| @@ -0,0 +1,376 @@ | |||
| 1 | /* | ||
| 2 | * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client | ||
| 3 | * Copyright (C) 1999-2016 Hiroyuki Yamamoto | ||
| 4 | * | ||
| 5 | * This program is free software; you can redistribute it and/or modify | ||
| 6 | * it under the terms of the GNU General Public License as published by | ||
| 7 | * the Free Software Foundation; either version 2 of the License, or | ||
| 8 | * (at your option) any later version. | ||
| 9 | * | ||
| 10 | * This program is distributed in the hope that it will be useful, | ||
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 13 | * GNU General Public License for more details. | ||
| 14 | * | ||
| 15 | * You should have received a copy of the GNU General Public License | ||
| 16 | * along with this program; if not, write to the Free Software | ||
| 17 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | ||
| 18 | */ | ||
| 19 | |||
| 20 | #ifndef __PLUGIN_H__ | ||
| 21 | #define __PLUGIN_H__ | ||
| 22 | |||
| 23 | #include <glib.h> | ||
| 24 | #include <glib-object.h> | ||
| 25 | #include <gmodule.h> | ||
| 26 | #include <gtk/gtk.h> | ||
| 27 | |||
| 28 | #include "procmsg.h" | ||
| 29 | #include "folder.h" | ||
| 30 | #include "filter.h" | ||
| 31 | #include "plugin-types.h" | ||
| 32 | |||
| 33 | /* SylPlugin object */ | ||
| 34 | |||
| 35 | #define SYL_TYPE_PLUGIN (syl_plugin_get_type()) | ||
| 36 | #define SYL_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), SYL_TYPE_PLUGIN, SylPlugin)) | ||
| 37 | #define SYL_IS_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), SYL_TYPE_PLUGIN)) | ||
| 38 | #define SYL_PLUGIN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), SYL_TYPE_PLUGIN, SylPluginClass)) | ||
| 39 | #define SYL_IS_PLUGIN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), SYL_TYPE_PLUGIN)) | ||
| 40 | #define SYL_PLUGIN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), SYL_TYPE_PLUGIN, SylPluginClass)) | ||
| 41 | |||
| 42 | typedef struct _SylPlugin SylPlugin; | ||
| 43 | typedef struct _SylPluginClass SylPluginClass; | ||
| 44 | typedef struct _SylPluginInfo SylPluginInfo; | ||
| 45 | |||
| 46 | typedef void (*SylPluginLoadFunc) (void); | ||
| 47 | typedef void (*SylPluginUnloadFunc) (void); | ||
| 48 | typedef void (*SylPluginCallbackFunc) (void); | ||
| 49 | |||
| 50 | #define SYL_PLUGIN_INTERFACE_VERSION 0x010a | ||
| 51 | |||
| 52 | struct _SylPlugin | ||
| 53 | { | ||
| 54 | GObject parent_instance; | ||
| 55 | }; | ||
| 56 | |||
| 57 | struct _SylPluginClass | ||
| 58 | { | ||
| 59 | GObjectClass parent_class; | ||
| 60 | |||
| 61 | void (* plugin_load) (GObject *obj, GModule *module); | ||
| 62 | void (* plugin_unload) (GObject *obj, GModule *module); | ||
| 63 | |||
| 64 | void (* folderview_menu_popup) (GObject *obj, gpointer ifactory); | ||
| 65 | void (* summaryview_menu_popup) (GObject *obj, gpointer ifactory); | ||
| 66 | |||
| 67 | void (* compose_created) (GObject *obj, gpointer compose); | ||
| 68 | void (* compose_destroy) (GObject *obj, gpointer compose); | ||
| 69 | |||
| 70 | void (* textview_menu_popup) (GObject *obj, | ||
| 71 | GtkMenu *menu, | ||
| 72 | GtkTextView *textview, | ||
| 73 | const gchar *uri, | ||
| 74 | const gchar *selected_text, | ||
| 75 | MsgInfo *msginfo); | ||
| 76 | |||
| 77 | gboolean (* compose_send) (GObject *obj, | ||
| 78 | gpointer compose, | ||
| 79 | gint compose_mode, | ||
| 80 | gint send_mode, | ||
| 81 | const gchar *msg_file, | ||
| 82 | GSList *to_list); | ||
| 83 | |||
| 84 | void (* messageview_show) (GObject *obj, | ||
| 85 | gpointer msgview, | ||
| 86 | MsgInfo *msginfo, | ||
| 87 | gboolean all_headers); | ||
| 88 | |||
| 89 | void (* inc_mail_start) (GObject *obj, | ||
| 90 | PrefsAccount *account); | ||
| 91 | void (* inc_mail_finished) (GObject *obj, | ||
| 92 | gint new_messages); | ||
| 93 | |||
| 94 | /* Prefs dialogs */ | ||
| 95 | void (* prefs_common_open) (GObject *obj, | ||
| 96 | GtkWidget *window); | ||
| 97 | void (* prefs_account_open) (GObject *obj, | ||
| 98 | PrefsAccount *account, | ||
| 99 | GtkWidget *window); | ||
| 100 | void (* prefs_filter_open) (GObject *obj, | ||
| 101 | GtkWidget *window); | ||
| 102 | void (* prefs_filter_edit_open) (GObject *obj, | ||
| 103 | FilterRule *rule, | ||
| 104 | const gchar *header, | ||
| 105 | const gchar *key, | ||
| 106 | GtkWidget *window); | ||
| 107 | void (* prefs_template_open) (GObject *obj, | ||
| 108 | GtkWidget *window); | ||
| 109 | void (* plugin_manager_open) (GObject *obj, | ||
| 110 | GtkWidget *window); | ||
| 111 | |||
| 112 | void (* main_window_toolbar_changed) (GObject *obj); | ||
| 113 | void (* compose_toolbar_changed) (GObject *obj, gpointer compose); | ||
| 114 | void (* compose_attach_changed) (GObject *obj, gpointer compose); | ||
| 115 | }; | ||
| 116 | |||
| 117 | struct _SylPluginInfo | ||
| 118 | { | ||
| 119 | gchar *name; | ||
| 120 | gchar *version; | ||
| 121 | gchar *author; | ||
| 122 | gchar *description; | ||
| 123 | |||
| 124 | gpointer pad1; | ||
| 125 | gpointer pad2; | ||
| 126 | gpointer pad3; | ||
| 127 | gpointer pad4; | ||
| 128 | }; | ||
| 129 | |||
| 130 | GType syl_plugin_get_type (void); | ||
| 131 | |||
| 132 | void syl_plugin_signal_connect (const gchar *name, GCallback callback, | ||
| 133 | gpointer data); | ||
| 134 | void syl_plugin_signal_disconnect (gpointer func, gpointer data); | ||
| 135 | void syl_plugin_signal_emit (const gchar *name, ...); | ||
| 136 | |||
| 137 | /* Used by Sylpheed */ | ||
| 138 | |||
| 139 | gint syl_plugin_init_lib (void); | ||
| 140 | |||
| 141 | gint syl_plugin_load (const gchar *file); | ||
| 142 | gint syl_plugin_load_all (const gchar *dir); | ||
| 143 | void syl_plugin_unload_all (void); | ||
| 144 | |||
| 145 | GSList *syl_plugin_get_module_list (void); | ||
| 146 | SylPluginInfo *syl_plugin_get_info (GModule *module); | ||
| 147 | gboolean syl_plugin_check_version (GModule *module); | ||
| 148 | |||
| 149 | gint syl_plugin_add_symbol (const gchar *name, gpointer sym); | ||
| 150 | gpointer syl_plugin_lookup_symbol (const gchar *name); | ||
| 151 | |||
| 152 | /* Interfaces which should be implemented by plug-ins | ||
| 153 | void plugin_load(void); | ||
| 154 | void plugin_unload(void); | ||
| 155 | SylPluginInfo *plugin_info(void); | ||
| 156 | gint plugin_interface_version(void); | ||
| 157 | */ | ||
| 158 | |||
| 159 | /* Plug-in API (used by plug-ins) */ | ||
| 160 | |||
| 161 | const gchar *syl_plugin_get_prog_version (void); | ||
| 162 | |||
| 163 | void syl_plugin_main_window_lock (void); | ||
| 164 | void syl_plugin_main_window_unlock (void); | ||
| 165 | gpointer syl_plugin_main_window_get (void); | ||
| 166 | void syl_plugin_main_window_popup (gpointer mainwin); | ||
| 167 | GtkWidget *syl_plugin_main_window_get_toolbar (void); | ||
| 168 | GtkWidget *syl_plugin_main_window_get_statusbar (void); | ||
| 169 | |||
| 170 | void syl_plugin_app_will_exit (gboolean force); | ||
| 171 | |||
| 172 | /* Menu */ | ||
| 173 | gint syl_plugin_add_menuitem (const gchar *parent, | ||
| 174 | const gchar *label, | ||
| 175 | SylPluginCallbackFunc func, | ||
| 176 | gpointer data); | ||
| 177 | gint syl_plugin_add_factory_item (const gchar *menu, | ||
| 178 | const gchar *label, | ||
| 179 | SylPluginCallbackFunc func, | ||
| 180 | gpointer data); | ||
| 181 | |||
| 182 | void syl_plugin_menu_set_sensitive (const gchar *path, | ||
| 183 | gboolean sensitive); | ||
| 184 | void syl_plugin_menu_set_sensitive_all (GtkMenuShell *menu_shell, | ||
| 185 | gboolean sensitive); | ||
| 186 | void syl_plugin_menu_set_active (const gchar *path, | ||
| 187 | gboolean is_active); | ||
| 188 | |||
| 189 | |||
| 190 | /* FolderView */ | ||
| 191 | gpointer syl_plugin_folderview_get (void); | ||
| 192 | |||
| 193 | void syl_plugin_folderview_add_sub_widget (GtkWidget *widget); | ||
| 194 | |||
| 195 | void syl_plugin_folderview_select (FolderItem *item); | ||
| 196 | void syl_plugin_folderview_unselect (void); | ||
| 197 | void syl_plugin_folderview_select_next_unread (void); | ||
| 198 | FolderItem *syl_plugin_folderview_get_selected_item | ||
| 199 | (void); | ||
| 200 | |||
| 201 | gint syl_plugin_folderview_check_new (Folder *folder); | ||
| 202 | gint syl_plugin_folderview_check_new_item (FolderItem *item); | ||
| 203 | gint syl_plugin_folderview_check_new_all (void); | ||
| 204 | |||
| 205 | void syl_plugin_folderview_update_item (FolderItem *item, | ||
| 206 | gboolean update_summary); | ||
| 207 | void syl_plugin_folderview_update_item_foreach (GHashTable *table, | ||
| 208 | gboolean update_summary); | ||
| 209 | void syl_plugin_folderview_update_all_updated (gboolean update_summary); | ||
| 210 | void syl_plugin_folderview_check_new_selected (void); | ||
| 211 | |||
| 212 | /* SummaryView */ | ||
| 213 | gpointer syl_plugin_summary_view_get (void); | ||
| 214 | void syl_plugin_summary_select_by_msgnum (guint msgnum); | ||
| 215 | gboolean syl_plugin_summary_select_by_msginfo (MsgInfo *msginfo); | ||
| 216 | |||
| 217 | void syl_plugin_open_message (const gchar *folder_id, | ||
| 218 | guint msgnum); | ||
| 219 | |||
| 220 | void syl_plugin_summary_show_queued_msgs (void); | ||
| 221 | |||
| 222 | void syl_plugin_summary_lock (void); | ||
| 223 | void syl_plugin_summary_unlock (void); | ||
| 224 | gboolean syl_plugin_summary_is_locked (void); | ||
| 225 | gboolean syl_plugin_summary_is_read_locked (void); | ||
| 226 | void syl_plugin_summary_write_lock (void); | ||
| 227 | void syl_plugin_summary_write_unlock (void); | ||
| 228 | gboolean syl_plugin_summary_is_write_locked (void); | ||
| 229 | |||
| 230 | FolderItem *syl_plugin_summary_get_current_folder | ||
| 231 | (void); | ||
| 232 | |||
| 233 | gint syl_plugin_summary_get_selection_type (void); | ||
| 234 | GSList *syl_plugin_summary_get_selected_msg_list(void); | ||
| 235 | GSList *syl_plugin_summary_get_msg_list (void); | ||
| 236 | |||
| 237 | void syl_plugin_summary_redisplay_msg (void); | ||
| 238 | void syl_plugin_summary_open_msg (void); | ||
| 239 | void syl_plugin_summary_view_source (void); | ||
| 240 | void syl_plugin_summary_reedit (void); | ||
| 241 | |||
| 242 | void syl_plugin_summary_update_selected_rows (void); | ||
| 243 | void syl_plugin_summary_update_by_msgnum (guint msgnum); | ||
| 244 | |||
| 245 | /* MessageView */ | ||
| 246 | gpointer syl_plugin_messageview_create_with_new_window | ||
| 247 | (void); | ||
| 248 | void syl_plugin_open_message_by_new_window (MsgInfo *msginfo); | ||
| 249 | |||
| 250 | /* Compose */ | ||
| 251 | gpointer syl_plugin_compose_new (PrefsAccount *account, | ||
| 252 | FolderItem *item, | ||
| 253 | const gchar *mailto, | ||
| 254 | GPtrArray *attach_files); | ||
| 255 | /* compose mode: | ||
| 256 | 1: reply 2: reply to sender 3: reply to all 4: reply to list | ||
| 257 | | 1 << 16: with quote */ | ||
| 258 | gpointer syl_plugin_compose_reply (MsgInfo *msginfo, | ||
| 259 | FolderItem *item, | ||
| 260 | gint mode, | ||
| 261 | const gchar *body); | ||
| 262 | gpointer syl_plugin_compose_forward (GSList *mlist, | ||
| 263 | FolderItem *item, | ||
| 264 | gboolean as_attach, | ||
| 265 | const gchar *body); | ||
| 266 | gpointer syl_plugin_compose_redirect (MsgInfo *msginfo, | ||
| 267 | FolderItem *item); | ||
| 268 | gpointer syl_plugin_compose_reedit (MsgInfo *msginfo); | ||
| 269 | |||
| 270 | /* entry type: | ||
| 271 | 0: To 1: Cc 2: Bcc 3: Reply-To 4: Subject 5: Newsgroups 6: Followup-To */ | ||
| 272 | void syl_plugin_compose_entry_set (gpointer compose, | ||
| 273 | const gchar *text, | ||
| 274 | gint type); | ||
| 275 | void syl_plugin_compose_entry_append (gpointer compose, | ||
| 276 | const gchar *text, | ||
| 277 | gint type); | ||
| 278 | gchar *syl_plugin_compose_entry_get_text (gpointer compose, | ||
| 279 | gint type); | ||
| 280 | void syl_plugin_compose_lock (gpointer compose); | ||
| 281 | void syl_plugin_compose_unlock (gpointer compose); | ||
| 282 | |||
| 283 | GtkWidget *syl_plugin_compose_get_toolbar (gpointer compose); | ||
| 284 | GtkWidget *syl_plugin_compose_get_misc_hbox (gpointer compose); | ||
| 285 | GtkWidget *syl_plugin_compose_get_textview (gpointer compose); | ||
| 286 | |||
| 287 | gint syl_plugin_compose_send (gpointer compose, | ||
| 288 | gboolean close_on_success); | ||
| 289 | void syl_plugin_compose_attach_append (gpointer compose, | ||
| 290 | const gchar *file, | ||
| 291 | const gchar *filename, | ||
| 292 | const gchar *content_type); | ||
| 293 | void syl_plugin_compose_attach_remove_all (gpointer compose); | ||
| 294 | /* returns list of SylPluginAttachInfo (GSList must be freed by caller) */ | ||
| 295 | GSList *syl_plugin_get_attach_list (gpointer compose); | ||
| 296 | |||
| 297 | /* Others */ | ||
| 298 | FolderItem *syl_plugin_folder_sel (Folder *cur_folder, | ||
| 299 | gint sel_type, | ||
| 300 | const gchar *default_folder); | ||
| 301 | FolderItem *syl_plugin_folder_sel_full (Folder *cur_folder, | ||
| 302 | gint sel_type, | ||
| 303 | const gchar *default_folder, | ||
| 304 | const gchar *message); | ||
| 305 | |||
| 306 | gchar *syl_plugin_input_dialog (const gchar *title, | ||
| 307 | const gchar *message, | ||
| 308 | const gchar *default_string); | ||
| 309 | gchar *syl_plugin_input_dialog_with_invisible (const gchar *title, | ||
| 310 | const gchar *message, | ||
| 311 | const gchar *default_string); | ||
| 312 | |||
| 313 | void syl_plugin_manage_window_set_transient (GtkWindow *window); | ||
| 314 | void syl_plugin_manage_window_signals_connect (GtkWindow *window); | ||
| 315 | GtkWidget *syl_plugin_manage_window_get_focus_window | ||
| 316 | (void); | ||
| 317 | |||
| 318 | void syl_plugin_inc_mail (void); | ||
| 319 | gboolean syl_plugin_inc_is_active (void); | ||
| 320 | void syl_plugin_inc_lock (void); | ||
| 321 | void syl_plugin_inc_unlock (void); | ||
| 322 | |||
| 323 | void syl_plugin_update_check (gboolean show_dialog_always); | ||
| 324 | void syl_plugin_update_check_set_check_url (const gchar *url); | ||
| 325 | const gchar *syl_plugin_update_check_get_check_url (void); | ||
| 326 | void syl_plugin_update_check_set_download_url (const gchar *url); | ||
| 327 | const gchar *syl_plugin_update_check_get_download_url (void); | ||
| 328 | void syl_plugin_update_check_set_jump_url (const gchar *url); | ||
| 329 | const gchar *syl_plugin_update_check_get_jump_url (void); | ||
| 330 | void syl_plugin_update_check_set_check_plugin_url (const gchar *url); | ||
| 331 | const gchar *syl_plugin_update_check_get_check_plugin_url(void); | ||
| 332 | void syl_plugin_update_check_set_jump_plugin_url (const gchar *url); | ||
| 333 | const gchar *syl_plugin_update_check_get_jump_plugin_url(void); | ||
| 334 | |||
| 335 | /* type corresponds to AlertType | ||
| 336 | * default_value and return value corresponds to AlertValue */ | ||
| 337 | gint syl_plugin_alertpanel_full (const gchar *title, | ||
| 338 | const gchar *message, | ||
| 339 | gint type, | ||
| 340 | gint default_value, | ||
| 341 | gboolean can_disable, | ||
| 342 | const gchar *btn1_label, | ||
| 343 | const gchar *btn2_label, | ||
| 344 | const gchar *btn3_label); | ||
| 345 | gint syl_plugin_alertpanel (const gchar *title, | ||
| 346 | const gchar *message, | ||
| 347 | const gchar *btn1_label, | ||
| 348 | const gchar *btn2_label, | ||
| 349 | const gchar *btn3_label); | ||
| 350 | void syl_plugin_alertpanel_message (const gchar *title, | ||
| 351 | const gchar *message, | ||
| 352 | gint type); | ||
| 353 | gint syl_plugin_alertpanel_message_with_disable (const gchar *title, | ||
| 354 | const gchar *message, | ||
| 355 | gint type); | ||
| 356 | |||
| 357 | /* Send message */ | ||
| 358 | gint syl_plugin_send_message (const gchar *file, | ||
| 359 | PrefsAccount *ac, | ||
| 360 | GSList *to_list); | ||
| 361 | gint syl_plugin_send_message_queue_all (FolderItem *queue, | ||
| 362 | gboolean save_msgs, | ||
| 363 | gboolean filter_msgs); | ||
| 364 | gint syl_plugin_send_message_set_reply_flag (const gchar *reply_target, | ||
| 365 | const gchar *msgid); | ||
| 366 | gint syl_plugin_send_message_set_forward_flags (const gchar *forward_targets); | ||
| 367 | |||
| 368 | /* Notification window */ | ||
| 369 | gint syl_plugin_notification_window_open (const gchar *message, | ||
| 370 | const gchar *submessage, | ||
| 371 | guint timeout); | ||
| 372 | void syl_plugin_notification_window_set_message (const gchar *message, | ||
| 373 | const gchar *submessage); | ||
| 374 | void syl_plugin_notification_window_close (void); | ||
| 375 | |||
| 376 | #endif /* __PLUGIN_H__ */ | ||
