GnuCash 2.4.99
gnc-hooks.h
00001 /*
00002  * gnc-hooks.h -- helpers for using Glib hook functions
00003  * Copyright (C) 2005 David Hampton <hampton@employees.org>
00004  *                    Derek Atkins <derek@ihtfp.com>
00005  *
00006  * This program is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU General Public License as
00008  * published by the Free Software Foundation; either version 2 of
00009  * the License, or (at your option) any later version.
00010  *
00011  * This program is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License
00017  * along with this program; if not, contact:
00018  *
00019  * Free Software Foundation           Voice:  +1-617-542-5942
00020  * 51 Franklin Street, Fifth Floor    Fax:    +1-617-542-2652
00021  * Boston, MA  02110-1301,  USA       gnu@gnu.org
00022  *
00023  */
00024 
00025 #ifndef GNC_HOOKS_H
00026 #define GNC_HOOKS_H
00027 
00033 gchar * gnc_hook_create(const gchar *name, gint num_args, const gchar *desc);
00034 
00039 void gnc_hook_add_dangler(const gchar *name, GFunc callback, gpointer cb_data);
00040 void gnc_hook_remove_dangler(const gchar *name, GFunc callback);
00041 
00045 void gnc_hook_run(const gchar *name, gpointer data);
00046 
00050 void gnc_hooks_init(void);
00051 
00052 /* Common hook names */
00053 #define HOOK_STARTUP            "hook_startup"
00054 #define HOOK_SHUTDOWN           "hook_shutdown"
00055 #define HOOK_UI_STARTUP         "hook_ui_startup"
00056 #define HOOK_UI_POST_STARTUP    "hook_ui_post_startup"
00057 #define HOOK_UI_SHUTDOWN        "hook_ui_shutdown"
00058 #define HOOK_NEW_BOOK           "hook_new_book"
00059 #define HOOK_REPORT             "hook_report"
00060 #define HOOK_CURRENCY_CHANGED   "hook_currency_changed"
00061 #define HOOK_SAVE_OPTIONS       "hook_save_options"
00062 #define HOOK_ADD_EXTENSION      "hook_add_extension"
00063 
00064 /* Common session hook names */
00065 #define HOOK_BOOK_OPENED        "hook_book_opened"
00066 #define HOOK_BOOK_CLOSED        "hook_book_closed"
00067 #define HOOK_BOOK_SAVED         "hook_book_saved"
00068 
00069 #endif /* GNC_HOOKS_H */
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines