]> Dogcows Code - chaz/homebank/blob - src/hb-category.h
import homebank-5.2.4
[chaz/homebank] / src / hb-category.h
1 /* HomeBank -- Free, easy, personal accounting for everyone.
2 * Copyright (C) 1995-2019 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 gushort _pad1;
33 gchar *name;
34 gdouble budget[13]; //0:is same value, 1 ..12 are months
35
36 /* unsaved datas */
37 gchar *fullname;
38 gboolean flt_select;
39 guint usage_count;
40 };
41
42 #define GF_SUB (1<<0)
43 #define GF_INCOME (1<<1)
44 #define GF_CUSTOM (1<<2)
45 #define GF_BUDGET (1<<3)
46 #define GF_FORCED (1<<4)
47
48 Category *da_cat_clone(Category *src_item);
49 void da_cat_free(Category *item);
50 Category *da_cat_malloc(void);
51
52 void da_cat_destroy(void);
53 void da_cat_new(void);
54
55 guint da_cat_length(void);
56 guint32 da_cat_get_max_key(void);
57
58 guint32 da_cat_remove(guint32 key);
59 gboolean da_cat_insert(Category *acc);
60 gboolean da_cat_append(Category *cat);
61 Category *da_cat_append_ifnew_by_fullname(gchar *rawfullname);
62
63 Category *da_cat_get(guint32 key);
64 gchar *da_cat_get_name(Category *item);
65 Category *da_cat_get_by_fullname(gchar *rawfullname);
66
67 void da_cat_consistency(Category *item);
68
69 GList *category_glist_sorted(gint column);
70
71 guint32 category_report_id(guint32 key, gboolean subcat);
72
73 void category_delete_unused(void);
74 void category_fill_usage(void);
75
76 void category_move(guint32 key1, guint32 key2);
77 gboolean category_rename(Category *item, const gchar *newname);
78
79 gchar *category_find_preset(gchar **lang);
80 gint category_type_get(Category *item);
81 gchar category_get_type_char(Category *item);
82 gint category_change_type(Category *item, gboolean isIncome);
83
84 gboolean category_load_csv(gchar *filename, gchar **error);
85 gboolean category_save_csv(gchar *filename, gchar **error);
86
87 #endif
This page took 0.033403 seconds and 4 git commands to generate.