QOF
0.7.5
Main Page
Related Pages
Modules
Data Structures
Files
File List
Globals
qofbookmerge.h
Go to the documentation of this file.
1
/*********************************************************************
2
* qofbookmerge.h -- api for QofBook merge with collision handling *
3
* Copyright (C) 2004 Neil Williams <linux@codehelp.co.uk> *
4
* *
5
* This program is free software; you can redistribute it and/or *
6
* modify it under the terms of the GNU General Public License as *
7
* published by the Free Software Foundation; either version 2 of *
8
* the License, or (at your option) any later version. *
9
* *
10
* This program is distributed in the hope that it will be useful, *
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13
* GNU General Public License for more details. *
14
* *
15
* You should have received a copy of the GNU General Public License *
16
* along with this program; if not, contact: *
17
* *
18
* Free Software Foundation Voice: +1-617-542-5942 *
19
* 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 *
20
* Boston, MA 02110-1301, USA gnu@gnu.org *
21
* *
22
********************************************************************/
23
24
#ifndef QOFBOOKMERGE_H
25
#define QOFBOOKMERGE_H
26
27
#define QOF_MOD_MERGE "qof-merge"
28
81
#include "
qofutil.h
"
82
#include "
qofbook.h
"
83
#include "
qofclass.h
"
84
#include "
qofobject.h
"
85
#include "
qofinstance.h
"
86
#include "
qoflog.h
"
87
125
typedef
enum
126
{
127
MERGE_UNDEF
,
128
MERGE_ABSOLUTE
,
129
MERGE_NEW
,
131
MERGE_REPORT
,
132
MERGE_DUPLICATE
,
134
MERGE_UPDATE
,
136
MERGE_INVALID
138
}
QofBookMergeResult
;
139
164
typedef
struct
165
{
166
/* internal counters and reference variables */
167
gboolean mergeAbsolute;
169
double
difference;
171
gboolean updated;
173
/* rule objects set from or by external calls */
174
QofIdType
mergeType;
176
const
gchar *mergeLabel;
178
GSList *
mergeParam
;
179
GSList *linkedEntList;
188
QofBookMergeResult
mergeResult
;
189
QofEntity
*
importEnt
;
190
QofEntity
*targetEnt;
192
}
QofBookMergeRule
;
193
194
209
typedef
struct
210
{
211
GSList *mergeObjectParams;
213
GList *mergeList;
215
GSList *targetList;
217
QofBook
*mergeBook;
219
QofBook
*targetBook;
221
gboolean
abort
;
222
QofBookMergeRule
*currentRule;
224
GSList *orphan_list;
232
GHashTable *target_table;
235
}
QofBookMergeData
;
236
237
238
/* ======================================================================== */
274
QofBookMergeData
*
qof_book_merge_init
(
QofBook
* importBook,
275
QofBook
* targetBook);
276
277
321
typedef
void (*
QofBookMergeRuleForeachCB
) (
QofBookMergeData
*,
322
QofBookMergeRule
*, guint);
323
348
void
qof_book_merge_rule_foreach
(
QofBookMergeData
* mergeData,
349
QofBookMergeRuleForeachCB
callback,
350
QofBookMergeResult
mergeResult);
351
366
gchar *
qof_book_merge_param_as_string
(
QofParam
* qtparam,
QofEntity
* qtEnt);
367
447
QofBookMergeData
*
qof_book_merge_update_result
(
QofBookMergeData
* mergeData,
448
QofBookMergeResult
tag);
449
483
gint
qof_book_merge_commit
(
QofBookMergeData
* mergeData);
484
492
void
qof_book_merge_abort
(
QofBookMergeData
* mergeData);
493
494
#endif // QOFBOOKMERGE_H
495
qof
qofbookmerge.h
Generated by
1.8.3.1