add gitignore
[chaz/homebank] / src / hb-category.h
1 /* HomeBank -- Free, easy, personal accounting for everyone.
2 * Copyright (C) 1995-2014 Maxime DOYEN
3 *
4 * This file is part of HomeBank.
5 *
6 * HomeBank is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * HomeBank 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
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20 #ifndef __HB_CATEGORY_H__
21 #define __HB_CATEGORY_H__
22
23
24 typedef struct _category Category;
25
26
27 struct _category
28 {
29 guint32 key;
30 guint32 parent;
31 gushort flags;
32 gchar *name;
33 gdouble budget[13]; //0:is same value, 1 ..12 are months
34
35 /* unsaved datas */
36 gboolean filter;
37 gboolean imported;
38 };
39
40 #define GF_SUB (1<<0)
41 #define GF_INCOME (1<<1)
42 #define GF_CUSTOM (1<<2)
43 #define GF_BUDGET (1<<3)
44 #define GF_FORCED (1<<4)
45
46 Category *da_cat_clone(Category *src_item);
47 void da_cat_free(Category *item);
48 Category *da_cat_malloc(void);
49 void da_cat_destroy(void);
50 void da_cat_new(void);
51
52 guint da_cat_length(void);
53 guint32 da_cat_remove(guint32 key);
54 gboolean da_cat_insert(Category *acc);
55 gboolean da_cat_append(Category *cat);
56 guint32 da_cat_get_max_key(void);
57 gchar *da_cat_get_fullname(Category *cat);
58
59 guint32 da_cat_get_key_by_name(gchar *name);
60 Category *da_cat_get_by_name(gchar *name);
61 Category *da_cat_get(guint32 key);
62 Category *da_cat_get_by_fullname(gchar *fullname);
63 Category *da_cat_append_ifnew_by_fullname(gchar *fullname, gboolean imported);
64 void da_cat_consistency(Category *item);
65
66 GList *category_glist_sorted(gint column);
67
68 gboolean category_is_used(guint32 key);
69 void category_move(guint32 key1, guint32 key2);
70 gboolean category_rename(Category *item, const gchar *newname);
71 gint category_change_type(Category *item, gboolean isIncome);
72
73 gboolean category_load_csv(gchar *filename, gchar **error);
74 gboolean category_save_csv(gchar *filename, gchar **error);
75 gchar *category_find_preset(gchar **lang);
76
77 #endif
This page took 0.04044 seconds and 4 git commands to generate.