qofreference.h File Reference

Detailed Description

Dealing with relationships between entities in partial books.

Copyright (c) 2006 Neil Williams <linux@codehelp.co.uk>

Definition in file qofreference.h.

#include "qof.h"

Go to the source code of this file.

Data Structures

struct  qof_entity_reference
 External references in a partial QofBook. More...

Using a partial QofBook.

Part of the handling for partial books requires a storage mechanism for references to entities that are not within reach of the partial book. This requires a GList in the book data to contain the reference QofIdType and GUID so that when the book is written out, the reference can be included. See qof_book_get_data.

When the file is imported back in, the list needs to be rebuilt. The QSF backend rebuilds the references by linking to real entities. Other backends can process the list in similar ways.

The list stores the QofEntityReference to the referenced entity - a struct that contains the GUID and the QofIdType of the referenced entity as well as the parameter used to obtain the reference.

Partial books need to be differentiated in the backend, the flag in the book data is used by qof_session_save to prevent a partial book being saved using a backend that requires a full book. Forcing this flag would cause data loss so always merge a partial book with the complete book (even if that book is initially empty) before trying to save the data using a backend that does not support partial books.

#define ENTITYREFERENCE   "QofEntityReference"
#define PARTIAL_QOFBOOK   "PartialQofBook"
 Flag indicating a partial QofBook.
typedef struct qof_entity_reference QofEntityReference
void qof_session_update_reference_list (QofSession *session, QofEntityReference *reference)
 Adds a new reference to the partial book data hash.
void qof_book_set_references (QofBook *book)
 Read QofEntityReference data for this book and set values.
QofEntityReferenceqof_entity_get_reference_from (QofEntity *ent, const QofParam *param)
 Get a reference from this entity to another entity.

Generated on Thu Jan 31 22:50:26 2008 for QOF by  doxygen 1.5.4