GnuCash  2.6.99
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
search-core-type.h
1 /*
2  * Copyright (C) 2002 Derek Atkins
3  *
4  * Authors: Derek Atkins <[email protected]>
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 #define GNC_TYPE_SEARCH_CORE_TYPE (gnc_search_core_type_get_type ())
29 #define GNC_SEARCH_CORE_TYPE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GNC_TYPE_SEARCH_CORE_TYPE, GNCSearchCoreType))
30 #define GNC_SEARCH_CORE_TYPE_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), GNC_TYPE_SEARCH_CORE_TYPE, GNCSearchCoreTypeClass))
31 #define GNC_IS_SEARCH_CORE_TYPE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GNC_TYPE_SEARCH_CORE_TYPE))
32 #define GNC_SEARCH_CORE_TYPE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GNC_TYPE_SEARCH_CORE_TYPE, GNCSearchCoreTypeClass))
33 
34 typedef struct
35 {
36  GtkObject parent;
37 
38  GNCSearchParam * param;
40 
41 typedef struct
42 {
43  GObjectClass parent_class;
44 
45  /* virtual methods */
46  void (*grab_focus) (GNCSearchCoreType *fe);
47  void (*editable_enters) (GNCSearchCoreType *fe);
48  gboolean (*validate) (GNCSearchCoreType *fe);
49  GNCSearchCoreType * (*clone) (GNCSearchCoreType *fe);
50  GtkWidget * (*get_widget) (GNCSearchCoreType *);
51  QofQueryPredData* (*get_predicate) (GNCSearchCoreType *);
52 
53  /* signals */
55 
56 /* These are internal functions */
57 GType gnc_search_core_type_get_type (void);
58 GNCSearchCoreType * gnc_search_core_type_new (void);
59 
60 /* Create a new search core_type */
61 GNCSearchCoreType * gnc_search_core_type_new_type_name (const char *type);
62 
63 /* methods */
64 void gnc_search_core_type_grab_focus (GNCSearchCoreType *fe);
65 void gnc_search_core_type_editable_enters (GNCSearchCoreType *fe);
66 gboolean gnc_search_core_type_validate (GNCSearchCoreType *fe);
67 GNCSearchCoreType * gnc_search_core_type_clone (GNCSearchCoreType *fe);
68 GtkWidget * gnc_search_core_type_get_widget (GNCSearchCoreType *fe);
69 QofQueryPredData* gnc_search_core_type_get_predicate (GNCSearchCoreType *fe);
70 
71 /* Register a new type in the Core Type Database */
72 typedef GNCSearchCoreType * (*GNCSearchCoreNew) (void);
73 void gnc_search_core_register_type (const char *type_name,
74  GNCSearchCoreNew fcn);
75 
76 
77 /* Initialize and Finalize the Core Type Database */
78 void gnc_search_core_initialize (void);
79 void gnc_search_core_finalize (void);
80 
81 
82 #endif /* ! _GNCSEARCH_CORE_TYPE_H */