GnuCash  2.6.99
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
gnc-hooks.h
1 /*
2  * gnc-hooks.h -- helpers for using Glib hook functions
3  * Copyright (C) 2005 David Hampton <[email protected]>
4  * Derek Atkins <[email protected]>
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License as
8  * published by the Free Software Foundation; either version 2 of
9  * the License, or (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, contact:
18  *
19  * Free Software Foundation Voice: +1-617-542-5942
20  * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652
21  * Boston, MA 02110-1301, USA [email protected]
22  *
23  */
24 
25 #ifndef GNC_HOOKS_H
26 #define GNC_HOOKS_H
27 
33 gchar * gnc_hook_create(const gchar *name, gint num_args, const gchar *desc);
34 
39 void gnc_hook_add_dangler(const gchar *name, GFunc callback, gpointer cb_data);
40 void gnc_hook_remove_dangler(const gchar *name, GFunc callback);
41 
45 void gnc_hook_run(const gchar *name, gpointer data);
46 
50 void gnc_hooks_init(void);
51 
52 /* Common hook names */
53 #define HOOK_STARTUP "hook_startup"
54 #define HOOK_SHUTDOWN "hook_shutdown"
55 #define HOOK_UI_STARTUP "hook_ui_startup"
56 #define HOOK_UI_POST_STARTUP "hook_ui_post_startup"
57 #define HOOK_UI_SHUTDOWN "hook_ui_shutdown"
58 #define HOOK_NEW_BOOK "hook_new_book"
59 #define HOOK_REPORT "hook_report"
60 #define HOOK_CURRENCY_CHANGED "hook_currency_changed"
61 #define HOOK_SAVE_OPTIONS "hook_save_options"
62 #define HOOK_ADD_EXTENSION "hook_add_extension"
63 
64 /* Common session hook names */
65 #define HOOK_BOOK_OPENED "hook_book_opened"
66 #define HOOK_BOOK_CLOSED "hook_book_closed"
67 #define HOOK_BOOK_SAVED "hook_book_saved"
68 
69 #endif /* GNC_HOOKS_H */