GnuCash 2.4.99
gncAddress.h
Go to the documentation of this file.
00001 /********************************************************************\
00002  * gncAddress.h -- an Address object                                *
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 \********************************************************************/
00054 #ifndef GNC_ADDRESS_H_
00055 #define GNC_ADDRESS_H_
00056 
00057 #include "qof.h"
00058 #ifdef GNUCASH_MAJOR_VERSION
00059 #include "gncBusiness.h"
00060 #endif
00061 
00062 #define GNC_ADDRESS_MODULE_NAME        "gncAddress"
00063 #define GNC_ID_ADDRESS GNC_ADDRESS_MODULE_NAME
00064 
00079 typedef struct _gncAddress GncAddress;
00080 typedef struct _gncAddressClass GncAddressClass;
00081 
00082 /* --- type macros --- */
00083 #define GNC_TYPE_ADDRESS            (gnc_address_get_type ())
00084 #define GNC_ADDRESS(o)              \
00085      (G_TYPE_CHECK_INSTANCE_CAST ((o), GNC_TYPE_ADDRESS, GncAddress))
00086 #define GNC_ADDRESS_CLASS(k)        \
00087      (G_TYPE_CHECK_CLASS_CAST((k), GNC_TYPE_ADDRESS, GncAddressClass))
00088 #define GNC_IS_ADDRESS(o)           \
00089      (G_TYPE_CHECK_INSTANCE_TYPE ((o), GNC_TYPE_ADDRESS))
00090 #define GNC_IS_ADDRESS_CLASS(k)     \
00091      (G_TYPE_CHECK_CLASS_TYPE ((k), GNC_TYPE_ADDRESS))
00092 #define GNC_ADDRESS_GET_CLASS(o)    \
00093      (G_TYPE_INSTANCE_GET_CLASS ((o), GNC_TYPE_ADDRESS, GncAddressClass))
00094 GType gnc_address_get_type(void);
00095 
00098 GncAddress *gncAddressCreate (QofBook *book, QofInstance *parent);
00099 void gncAddressDestroy (GncAddress *addr);
00100 void gncAddressBeginEdit (GncAddress *addr);
00101 void gncAddressCommitEdit (GncAddress *addr);
00102 
00108 void gncAddressSetName (GncAddress *addr, const char *name);
00109 void gncAddressSetAddr1 (GncAddress *addr, const char *addr1);
00110 void gncAddressSetAddr2 (GncAddress *addr, const char *addr2);
00111 void gncAddressSetAddr3 (GncAddress *addr, const char *addr3);
00112 void gncAddressSetAddr4 (GncAddress *addr, const char *addr4);
00113 void gncAddressSetPhone (GncAddress *addr, const char *phone);
00114 void gncAddressSetFax (GncAddress *addr, const char *fax);
00115 void gncAddressSetEmail (GncAddress *addr, const char *email);
00116 void gncAddressClearDirty (GncAddress *address);
00122 const char * gncAddressGetName (const GncAddress *addr);
00123 const char * gncAddressGetAddr1 (const GncAddress *addr);
00124 const char * gncAddressGetAddr2 (const GncAddress *addr);
00125 const char * gncAddressGetAddr3 (const GncAddress *addr);
00126 const char * gncAddressGetAddr4 (const GncAddress *addr);
00127 const char * gncAddressGetPhone (const GncAddress *addr);
00128 const char * gncAddressGetFax (const GncAddress *addr);
00129 const char * gncAddressGetEmail (const GncAddress *addr);
00132 gboolean gncAddressIsDirty (const GncAddress *addr);
00133 
00139 int gncAddressCompare (const GncAddress *a, const GncAddress *b);
00140 
00145 gboolean gncAddressEqual(const GncAddress *a, const GncAddress *b);
00146 
00147 #define ADDRESS_NAME    "name"
00148 #define ADDRESS_ONE             "number"
00149 #define ADDRESS_TWO             "street"
00150 #define ADDRESS_THREE   "locality"
00151 #define ADDRESS_FOUR    "city"
00152 #define ADDRESS_PHONE   "phone"
00153 #define ADDRESS_FAX     "fax"
00154 #define ADDRESS_EMAIL   "email"
00155 #define ADDRESS_OWNER   "owner"
00156 
00157 #endif /* GNC_ADDRESS_H_ */
00158 
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines