GnuCash 2.4.99
search-core-type.h
00001 /*
00002  *  Copyright (C) 2002 Derek Atkins
00003  *
00004  *  Authors: Derek Atkins <warlord@MIT.EDU>
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 GNU
00014  * General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public
00017  * License along with this program; if not, write to the
00018  * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00019  * Boston, MA 02110-1301, USA.
00020  */
00021 
00022 #ifndef _GNCSEARCH_CORE_TYPE_H
00023 #define _GNCSEARCH_CORE_TYPE_H
00024 
00025 #include "qof.h"
00026 #include "search-param.h"
00027 
00028 #define GNC_TYPE_SEARCH_CORE_TYPE               (gnc_search_core_type_get_type ())
00029 #define GNC_SEARCH_CORE_TYPE(o)                 (G_TYPE_CHECK_INSTANCE_CAST ((o), GNC_TYPE_SEARCH_CORE_TYPE, GNCSearchCoreType))
00030 #define GNC_SEARCH_CORE_TYPE_CLASS(k)           (G_TYPE_CHECK_CLASS_CAST ((k), GNC_TYPE_SEARCH_CORE_TYPE, GNCSearchCoreTypeClass))
00031 #define GNC_IS_SEARCH_CORE_TYPE(o)              (G_TYPE_CHECK_INSTANCE_TYPE ((o), GNC_TYPE_SEARCH_CORE_TYPE))
00032 #define GNC_SEARCH_CORE_TYPE_GET_CLASS(o)       (G_TYPE_INSTANCE_GET_CLASS ((o), GNC_TYPE_SEARCH_CORE_TYPE, GNCSearchCoreTypeClass))
00033 
00034 typedef struct
00035 {
00036     GtkObject parent;
00037 
00038     GNCSearchParam *    param;
00039 } GNCSearchCoreType;
00040 
00041 typedef struct
00042 {
00043     GObjectClass parent_class;
00044 
00045     /* virtual methods */
00046     void                        (*grab_focus) (GNCSearchCoreType *fe);
00047     void                        (*editable_enters) (GNCSearchCoreType *fe);
00048     gboolean            (*validate) (GNCSearchCoreType *fe);
00049     GNCSearchCoreType * (*clone) (GNCSearchCoreType *fe);
00050     GtkWidget *         (*get_widget) (GNCSearchCoreType *);
00051     QofQueryPredData*   (*get_predicate) (GNCSearchCoreType *);
00052 
00053     /* signals */
00054 } GNCSearchCoreTypeClass;
00055 
00056 /* These are internal functions */
00057 GType                   gnc_search_core_type_get_type (void);
00058 GNCSearchCoreType *     gnc_search_core_type_new (void);
00059 
00060 /* Create a new search core_type */
00061 GNCSearchCoreType *     gnc_search_core_type_new_type_name (const char *type);
00062 
00063 /* methods */
00064 void                    gnc_search_core_type_grab_focus (GNCSearchCoreType *fe);
00065 void                    gnc_search_core_type_editable_enters (GNCSearchCoreType *fe);
00066 gboolean                gnc_search_core_type_validate (GNCSearchCoreType *fe);
00067 GNCSearchCoreType *     gnc_search_core_type_clone (GNCSearchCoreType *fe);
00068 GtkWidget *             gnc_search_core_type_get_widget (GNCSearchCoreType *fe);
00069 QofQueryPredData*               gnc_search_core_type_get_predicate (GNCSearchCoreType *fe);
00070 
00071 /* Register a new type in the Core Type Database */
00072 typedef GNCSearchCoreType * (*GNCSearchCoreNew) (void);
00073 void gnc_search_core_register_type (const char *type_name,
00074                                     GNCSearchCoreNew fcn);
00075 
00076 
00077 /* Initialize and Finalize the Core Type Database */
00078 void gnc_search_core_initialize (void);
00079 void gnc_search_core_finalize (void);
00080 
00081 
00082 #endif /* ! _GNCSEARCH_CORE_TYPE_H */
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines