QOF
0.8.7
|
00001 /******************************************************************** 00002 * qofevent.h -- QOF event handling interface * 00003 * Copyright 2000 Dave Peticolas <dave@krondo.com> * 00004 * Copyright 2006 Neil Williams <linux@codehelp.co.uk> * 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 00034 #ifndef QOF_EVENT_H 00035 #define QOF_EVENT_H 00036 00037 #include "qof.h" 00038 00040 typedef gint QofEventId; 00041 00053 #define QOF_MAKE_EVENT(x) (1<<(x)) 00054 00057 #define QOF_EVENT_BASE 8 00058 00069 #define QOF_EVENT_NONE (0) 00070 00071 #define QOF_EVENT_CREATE QOF_MAKE_EVENT(0) 00072 00079 #define QOF_EVENT_MODIFY QOF_MAKE_EVENT(1) 00080 00081 #define QOF_EVENT_DESTROY QOF_MAKE_EVENT(2) 00082 #define QOF_EVENT_ADD QOF_MAKE_EVENT(3) 00083 #define QOF_EVENT_REMOVE QOF_MAKE_EVENT(4) 00084 00092 #define QOF_EVENT_COMMIT QOF_MAKE_EVENT(5) 00093 #define QOF_EVENT__LAST QOF_MAKE_EVENT(QOF_EVENT_BASE-1) 00094 #define QOF_EVENT_ALL (0xff) 00095 00104 typedef void (*QofEventHandler) (QofEntity * ent, QofEventId event_type, 00105 gpointer handler_data, gpointer event_data); 00106 00114 gint qof_event_register_handler (QofEventHandler handler, 00115 gpointer handler_data); 00116 00121 void qof_event_unregister_handler (gint handler_id); 00122 00144 void qof_event_gen (QofEntity * entity, QofEventId event_type, 00145 gpointer event_data); 00146 00153 void qof_event_suspend (void); 00154 00156 void qof_event_resume (void); 00157 00158 #endif 00159