GnuCash c935c2f+
Loading...
Searching...
No Matches
gncJob.h
Go to the documentation of this file.
1/********************************************************************\
2 * gncJob.h -- the Core Job 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\********************************************************************/
31#ifndef GNC_JOB_H_
32#define GNC_JOB_H_
33
34typedef struct _gncJob GncJob;
35typedef struct _gncJobClass GncJobClass;
36
37#include "gncAddress.h"
38#include "gncOwner.h"
39
40#ifdef __cplusplus
41extern "C" {
42#endif
43
44#define GNC_ID_JOB "gncJob"
45
46/* --- type macros --- */
47#define GNC_TYPE_JOB (gnc_job_get_type ())
48#define GNC_JOB(o) \
49 (G_TYPE_CHECK_INSTANCE_CAST ((o), GNC_TYPE_JOB, GncJob))
50#define GNC_JOB_CLASS(k) \
51 (G_TYPE_CHECK_CLASS_CAST((k), GNC_TYPE_JOB, GncJobClass))
52#define GNC_IS_JOB(o) \
53 (G_TYPE_CHECK_INSTANCE_TYPE ((o), GNC_TYPE_JOB))
54#define GNC_IS_JOB_CLASS(k) \
55 (G_TYPE_CHECK_CLASS_TYPE ((k), GNC_TYPE_JOB))
56#define GNC_JOB_GET_CLASS(o) \
57 (G_TYPE_INSTANCE_GET_CLASS ((o), GNC_TYPE_JOB, GncJobClass))
58GType gnc_job_get_type(void);
59
60/* Create/Destroy Functions */
61
62GncJob *gncJobCreate (QofBook *book);
63void gncJobDestroy (GncJob *job);
64void gncJobFreeList (GList *jobs);
65
70void gncJobSetID (GncJob *job, const char *id);
71void gncJobSetName (GncJob *job, const char *jobname);
72void gncJobSetReference (GncJob *job, const char *owner_reference);
73void gncJobSetRate (GncJob *job, gnc_numeric rate);
74void gncJobSetOwner (GncJob *job, GncOwner *owner);
75void gncJobSetActive (GncJob *job, gboolean active);
76
78void gncJobBeginEdit (GncJob *job);
79void gncJobCommitEdit (GncJob *job);
80
85const char * gncJobGetID (const GncJob *job);
86const char * gncJobGetName (const GncJob *job);
87const char * gncJobGetReference (const GncJob *job);
88gnc_numeric gncJobGetRate (const GncJob *job);
89GncOwner * gncJobGetOwner (GncJob *job);
90gboolean gncJobGetActive (const GncJob *job);
91
98static inline GncJob * gncJobLookup (const QofBook *book, const GncGUID *guid)
99{
100 QOF_BOOK_RETURN_ENTITY(book, guid, GNC_ID_JOB, GncJob);
101}
102
103/* Other functions */
104
105int gncJobCompare (const GncJob *a, const GncJob *b);
106gboolean gncJobEqual(const GncJob *a, const GncJob *b);
107
108#define JOB_ID "id"
109#define JOB_NAME "name"
110#define JOB_REFERENCE "reference"
111#define JOB_RATE "rate"
112#define JOB_OWNER "owner"
113#define Q_JOB_OWNER "owner_collection"
114#define JOB_ACTIVE "active"
115
117#define gncJobGetBook(x) qof_instance_get_book(QOF_INSTANCE(x))
118#define gncJobGetGUID(x) qof_instance_get_guid(QOF_INSTANCE(x))
119#define gncJobRetGUID(x) (x ? *(qof_instance_get_guid(QOF_INSTANCE(x))) : *(guid_null()))
120#define gncJobLookupDirect(G,B) gncJobLookup((B),&(G))
121
122#ifdef __cplusplus
123}
124#endif
125
126#endif /* GNC_JOB_H_ */
an Address object
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:101
The type used to store guids in C.
Definition guid.h:75
QofBook reference.
Definition qofbook-p.hpp:47