GnuCash  5.6-150-g038405b370+
search-core-type.h
1 /*
2  * Copyright (C) 2002 Derek Atkins
3  *
4  * Authors: Derek Atkins <warlord@MIT.EDU>
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 GNU
14  * General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public
17  * License along with this program; if not, write to the
18  * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19  * Boston, MA 02110-1301, USA.
20  */
21 
22 #ifndef _GNCSEARCH_CORE_TYPE_H
23 #define _GNCSEARCH_CORE_TYPE_H
24 
25 #include "qof.h"
26 #include "search-param.h"
27 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31 
32 #define GNC_TYPE_SEARCH_CORE_TYPE (gnc_search_core_type_get_type ())
33 G_DECLARE_DERIVABLE_TYPE (GNCSearchCoreType, gnc_search_core_type, GNC, SEARCH_CORE_TYPE, GObject)
34 
36 {
37  GObjectClass parent_class;
38 
39  /* virtual methods */
40  void (*grab_focus) (GNCSearchCoreType *fe);
41  void (*editable_enters) (GNCSearchCoreType *fe);
42  void (*pass_parent) (GNCSearchCoreType *fe, gpointer parent);
43  gboolean (*validate) (GNCSearchCoreType *fe);
44  GNCSearchCoreType * (*clone) (GNCSearchCoreType *fe);
45  GtkWidget * (*get_widget) (GNCSearchCoreType *);
46  QofQueryPredData* (*get_predicate) (GNCSearchCoreType *);
47 };
48 
49 /* These are internal functions */
50 GNCSearchCoreType * gnc_search_core_type_new (void);
51 
52 /* Create a new search core_type */
53 GNCSearchCoreType * gnc_search_core_type_new_type_name (const char *type);
54 
55 /* methods */
56 void gnc_search_core_type_grab_focus (GNCSearchCoreType *fe);
57 void gnc_search_core_type_editable_enters (GNCSearchCoreType *fe);
58 void gnc_search_core_type_pass_parent (GNCSearchCoreType *fe, gpointer parent);
59 gboolean gnc_search_core_type_validate (GNCSearchCoreType *fe);
60 GNCSearchCoreType * gnc_search_core_type_clone (GNCSearchCoreType *fe);
61 GtkWidget * gnc_search_core_type_get_widget (GNCSearchCoreType *fe);
62 QofQueryPredData* gnc_search_core_type_get_predicate (GNCSearchCoreType *fe);
63 
64 /* Register a new type in the Core Type Database */
65 typedef GNCSearchCoreType * (*GNCSearchCoreNew) (void);
66 void gnc_search_core_register_type (const char *type_name,
67  GNCSearchCoreNew fcn);
68 
69 
70 /* Initialize and Finalize the Core Type Database */
71 void gnc_search_core_initialize (void);
72 void gnc_search_core_finalize (void);
73 
74 #ifdef __cplusplus
75 }
76 #endif
77 
78 #endif /* ! _GNCSEARCH_CORE_TYPE_H */