GnuCash  5.6-150-g038405b370+
gnc-ab-kvp.c
1 /*
2  * gnc-ab-kvp.c --
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU General Public License as
6  * published by the Free Software Foundation; either version 2 of
7  * the License, or (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, contact:
16  *
17  * Free Software Foundation Voice: +1-617-542-5942
18  * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652
19  * Boston, MA 02110-1301, USA gnu@gnu.org
20  */
21 
30 #include <config.h>
31 #include "gnc-ui-util.h"
32 
33 #include "gnc-ab-kvp.h"
34 
35 /* This static indicates the debugging module that this .o belongs to. */
36 G_GNUC_UNUSED static QofLogModule log_module = G_LOG_DOMAIN;
37 
38 const gchar *
40 {
41  gchar *id = NULL;
42  qof_instance_get (QOF_INSTANCE (a),
43  "ab-account-id", &id,
44  NULL);
45  return id;
46 }
47 
48 void
50 {
52  qof_instance_set (QOF_INSTANCE (a),
53  "ab-account-id", id,
54  NULL);
56 }
57 
58 const gchar *
60 {
61  gchar *code = NULL;
62  qof_instance_get (QOF_INSTANCE (a),
63  "ab-bank-code", &code,
64  NULL);
65  return code;
66 }
67 
68 void
69 gnc_ab_set_account_bankcode(Account *a, const gchar *code)
70 {
72  qof_instance_set (QOF_INSTANCE (a),
73  "ab-bank-code", code,
74  NULL);
76 }
77 
78 guint32
80 {
81  guint64 uid = 0LL;
82  qof_instance_get (QOF_INSTANCE (a),
83  "ab-account-uid", &uid,
84  NULL);
85  return (guint32)uid;
86 }
87 
88 void
90 {
92  qof_instance_set (QOF_INSTANCE (a),
93  "ab-account-uid", (guint64)uid,
94  NULL);
96 }
97 
98 time64
100 {
101  Time64 *t = NULL;
102  qof_instance_get (QOF_INSTANCE (a),
103  "ab-trans-retrieval", &t,
104  NULL);
105  return t ? t->t : 0;
106 }
107 
108 void
110 {
111  Time64 t = {time};
113  qof_instance_set (QOF_INSTANCE (a),
114  "ab-trans-retrieval", &t,
115  NULL);
117 }
guint32 gnc_ab_get_account_uid(const Account *a)
Return the unique id for the AB_BANKING account in the Account a.
Definition: gnc-ab-kvp.c:79
time64 gnc_ab_get_account_trans_retrieval(const Account *a)
Return the time of last online transaction retrieval for Account a.
Definition: gnc-ab-kvp.c:99
void qof_instance_get(const QofInstance *inst, const gchar *first_prop,...)
Wrapper for g_object_get.
void gnc_ab_set_account_trans_retrieval(Account *a, time64 time)
Set the time of last online transaction retrieval for Account a.
Definition: gnc-ab-kvp.c:109
utility functions for the GnuCash UI
#define G_LOG_DOMAIN
Functions providing the SX List as a plugin page.
STRUCTS.
void qof_instance_set(QofInstance *inst, const gchar *first_prop,...)
Wrapper for g_object_set Group setting multiple parameters in a single begin/commit/rollback.
const gchar * gnc_ab_get_account_bankcode(const Account *a)
Return the bankcode string in the Account a.
Definition: gnc-ab-kvp.c:59
void gnc_ab_set_account_accountid(Account *a, const gchar *id)
Set the accountid string in the Account a to id.
Definition: gnc-ab-kvp.c:49
void gnc_ab_set_account_uid(Account *a, guint32 uid)
Set the unique id for the AB_BANKING account in the Account a to uid.
Definition: gnc-ab-kvp.c:89
void xaccAccountBeginEdit(Account *acc)
The xaccAccountBeginEdit() subroutine is the first phase of a two-phase-commit wrapper for account up...
Definition: Account.cpp:1475
gint64 time64
Most systems that are currently maintained, including Microsoft Windows, BSD-derived Unixes and Linux...
Definition: gnc-date.h:87
const gchar * gnc_ab_get_account_accountid(const Account *a)
Return accountid string in the Account a.
Definition: gnc-ab-kvp.c:39
void gnc_ab_set_account_bankcode(Account *a, const gchar *code)
Set the bankcode string in the Account a to code.
Definition: gnc-ab-kvp.c:69
AqBanking KVP handling.
void xaccAccountCommitEdit(Account *acc)
ThexaccAccountCommitEdit() subroutine is the second phase of a two-phase-commit wrapper for account u...
Definition: Account.cpp:1516