1 /* HomeBank -- Free, easy, personal accounting for everyone.
2 * Copyright (C) 1995-2012 Maxime DOYEN
4 * This file is part of HomeBank.
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.
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.
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/>.
20 #ifndef __HB_CURRENCY_H__
21 #define __HB_CURRENCY_H__
23 typedef struct _currency Currency
;
24 typedef struct _iso4217 Currency4217
;
35 gchar
*symbol
; /* max symbol is 3 digits in unicode but mostly is 1 digit */
44 gchar format
[8]; /* hold decimal format: '%.xf' */
45 gchar monfmt
[32]; /* hold monetary format: 'prefix %s suffix' */
53 guint curr_frac_digit
;
56 gboolean curr_is_prefix
;
61 typedef struct _ParseExchangeContext ParseExchangeContext
;
62 struct _ParseExchangeContext
64 const gchar
*elt_name
;
71 void da_cur_free(Currency
*item
);
72 Currency
*da_cur_malloc(void);
73 void da_cur_destroy(void);
74 void da_cur_new(void);
76 guint
da_cur_length(void);
77 gboolean
da_cur_remove(guint32 key
);
79 void da_cur_init_from4217(Currency
*cur
, Currency4217
*curfmt
);
80 void da_cur_initformat(Currency
*item
);
82 gboolean
da_cur_insert(Currency
*item
);
83 gboolean
da_cur_append(Currency
*item
);
84 guint32
da_cur_get_max_key(void);
86 Currency
*da_cur_get_by_iso_code(gchar
*iso_code
);
87 Currency
*da_cur_get(guint32 key
);
89 gboolean
currency_is_used(guint32 key
);
90 Currency
*currency_add_from_user(Currency4217
*curfmt
);
91 gboolean
currency_sync_online(GError
**error
);