GnuCash  2.6.99
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
gncOrder.h
1 /********************************************************************\
2  * gncOrder.h -- the Core Business Order Interface *
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 [email protected] *
20  * *
21 \********************************************************************/
22 /* NOTE: Removed from doxygen by warlord on 2004-05-07 because
23  * this module is not fully implemented at this time.
24  */
25 /* @addtogroup Business
26  @{ */
27 /* @addtogroup Order
28  @{ */
29 /* @file gncOrder.h
30  @brief Business Order Interface
31  @author Copyright (C) 2001 Derek Atkins <[email protected]>
32 */
33 
34 #ifndef GNC_ORDER_H_
35 #define GNC_ORDER_H_
36 
37 typedef struct _gncOrder GncOrder;
38 typedef struct _gncOrderClass GncOrderClass;
39 
40 #include "gncEntry.h"
41 #include "gncOwner.h"
42 #include "qof.h"
43 
44 #define GNC_ID_ORDER "gncOrder"
45 
46 /* --- type macros --- */
47 #define GNC_TYPE_ORDER (gnc_order_get_type ())
48 #define GNC_ORDER(o) \
49  (G_TYPE_CHECK_INSTANCE_CAST ((o), GNC_TYPE_ORDER, GncOrder))
50 #define GNC_ORDER_CLASS(k) \
51  (G_TYPE_CHECK_CLASS_CAST((k), GNC_TYPE_ORDER, GncOrderClass))
52 #define GNC_IS_ORDER(o) \
53  (G_TYPE_CHECK_INSTANCE_TYPE ((o), GNC_TYPE_ORDER))
54 #define GNC_IS_ORDER_CLASS(k) \
55  (G_TYPE_CHECK_CLASS_TYPE ((k), GNC_TYPE_ORDER))
56 #define GNC_ORDER_GET_CLASS(o) \
57  (G_TYPE_INSTANCE_GET_CLASS ((o), GNC_TYPE_ORDER, GncOrderClass))
58 GType gnc_order_get_type(void);
59 
60 /* Create/Destroy Functions */
61 
62 GncOrder *gncOrderCreate (QofBook *book);
63 void gncOrderDestroy (GncOrder *order);
64 
65 /* Set Functions */
66 
67 void gncOrderSetID (GncOrder *order, const char *id);
68 void gncOrderSetOwner (GncOrder *order, GncOwner *owner);
69 void gncOrderSetDateOpened (GncOrder *order, Timespec date);
70 void gncOrderSetDateClosed (GncOrder *order, Timespec date);
71 void gncOrderSetNotes (GncOrder *order, const char *notes);
72 void gncOrderSetReference (GncOrder *order, const char *reference);
73 void gncOrderSetActive (GncOrder *order, gboolean active);
74 
75 /* Add an Entry to the Order */
76 void gncOrderAddEntry (GncOrder *order, GncEntry *entry);
77 void gncOrderRemoveEntry (GncOrder *order, GncEntry *entry);
78 
79 /* Get Functions */
80 
81 const char * gncOrderGetID (const GncOrder *order);
82 GncOwner * gncOrderGetOwner (GncOrder *order);
83 Timespec gncOrderGetDateOpened (const GncOrder *order);
84 Timespec gncOrderGetDateClosed (const GncOrder *order);
85 const char * gncOrderGetNotes (const GncOrder *order);
86 const char * gncOrderGetReference (const GncOrder *order);
87 gboolean gncOrderGetActive (const GncOrder *order);
88 
89 /* Get the list Entries */
90 GList * gncOrderGetEntries (GncOrder *order);
91 
92 void gncOrderBeginEdit (GncOrder *order);
93 void gncOrderCommitEdit (GncOrder *order);
94 int gncOrderCompare (const GncOrder *a, const GncOrder *b);
95 
96 gboolean gncOrderIsClosed (const GncOrder *order);
97 
104 static inline GncOrder * gncOrderLookup (const QofBook *book, const GncGUID *guid)
105 {
106  QOF_BOOK_RETURN_ENTITY(book, guid, GNC_ID_ORDER, GncOrder);
107 }
108 
109 #define ORDER_ID "id"
110 #define ORDER_REFERENCE "reference"
111 #define ORDER_OWNER "owner"
112 #define ORDER_OPENED "date_opened"
113 #define ORDER_CLOSED "date_closed"
114 #define ORDER_IS_CLOSED "is_closed?"
115 #define ORDER_NOTES "notes"
116 
118 #define gncOrderGetGUID(x) qof_instance_get_guid(QOF_INSTANCE(x))
119 #define gncOrderGetBook(x) qof_instance_get_book(QOF_INSTANCE(x))
120 
121 #endif /* GNC_ORDER_H_ */
122 
Business Interface: Object OWNERs.
Use a 64-bit unsigned int timespec.
Definition: gnc-date.h:299
#define QOF_BOOK_RETURN_ENTITY(book, guid, e_type, c_type)
Encapsulates all the information about a dataset manipulated by QOF. This is the top-most structure u...
Definition: qofbook.h:164
Definition: guid.h:65
Business Entry Interface.