2001-11-21 19:23:07 -06:00
|
|
|
/*
|
|
|
|
* gncOrder.h -- the Core Business Order Interface
|
|
|
|
* Copyright (C) 2001 Derek Atkins
|
|
|
|
* Author: Derek Atkins <warlord@MIT.EDU>
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef GNC_ORDER_H_
|
|
|
|
#define GNC_ORDER_H_
|
|
|
|
|
|
|
|
typedef struct _gncOrder GncOrder;
|
|
|
|
|
2001-11-24 23:34:34 -06:00
|
|
|
#include "gnc-book.h"
|
2001-11-29 17:04:34 -06:00
|
|
|
#include "gncEntry.h"
|
2001-12-05 23:46:42 -06:00
|
|
|
#include "gncOwner.h"
|
2001-11-21 19:23:07 -06:00
|
|
|
|
|
|
|
#define GNC_ORDER_MODULE_NAME "gncOrder"
|
|
|
|
|
|
|
|
/* Create/Destroy Functions */
|
|
|
|
|
2001-12-05 23:46:42 -06:00
|
|
|
GncOrder *gncOrderCreate (GNCBook *book);
|
2001-11-21 19:23:07 -06:00
|
|
|
void gncOrderDestroy (GncOrder *order);
|
|
|
|
|
|
|
|
/* Set Functions */
|
|
|
|
|
|
|
|
void gncOrderSetID (GncOrder *order, const char *id);
|
2001-12-05 23:46:42 -06:00
|
|
|
void gncOrderSetOwner (GncOrder *order, GncOwner *owner);
|
2002-02-27 18:55:34 -06:00
|
|
|
void gncOrderSetDateOpened (GncOrder *order, Timespec date);
|
|
|
|
void gncOrderSetDateClosed (GncOrder *order, Timespec date);
|
2001-11-21 19:23:07 -06:00
|
|
|
void gncOrderSetNotes (GncOrder *order, const char *notes);
|
2002-02-26 22:52:33 -06:00
|
|
|
void gncOrderSetReference (GncOrder *order, const char *reference);
|
2001-11-21 19:23:07 -06:00
|
|
|
void gncOrderSetActive (GncOrder *order, gboolean active);
|
|
|
|
|
|
|
|
/* Add an Entry to the Order */
|
|
|
|
void gncOrderAddEntry (GncOrder *order, GncEntry *entry);
|
|
|
|
void gncOrderRemoveEntry (GncOrder *order, GncEntry *entry);
|
|
|
|
|
|
|
|
/* Get Functions */
|
|
|
|
|
2001-11-24 23:34:34 -06:00
|
|
|
GNCBook * gncOrderGetBook (GncOrder *order);
|
2001-11-21 19:23:07 -06:00
|
|
|
const GUID * gncOrderGetGUID (GncOrder *order);
|
|
|
|
const char * gncOrderGetID (GncOrder *order);
|
2001-12-05 23:46:42 -06:00
|
|
|
GncOwner * gncOrderGetOwner (GncOrder *order);
|
2001-11-21 19:23:07 -06:00
|
|
|
Timespec gncOrderGetDateOpened (GncOrder *order);
|
|
|
|
Timespec gncOrderGetDateClosed (GncOrder *order);
|
|
|
|
const char * gncOrderGetNotes (GncOrder *order);
|
2002-02-26 22:52:33 -06:00
|
|
|
const char * gncOrderGetReference (GncOrder *order);
|
2001-11-21 19:23:07 -06:00
|
|
|
gboolean gncOrderGetActive (GncOrder *order);
|
|
|
|
|
|
|
|
/* Get the list Entries */
|
|
|
|
GList * gncOrderGetEntries (GncOrder *order);
|
|
|
|
|
2001-11-24 23:34:34 -06:00
|
|
|
GncOrder * gncOrderLookup (GNCBook *book, const GUID *guid);
|
2001-11-21 19:23:07 -06:00
|
|
|
gboolean gncOrderIsDirty (GncOrder *order);
|
2001-11-30 01:37:50 -06:00
|
|
|
void gncOrderBeginEdit (GncOrder *order);
|
2001-11-21 19:23:07 -06:00
|
|
|
void gncOrderCommitEdit (GncOrder *order);
|
2002-02-03 14:01:08 -06:00
|
|
|
int gncOrderCompare (GncOrder *a, GncOrder *b);
|
|
|
|
|
2002-02-19 12:23:53 -06:00
|
|
|
gboolean gncOrderIsClosed (GncOrder *order);
|
|
|
|
|
2002-02-08 22:18:50 -06:00
|
|
|
#define ORDER_ID "id"
|
2002-05-13 19:52:42 -05:00
|
|
|
#define ORDER_REFERENCE "reference"
|
2002-02-03 20:53:13 -06:00
|
|
|
#define ORDER_OWNER "owner"
|
2002-02-08 22:18:50 -06:00
|
|
|
#define ORDER_OPENED "date_opened"
|
|
|
|
#define ORDER_CLOSED "date_closed"
|
2002-02-19 12:23:53 -06:00
|
|
|
#define ORDER_IS_CLOSED "is_closed?"
|
2002-02-08 22:18:50 -06:00
|
|
|
#define ORDER_NOTES "notes"
|
2001-11-21 19:23:07 -06:00
|
|
|
|
|
|
|
#endif /* GNC_ORDER_H_ */
|