|
#define | GNC_ADDRESS_MODULE_NAME "gncAddress" |
|
#define | GNC_ID_ADDRESS GNC_ADDRESS_MODULE_NAME |
|
#define | GNC_TYPE_ADDRESS (gnc_address_get_type ()) |
|
#define | GNC_ADDRESS(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GNC_TYPE_ADDRESS, GncAddress)) |
|
#define | GNC_ADDRESS_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GNC_TYPE_ADDRESS, GncAddressClass)) |
|
#define | GNC_IS_ADDRESS(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GNC_TYPE_ADDRESS)) |
|
#define | GNC_IS_ADDRESS_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GNC_TYPE_ADDRESS)) |
|
#define | GNC_ADDRESS_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GNC_TYPE_ADDRESS, GncAddressClass)) |
|
#define | ADDRESS_NAME "name" |
|
#define | ADDRESS_ONE "number" |
|
#define | ADDRESS_TWO "street" |
|
#define | ADDRESS_THREE "locality" |
|
#define | ADDRESS_FOUR "city" |
|
#define | ADDRESS_PHONE "phone" |
|
#define | ADDRESS_FAX "fax" |
|
#define | ADDRESS_EMAIL "email" |
|
#define | ADDRESS_OWNER "owner" |
|
|
void | gncAddressSetName (GncAddress *addr, const char *name) |
|
void | gncAddressSetAddr1 (GncAddress *addr, const char *addr1) |
|
void | gncAddressSetAddr2 (GncAddress *addr, const char *addr2) |
|
void | gncAddressSetAddr3 (GncAddress *addr, const char *addr3) |
|
void | gncAddressSetAddr4 (GncAddress *addr, const char *addr4) |
|
void | gncAddressSetPhone (GncAddress *addr, const char *phone) |
|
void | gncAddressSetFax (GncAddress *addr, const char *fax) |
|
void | gncAddressSetEmail (GncAddress *addr, const char *email) |
|
void | gncAddressClearDirty (GncAddress *address) |
|
|
const char * | gncAddressGetName (const GncAddress *addr) |
|
const char * | gncAddressGetAddr1 (const GncAddress *addr) |
|
const char * | gncAddressGetAddr2 (const GncAddress *addr) |
|
const char * | gncAddressGetAddr3 (const GncAddress *addr) |
|
const char * | gncAddressGetAddr4 (const GncAddress *addr) |
|
const char * | gncAddressGetPhone (const GncAddress *addr) |
|
const char * | gncAddressGetFax (const GncAddress *addr) |
|
const char * | gncAddressGetEmail (const GncAddress *addr) |
|
An address belongs to another object, determined by the GncOwner. It is the owner that assigns a name and identifier to the address. In effect, an address is just a building - to make it useful to GnuCash, it needs to be tied to a person. After all, you cannot invoice a building, you invoice a person working / living in the building.
QOF needs to handle all objects generically and to tie the address to an owner, QOF must be able to find each - as entities.
This allows QOF to follow the hierarchy of objects without having to call any application-specific routines.
To achieve this, new GncAddress routines have been added. An address is now created with a NULL parent and the parent set explicitly using the QOF object declaration. Whilst this adds functionality, it is important that a valid GncOwner entity is always set as a parent. This is an API issue - QOF will always set the parent provided that a suitable entity is passed to the qofAddressSetOwner routine. It is up to you to pass a suitable entity.
compare two addresses
- Returns
- 0 if identical, -1 if a is empty or less than b and +1 if a is more than b or if b is empty.
Definition at line 569 of file gncAddress.c.
571 if (!a && !b)
return 0;
572 if (!a && b)
return 1;
573 if (a && !b)
return -1;
575 return g_strcmp0 (a->name, b->name);
Deeply compare two addresses.
- Returns
- TRUE if all fields match, FALSE otherwise
Definition at line 579 of file gncAddress.c.
581 if (a == NULL && b == NULL)
return TRUE;
582 if (a == NULL || b == NULL)
return FALSE;
584 g_return_val_if_fail(GNC_IS_ADDRESS(a), FALSE);
585 g_return_val_if_fail(GNC_IS_ADDRESS(b), FALSE);
587 if (g_strcmp0(a->name, b->name) != 0)
589 PWARN(
"names differ: %s vs %s", a->name, b->name);
592 if (g_strcmp0(a->addr1, b->addr1) != 0)
594 PWARN(
"address lines 1 differ: %s vs %s", a->addr1, b->addr1);
597 if (g_strcmp0(a->addr2, b->addr2) != 0)
599 PWARN(
"address lines 2 differ: %s vs %s", a->addr2, b->addr1);
602 if (g_strcmp0(a->addr3, b->addr3) != 0)
604 PWARN(
"address lines 3 differ: %s vs %s", a->addr3, b->addr3);
607 if (g_strcmp0(a->addr4, b->addr4) != 0)
609 PWARN(
"address lines 4 differ: %s vs %s", a->addr4, b->addr4);
612 if (g_strcmp0(a->phone, b->phone) != 0)
614 PWARN(
"phone numbers differ: %s vs %s", a->phone, b->phone);
617 if (g_strcmp0(a->fax, b->fax) != 0)
619 PWARN(
"fax numbers differ: %s vs %s", a->fax, b->fax);
622 if (g_strcmp0(a->email, b->email) != 0)
624 PWARN(
"email addresses differ: %s vs %s", a->email, b->email);
#define PWARN(format, args...)