gncJob.h

Go to the documentation of this file.
00001 /********************************************************************\
00002  * gncJob.h -- the Core Job Interface                               *
00003  *                                                                  *
00004  * This program is free software; you can redistribute it and/or    *
00005  * modify it under the terms of the GNU General Public License as   *
00006  * published by the Free Software Foundation; either version 2 of   *
00007  * the License, or (at your option) any later version.              *
00008  *                                                                  *
00009  * This program is distributed in the hope that it will be useful,  *
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of   *
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the    *
00012  * GNU General Public License for more details.                     *
00013  *                                                                  *
00014  * You should have received a copy of the GNU General Public License*
00015  * along with this program; if not, contact:                        *
00016  *                                                                  *
00017  * Free Software Foundation           Voice:  +1-617-542-5942       *
00018  * 51 Franklin Street, Fifth Floor    Fax:    +1-617-542-2652       *
00019  * Boston, MA  02110-1301,  USA       gnu@gnu.org                   *
00020  *                                                                  *
00021 \********************************************************************/
00031 #ifndef GNC_JOB_H_
00032 #define GNC_JOB_H_
00033 
00034 typedef struct _gncJob GncJob;
00035 typedef struct _gncJobClass GncJobClass;
00036 
00037 #include "gncAddress.h"
00038 #include "gncOwner.h"
00039 
00040 #define GNC_ID_JOB "gncJob"
00041 
00042 /* --- type macros --- */
00043 #define GNC_TYPE_JOB            (gnc_job_get_type ())
00044 #define GNC_JOB(o)              \
00045      (G_TYPE_CHECK_INSTANCE_CAST ((o), GNC_TYPE_JOB, GncJob))
00046 #define GNC_JOB_CLASS(k)        \
00047      (G_TYPE_CHECK_CLASS_CAST((k), GNC_TYPE_JOB, GncJobClass))
00048 #define GNC_IS_JOB(o)           \
00049      (G_TYPE_CHECK_INSTANCE_TYPE ((o), GNC_TYPE_JOB))
00050 #define GNC_IS_JOB_CLASS(k)     \
00051      (G_TYPE_CHECK_CLASS_TYPE ((k), GNC_TYPE_JOB))
00052 #define GNC_JOB_GET_CLASS(o)    \
00053      (G_TYPE_INSTANCE_GET_CLASS ((o), GNC_TYPE_JOB, GncJobClass))
00054 GType gnc_job_get_type(void);
00055 
00056 /* Create/Destroy Functions */
00057 
00058 GncJob *gncJobCreate (QofBook *book);
00059 void gncJobDestroy (GncJob *job);
00060 
00065 void gncJobSetID (GncJob *job, const char *id);
00066 void gncJobSetName (GncJob *job, const char *jobname);
00067 void gncJobSetReference (GncJob *job, const char *owner_reference);
00068 void gncJobSetOwner (GncJob *job, GncOwner *owner);
00069 void gncJobSetActive (GncJob *job, gboolean active);
00070 
00072 void gncJobBeginEdit (GncJob *job);
00073 void gncJobCommitEdit (GncJob *job);
00074 
00079 const char * gncJobGetID (const GncJob *job);
00080 const char * gncJobGetName (const GncJob *job);
00081 const char * gncJobGetReference (const GncJob *job);
00082 GncOwner * gncJobGetOwner (GncJob *job);
00083 
00085 gboolean gncJobGetActive (const GncJob *job);
00086 
00093 #define gncJobLookup(book,guid)    \
00094        QOF_BOOK_LOOKUP_ENTITY((book),(guid),GNC_ID_JOB, GncJob)
00095 
00096 /* Other functions */
00097 
00098 int gncJobCompare (const GncJob *a, const GncJob *b);
00099 
00100 #define JOB_ID          "id"
00101 #define JOB_NAME        "name"
00102 #define JOB_REFERENCE   "reference"
00103 #define JOB_OWNER       "owner"
00104 #define Q_JOB_OWNER "owner_collection"
00105 #define JOB_ACTIVE      "active"
00106 
00108 #define gncJobGetBook(x) qof_instance_get_book(QOF_INSTANCE(x))
00109 #define gncJobGetGUID(x) qof_instance_get_guid(QOF_INSTANCE(x))
00110 #define gncJobRetGUID(x) (x ? *(qof_instance_get_guid(QOF_INSTANCE(x))) : *(guid_null()))
00111 #define gncJobLookupDirect(G,B) gncJobLookup((B),&(G))
00112 
00113 #endif /* GNC_JOB_H_ */
00114 

Generated on Thu Aug 28 05:05:49 2008 for GnuCash by  doxygen 1.5.2