3 * Copyright (C) 2006-2009 Jim Evins <evins@snaught.com>.
5 * This file is part of libglabels.
7 * libglabels is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU Lesser General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
12 * libglabels is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public License
18 * along with libglabels. If not, see <http://www.gnu.org/licenses/>.
35 LGL_DB_REG_BAD_PAPER_ID = -1,
36 LGL_DB_REG_BRAND_PART_EXISTS = -2,
37 LGL_DB_REG_FILE_WRITE_ERROR = -3
41 * Module initialization
43 void lgl_db_init (void);
49 GList *lgl_db_get_paper_id_list (void);
51 void lgl_db_free_paper_id_list (GList *ids);
53 GList *lgl_db_get_paper_name_list (void);
55 void lgl_db_free_paper_name_list (GList *names);
57 lglPaper *lgl_db_lookup_paper_from_name (const gchar *name);
59 lglPaper *lgl_db_lookup_paper_from_id (const gchar *id);
61 gchar *lgl_db_lookup_paper_id_from_name (const gchar *name);
63 gchar *lgl_db_lookup_paper_name_from_id (const gchar *id);
65 gboolean lgl_db_is_paper_id_known (const gchar *id);
67 gboolean lgl_db_is_paper_id_other (const gchar *id);
74 GList *lgl_db_get_category_id_list (void);
76 void lgl_db_free_category_id_list (GList *ids);
78 GList *lgl_db_get_category_name_list (void);
80 void lgl_db_free_category_name_list (GList *names);
82 lglCategory *lgl_db_lookup_category_from_name (const gchar *name);
84 lglCategory *lgl_db_lookup_category_from_id (const gchar *id);
86 gchar *lgl_db_lookup_category_id_from_name (const gchar *name);
88 gchar *lgl_db_lookup_category_name_from_id (const gchar *id);
90 gboolean lgl_db_is_category_id_known (const gchar *id);
96 GList *lgl_db_get_brand_list (const gchar *paper_id,
97 const gchar *category_id);
99 void lgl_db_free_brand_list (GList *brands);
105 lglDbRegStatus lgl_db_register_template (const lglTemplate *template);
107 gboolean lgl_db_does_template_exist (const gchar *brand,
110 gboolean lgl_db_does_template_name_exist (const gchar *name);
112 GList *lgl_db_get_template_name_list_unique (const gchar *brand,
113 const gchar *paper_id,
114 const gchar *category_id);
116 GList *lgl_db_get_template_name_list_all (const gchar *brand,
117 const gchar *paper_id,
118 const gchar *category_id);
120 void lgl_db_free_template_name_list (GList *names);
122 lglTemplate *lgl_db_lookup_template_from_name (const gchar *name);
126 * Debugging functions
128 void lgl_db_print_known_papers (void);
130 void lgl_db_print_known_categories (void);
132 void lgl_db_print_known_templates (void);
134 void lgl_db_print_aliases (const lglTemplate *template);
145 * Local Variables: -- emacs
147 * c-basic-offset: 8 -- emacs
148 * tab-width: 8 -- emacs
149 * indent-tabs-mode: nil -- emacs