gnc-event.h

Go to the documentation of this file.
00001 /********************************************************************
00002  * gnc-event.h -- engine event handling interface                   *
00003  * Copyright 2000 Dave Peticolas <dave@krondo.com>                  *
00004  *                                                                  *
00005  * This program is free software; you can redistribute it and/or    *
00006  * modify it under the terms of the GNU General Public License as   *
00007  * published by the Free Software Foundation; either version 2 of   *
00008  * the License, or (at your option) any later version.              *
00009  *                                                                  *
00010  * This program is distributed in the hope that it will be useful,  *
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of   *
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the    *
00013  * GNU General Public License for more details.                     *
00014  *                                                                  *
00015  * You should have received a copy of the GNU General Public License*
00016  * along with this program; if not, contact:                        *
00017  *                                                                  *
00018  * Free Software Foundation           Voice:  +1-617-542-5942       *
00019  * 59 Temple Place - Suite 330        Fax:    +1-617-542-2652       *
00020  * Boston, MA  02111-1307,  USA       gnu@gnu.org                   *
00021  *                                                                  *
00022  ********************************************************************/
00023 
00033 #ifndef GNC_EVENT_H
00034 #define GNC_EVENT_H
00035 
00036 #include <glib.h>
00037 
00038 #include "guid.h"
00039 #include "qofid.h"
00040 
00041 typedef enum
00042 {
00043   GNC_EVENT_NONE    = 0,
00044   GNC_EVENT_CREATE  = 1 << 0,
00045   GNC_EVENT_MODIFY  = 1 << 1,
00046   GNC_EVENT_DESTROY = 1 << 2,
00047   GNC_EVENT_ADD     = 1 << 3,
00048   GNC_EVENT_REMOVE  = 1 << 4,
00049   GNC_EVENT_ALL     = 0xff
00050 } GNCEngineEventType;
00051 
00052 
00062 typedef void (*GNCEngineEventHandler) (GUID *entity, QofIdType type,
00063                                        GNCEngineEventType event_type,
00064                                        gpointer user_data);
00065 
00075 gint gnc_engine_register_event_handler (GNCEngineEventHandler handler,
00076                                         gpointer user_data);
00077 
00084 void gnc_engine_unregister_event_handler (gint handler_id);
00085 
00101 void gnc_engine_gen_event (QofEntity *entity,
00102                                 GNCEngineEventType event_type);
00110 void gnc_engine_suspend_events (void);
00111 
00116 void gnc_engine_resume_events (void);
00117 
00118 #endif
00119 

Generated on Fri Oct 21 15:49:54 2005 for QOF by  doxygen 1.4.5