Addresses and Contacts
[Query Object Framework]


Data Structures

struct  QofAddress
 Example of QOF wrapping an existing object. More...

Files

file  qof-address.c
 QOF address definitions for pilot-link.
file  qof-address.h
 QOF address definitions for pilot-link.

Defines

#define QOF_ADDRESS_DESC   "Pilot-link QOF address"
#define ADDRESS_VERSION   address_v1
#define PQ_MOD_ADDRESS   "pilotqof-address"
#define PILOT_LINK_QOF_ADDRESS   "pilot_address"
#define ADDR_LAST_NAME   "entryLastname"
#define ADDR_FIRST_NAME   "entryFirstname"
#define ADDR_COMPANY   "entryCompany"
#define ADDR_PHONE_ONE   "entryPhone1"
#define ADDR_PHONE_TWO   "entryPhone2"
#define ADDR_PHONE_THREE   "entryPhone3"
#define ADDR_PHONE_FOUR   "entryPhone4"
#define ADDR_PHONE_FIVE   "entryPhone5"
#define ADDR_ADDRESS   "entryAddress"
#define ADDR_CITY   "entryCity"
#define ADDR_STATE   "entryState"
#define ADDR_ZIP   "entryZip"
#define ADDR_COUNTRY   "entryCountry"
#define ADDR_TITLE   "entryTitle"
#define ADDR_CUSTOM_ONE   "entryCustom1"
#define ADDR_CUSTOM_TWO   "entryCustom2"
#define ADDR_CUSTOM_THREE   "entryCustom3"
#define ADDR_CUSTOM_FOUR   "entryCustom4"
#define ADDR_NOTE   "entryNote"
#define ADDR_CATEGORY   "category"

Functions

static QofAddressaddress_create (QofBook *book)
 create a new address
Address_t * address_get_pilot (QofInstance *inst)
static gchar * addr_getLastname (QofAddress *a)
static gchar * addr_getFirstname (QofAddress *a)
static gchar * addr_getCompany (QofAddress *a)
static gchar * addr_getPhoneOne (QofAddress *a)
static gchar * addr_getPhoneTwo (QofAddress *a)
static gchar * addr_getPhoneThree (QofAddress *a)
static gchar * addr_getPhoneFour (QofAddress *a)
static gchar * addr_getPhoneFive (QofAddress *a)
static gchar * addr_getCity (QofAddress *a)
static gchar * addr_getState (QofAddress *a)
static gchar * addr_getZip (QofAddress *a)
static gchar * addr_getCountry (QofAddress *a)
static gchar * addr_getTitle (QofAddress *a)
static gchar * addr_getAddress (QofAddress *a)
static gchar * addr_getCustomOne (QofAddress *a)
static gchar * addr_getCustomTwo (QofAddress *a)
static gchar * addr_getCustomThree (QofAddress *a)
static gchar * addr_getCustomFour (QofAddress *a)
static gchar * addr_getNote (QofAddress *a)
static gchar * addr_getCategory (QofAddress *a)
static void addr_setLastname (QofAddress *a, gchar *h)
static void addr_setFirstname (QofAddress *a, gchar *h)
static void addr_setCompany (QofAddress *a, gchar *h)
static void addr_setPhoneOne (QofAddress *a, gchar *h)
static void addr_setPhoneTwo (QofAddress *a, gchar *h)
static void addr_setPhoneThree (QofAddress *a, gchar *h)
static void addr_setPhoneFour (QofAddress *a, gchar *h)
static void addr_setPhoneFive (QofAddress *a, gchar *h)
static void addr_setAddress (QofAddress *a, gchar *h)
static void addr_setCity (QofAddress *a, gchar *h)
static void addr_setState (QofAddress *a, gchar *h)
static void addr_setZip (QofAddress *a, gchar *h)
static void addr_setCountry (QofAddress *a, gchar *h)
static void addr_setTitle (QofAddress *a, gchar *h)
static void addr_setCustomOne (QofAddress *a, gchar *h)
static void addr_setCustomTwo (QofAddress *a, gchar *h)
static void addr_setCustomThree (QofAddress *a, gchar *h)
static void addr_setCustomFour (QofAddress *a, gchar *h)
static void addr_setNote (QofAddress *a, gchar *h)
static void addr_setCategory (QofAddress *a, gchar *h)
static const gchar * addressPrintable (gpointer instance)
gboolean AddressRegister (void)
 Extended for pilot-link.

Variables

static G_GNUC_UNUSED QofLogModule log_module = "pilotqof-objects"
static QofObject address_object_def

Detailed Description

Addresses is probably the easiest QOF object to understand - all the entries are simple strings. QOF does provide a cache that could be used here but until pilot-qof has an interactive shell, creating and then populating the cache is considered not worthwhile.

Define Documentation

#define ADDR_LAST_NAME   "entryLastname"

Hack alert: Because these are strings (for QOF), the macros CANNOT be used directly in the enum!

Definition at line 46 of file qof-address.h.

Referenced by AddressRegister().


Function Documentation

static QofAddress* address_create ( QofBook *  book  )  [static]

create a new address

Hack alert: This routine specifically sets a blank value in entry[18] - using g_new0() externally is not the same.

Definition at line 61 of file qof-address.c.

00062 {
00063     Address_t *qa;
00064     QofAddress *obj;
00065     QofCollection *coll;
00066     GList *all;
00067 
00068     obj = g_new0 (QofAddress, 1);
00069     qof_instance_init (&obj->inst, PILOT_LINK_QOF_ADDRESS, book);
00070     coll = qof_book_get_collection (book, PILOT_LINK_QOF_ADDRESS);
00071     all = qof_collection_get_data (coll);
00072     all = g_list_prepend (all, obj);
00073     qof_collection_set_data (coll, all);
00074     qa = &obj->wrap;
00075     qa->entry[18] = strdup ("");
00076     return obj;
00077 }

gboolean AddressRegister ( void   ) 

Extended for pilot-link.

Uses the standard QOF registration but adds a pilot_pack registration that tells QOF how to deal with the pilot-link objects contained within the QOF objects.

Definition at line 542 of file qof-address.c.

References ADDR_LAST_NAME.

Referenced by pilot_qof_init().

00543 {
00544     static QofParam params[] = {
00545         {ADDR_LAST_NAME, QOF_TYPE_STRING, (QofAccessFunc) addr_getLastname,
00546                 (QofSetterFunc) addr_setLastname},
00547         {ADDR_FIRST_NAME, QOF_TYPE_STRING,
00548                 (QofAccessFunc) addr_getFirstname,
00549                 (QofSetterFunc) addr_setFirstname},
00550         {ADDR_COMPANY, QOF_TYPE_STRING, (QofAccessFunc) addr_getCompany,
00551                 (QofSetterFunc) addr_setCompany},
00552         {ADDR_PHONE_ONE, QOF_TYPE_STRING, (QofAccessFunc) addr_getPhoneOne,
00553                 (QofSetterFunc) addr_setPhoneOne},
00554         {ADDR_PHONE_TWO, QOF_TYPE_STRING, (QofAccessFunc) addr_getPhoneTwo,
00555                 (QofSetterFunc) addr_setPhoneTwo},
00556         {ADDR_PHONE_THREE, QOF_TYPE_STRING,
00557                 (QofAccessFunc) addr_getPhoneThree,
00558                 (QofSetterFunc) addr_setPhoneThree},
00559         {ADDR_PHONE_FOUR, QOF_TYPE_STRING,
00560                 (QofAccessFunc) addr_getPhoneFour,
00561                 (QofSetterFunc) addr_setPhoneFour},
00562         {ADDR_PHONE_FIVE, QOF_TYPE_STRING,
00563                 (QofAccessFunc) addr_getPhoneFive,
00564                 (QofSetterFunc) addr_setPhoneFive},
00565         {ADDR_ADDRESS, QOF_TYPE_STRING, (QofAccessFunc) addr_getAddress,
00566                 (QofSetterFunc) addr_setAddress},
00567         {ADDR_CITY, QOF_TYPE_STRING, (QofAccessFunc) addr_getCity,
00568                 (QofSetterFunc) addr_setCity},
00569         {ADDR_STATE, QOF_TYPE_STRING, (QofAccessFunc) addr_getState,
00570                 (QofSetterFunc) addr_setState},
00571         {ADDR_ZIP, QOF_TYPE_STRING, (QofAccessFunc) addr_getZip,
00572                 (QofSetterFunc) addr_setZip},
00573         {ADDR_COUNTRY, QOF_TYPE_STRING, (QofAccessFunc) addr_getCountry,
00574                 (QofSetterFunc) addr_setCountry},
00575         {ADDR_TITLE, QOF_TYPE_STRING, (QofAccessFunc) addr_getTitle,
00576                 (QofSetterFunc) addr_setTitle},
00577         {ADDR_CUSTOM_ONE, QOF_TYPE_STRING,
00578                 (QofAccessFunc) addr_getCustomOne,
00579                 (QofSetterFunc) addr_setCustomOne},
00580         {ADDR_CUSTOM_TWO, QOF_TYPE_STRING,
00581                 (QofAccessFunc) addr_getCustomTwo,
00582                 (QofSetterFunc) addr_setCustomTwo},
00583         {ADDR_CUSTOM_THREE, QOF_TYPE_STRING,
00584                 (QofAccessFunc) addr_getCustomThree,
00585                 (QofSetterFunc) addr_setCustomThree},
00586         {ADDR_CUSTOM_FOUR, QOF_TYPE_STRING,
00587                 (QofAccessFunc) addr_getCustomFour,
00588                 (QofSetterFunc) addr_setCustomFour},
00589         {ADDR_NOTE, QOF_TYPE_STRING, (QofAccessFunc) addr_getNote,
00590                 (QofSetterFunc) addr_setNote},
00591         {ADDR_CATEGORY, QOF_TYPE_STRING, (QofAccessFunc) addr_getCategory,
00592                 (QofSetterFunc) addr_setCategory},
00593         {QOF_PARAM_BOOK, QOF_ID_BOOK,
00594                 (QofAccessFunc) qof_instance_get_book, NULL},
00595         {QOF_PARAM_GUID, QOF_TYPE_GUID,
00596                 (QofAccessFunc) qof_instance_get_guid, NULL},
00597         {NULL},
00598     };
00599 
00600     qof_class_register (PILOT_LINK_QOF_ADDRESS, NULL, params);
00601 
00602 //  pilot_qof_pack_register (&address_pack_def);
00603 
00604     return qof_object_register (&address_object_def);
00605 }


Variable Documentation

QofObject address_object_def [static]

Initial value:

 {
  interface_version: 4 ,
  e_type: "pilot_address" ,
  type_label: "Pilot-link QOF address" ,
  create:(gpointer) address_create,
  book_begin:NULL,
  book_end:NULL,
  is_dirty:qof_collection_is_dirty,
  mark_clean:qof_collection_mark_clean,
  foreach:qof_collection_foreach,
  printable:addressPrintable,
  version_cmp:(gint (*)(gpointer, gpointer)) qof_instance_version_cmp,
}

Definition at line 527 of file qof-address.c.


Generated on Wed Aug 26 20:57:06 2009 for pilot-qof by  doxygen 1.5.9