qofevent.h

Go to the documentation of this file.
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 
00067 #define QOF_EVENT_NONE     (0)
00068 #define QOF_EVENT_CREATE   QOF_MAKE_EVENT(0)
00069 #define QOF_EVENT_MODIFY   QOF_MAKE_EVENT(1)
00070 #define QOF_EVENT_DESTROY  QOF_MAKE_EVENT(2)
00071 #define QOF_EVENT_ADD      QOF_MAKE_EVENT(3)
00072 #define QOF_EVENT_REMOVE   QOF_MAKE_EVENT(4)
00073 #define QOF_EVENT__LAST    QOF_MAKE_EVENT(QOF_EVENT_BASE-1)
00074 #define QOF_EVENT_ALL      (0xff)
00075 
00084 typedef void (*QofEventHandler) (QofEntity *ent,  QofEventId event_type,
00085                                gpointer handler_data, gpointer event_data);
00086 
00094 gint qof_event_register_handler (QofEventHandler handler, gpointer handler_data);
00095 
00100 void qof_event_unregister_handler (gint handler_id);
00101 
00123 void qof_event_gen (QofEntity *entity, QofEventId event_type, 
00124                     gpointer event_data);
00125 
00132 void qof_event_suspend (void);
00133 
00135 void qof_event_resume (void);
00136 
00137 #endif
00138 

Generated on Fri May 12 17:57:20 2006 for QOF by  doxygen 1.4.4