GnuCash  5.6-150-g038405b370+
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules 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 gnu@gnu.org *
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 <warlord@MIT.EDU>
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 #ifdef __cplusplus
45 extern "C" {
46 #endif
47 
48 #define GNC_ID_ORDER "gncOrder"
49 
50 /* --- type macros --- */
51 #define GNC_TYPE_ORDER (gnc_order_get_type ())
52 #define GNC_ORDER(o) \
53  (G_TYPE_CHECK_INSTANCE_CAST ((o), GNC_TYPE_ORDER, GncOrder))
54 #define GNC_ORDER_CLASS(k) \
55  (G_TYPE_CHECK_CLASS_CAST((k), GNC_TYPE_ORDER, GncOrderClass))
56 #define GNC_IS_ORDER(o) \
57  (G_TYPE_CHECK_INSTANCE_TYPE ((o), GNC_TYPE_ORDER))
58 #define GNC_IS_ORDER_CLASS(k) \
59  (G_TYPE_CHECK_CLASS_TYPE ((k), GNC_TYPE_ORDER))
60 #define GNC_ORDER_GET_CLASS(o) \
61  (G_TYPE_INSTANCE_GET_CLASS ((o), GNC_TYPE_ORDER, GncOrderClass))
62 GType gnc_order_get_type(void);
63 
64 /* Create/Destroy Functions */
65 
66 GncOrder *gncOrderCreate (QofBook *book);
67 void gncOrderDestroy (GncOrder *order);
68 
69 /* Set Functions */
70 
71 void gncOrderSetID (GncOrder *order, const char *id);
72 void gncOrderSetOwner (GncOrder *order, GncOwner *owner);
73 void gncOrderSetDateOpened (GncOrder *order, time64 date);
74 void gncOrderSetDateClosed (GncOrder *order, time64 date);
75 void gncOrderSetNotes (GncOrder *order, const char *notes);
76 void gncOrderSetReference (GncOrder *order, const char *reference);
77 void gncOrderSetActive (GncOrder *order, gboolean active);
78 
79 /* Add an Entry to the Order */
80 void gncOrderAddEntry (GncOrder *order, GncEntry *entry);
81 void gncOrderRemoveEntry (GncOrder *order, GncEntry *entry);
82 
83 /* Get Functions */
84 
85 const char * gncOrderGetID (const GncOrder *order);
86 GncOwner * gncOrderGetOwner (GncOrder *order);
87 time64 gncOrderGetDateOpened (const GncOrder *order);
88 time64 gncOrderGetDateClosed (const GncOrder *order);
89 const char * gncOrderGetNotes (const GncOrder *order);
90 const char * gncOrderGetReference (const GncOrder *order);
91 gboolean gncOrderGetActive (const GncOrder *order);
92 
93 /* Get the list Entries */
94 GList * gncOrderGetEntries (GncOrder *order);
95 
96 void gncOrderBeginEdit (GncOrder *order);
97 void gncOrderCommitEdit (GncOrder *order);
98 int gncOrderCompare (const GncOrder *a, const GncOrder *b);
99 
100 gboolean gncOrderIsClosed (const GncOrder *order);
101 
106 static inline GncOrder * gncOrderLookup (const QofBook *book, const GncGUID *guid)
107 {
108  QOF_BOOK_RETURN_ENTITY(book, guid, GNC_ID_ORDER, GncOrder);
109 }
110 
111 #define ORDER_ID "id"
112 #define ORDER_REFERENCE "reference"
113 #define ORDER_OWNER "owner"
114 #define ORDER_OPENED "date_opened"
115 #define ORDER_CLOSED "date_closed"
116 #define ORDER_IS_CLOSED "is_closed?"
117 #define ORDER_NOTES "notes"
118 
120 #define gncOrderGetGUID(x) qof_instance_get_guid(QOF_INSTANCE(x))
121 #define gncOrderGetBook(x) qof_instance_get_book(QOF_INSTANCE(x))
122 
123 #ifdef __cplusplus
124 }
125 #endif
126 
127 #endif /* GNC_ORDER_H_ */
128 
Business Interface: Object OWNERs.
#define QOF_BOOK_RETURN_ENTITY(book, guid, e_type, c_type)
Encapsulates all the information about a dataset manipulated by QOF.
Definition: qofbook.h:186
gint64 time64
Most systems that are currently maintained, including Microsoft Windows, BSD-derived Unixes and Linux...
Definition: gnc-date.h:87
Business Entry Interface.
The type used to store guids in C.
Definition: guid.h:75