Create Item
[API's]


Functions

alp_status_t alp_contacts_dml_item_create (AlpContactsDmlItemType itemType, AlpDmlItemH *itemH)
 Creates an item.
alp_status_t alp_contacts_dml_item_create_with_custom_fields (AlpDmlH dmlH, AlpContactsDmlItemType itemType, AlpDmlItemH *itemH)
 Creates an item that allows any custom fields that were added to the default database to be set.
alp_status_t alp_contacts_dml_item_destroy (AlpDmlItemH itemH)
 Destroys an item.
alp_status_t alp_contacts_dml_item_set_blob (AlpDmlItemH itemH, AlpContactsDmlColumnType column, const void *value, int32_t size)
 Sets a blob for a given itemH.
alp_status_t alp_contacts_dml_item_set_int32 (AlpDmlItemH itemH, AlpContactsDmlColumnType column, const int32_t *value)
 Sets an int32_t value in an item.
alp_status_t alp_contacts_dml_item_set_string (AlpDmlItemH itemH, AlpContactsDmlColumnType column, const char *value)
 Sets a string value in an item.


Function Documentation

alp_status_t alp_contacts_dml_item_create AlpContactsDmlItemType  itemType,
AlpDmlItemH itemH
 

Creates an item.

Parameters:
[out] itemH address of AlpDmlItemH to be created
[in] itemType AlpContactsDmlItemType to be created
Returns:
ALP_STATUS_OK or ALP_STATUS_CONTACTS_DML_BAD_PARAM if a parameter is NULL or the identifier does not represent a valid item type

alp_status_t alp_contacts_dml_item_create_with_custom_fields AlpDmlH  dmlH,
AlpContactsDmlItemType  itemType,
AlpDmlItemH itemH
 

Creates an item that allows any custom fields that were added to the default database to be set.

If the database doesn't contain any custom fields it will work the same way as alp_contacts_dml_item_create.

Parameters:
[out] itemH address of AlpDmlItemH to be created
[in] dmlH Handle to the contacts data model handle with custom fields.
[in] itemType AlpContactsDmlItemType to be created
Returns:
ALP_STATUS_OK or ALP_STATUS_CONTACTS_DML_BAD_PARAM if a parameter is NULL or the identifier does not represent a valid item type

alp_status_t alp_contacts_dml_item_destroy AlpDmlItemH  itemH  ) 
 

Destroys an item.

Note that the item must be created with alp_contacts_dml_item_create with a valid AlpContactsDmlItemType so that this routine will know how to destroy it.

Parameters:
[in] itemH Item structure to be freed
Returns:
ALP_STATUS_OK or ALP_STATUS_CONTACTS_DML_BAD_PARAM if a parameter is NULL or the identifier does not represent a string value in the item structure.

alp_status_t alp_contacts_dml_item_set_blob AlpDmlItemH  itemH,
AlpContactsDmlColumnType  column,
const void *  value,
int32_t  size
 

Sets a blob for a given itemH.

The data parameter is copied into the item's structure, so the application does not need to maintain the memory after the function call. The copy is freed by alp_contacts_dml_item_destroy()

Passing NULL for value is different than passing an empty string. If you pass a NULL value, any existing blob set is freed. NULL blobs generally takes less storage in the database.

If you try to set a blob for a field that has already been set, the previous field value will be freed.

The field will be marked "dirty" for saving on call to alp_contacts_dml_insert or alp_contacts_dml_update.

Note that the columns accepted by the item depends on the AlpContactsDmlItemType used when you called alp_contacts_dml_item_create

If the ThumbnailData property is set on a ThumbnailItem, this API will use a GdkPixbufLoader to convert the input data into a normalized form for storage. Any input data supported by the GdkPixbufLoader can be used, such as JPG, GIF, TIF, etc. The routine will normalize the input data into two forms that can only be read from (but not written to) a ThumbnailItem: ThumbnailSmall: Is a read-only property that provides a small GdkPixbuf of the given image. Default dimension is 32x32 ThumbnailLarge: Is a read-only property that provides a larger JPG of the given image. Default dimension is 128x128 The dimensions of the small and large thumbnails can be overriden by licensees by defining certain global settings (TBD). Note that if the ThumbnailData property is set, the application should not also set the ThumbnailFileName property. These two write-only properties are mutually exclusive and setting one will free and rewrite any normalized data that was preivously stored in the ThumnbailItem.

Parameters:
[in] itemH Item structure to written to
[in] column See AlpContactsDmlColumnType for a list of blob column values that can be stored for each type of item.
[in] value Data to copy into item
[in] size Size of data parameter in bytes
Returns:
ALP_STATUS_OK or ALP_STATUS_CONTACTS_DML_BAD_PARAM if a parameter is NULL or the identifier does not represent a blob value in the item structure.

alp_status_t alp_contacts_dml_item_set_int32 AlpDmlItemH  itemH,
AlpContactsDmlColumnType  column,
const int32_t *  value
 

Sets an int32_t value in an item.

Passing NULL for value will flag that value as being unset, so that the database will store a NULL value for the integer (instead of say, 0).

The field will be marked "dirty" for saving on call to alp_contacts_dml_insert or alp_contacts_dml_update.

Note that the columns accepted by the item depends on the AlpContactsDmlItemType used when you called alp_contacts_dml_item_create

Parameters:
[in] itemH Item structure to written to
[in] column See AlpContactsDmlColumnType for a list of integer column values that can be stored for each type of item.
[in] value Pointer to integer value to set, or NULL to unset the value
Returns:
ALP_STATUS_OK or ALP_STATUS_CONTACTS_DML_BAD_PARAM if a parameter is NULL or the identifier does not represent a string value in the item structure.

alp_status_t alp_contacts_dml_item_set_string AlpDmlItemH  itemH,
AlpContactsDmlColumnType  column,
const char *  value
 

Sets a string value in an item.

The value parameter is NOT copied into the item's structure, so the application does need to maintain the memory after the function call.

Passing NULL for value is different than passing an empty string.

The field will be marked "dirty" for saving on call to alp_contacts_dml_insert or alp_contacts_dml_update.

Note that the columns accepted by the item depends on the AlpContactsDmlItemType used when you called alp_contacts_dml_item_create

If the ThumbnailFileName property is set on a ThumbnailItem, this API will treat the file given as an image and attempt to load it using gdk_pixbuf_new_from_file_at_size() which will use a GdkPixbufLoader to convert the input data into a normalized form for storage. Any input data supported by the GdkPixbufLoader can be used, such as JPG, GIF, TIF, etc. The routine will normalize the input data into two forms that can only be read from (but not written to) a ThumbnailItem: ThumbnailSmall: Is a read-only property that provides a small GdkPixbuf of the given image. Default dimension is 32x32 ThumbnailLarge: Is a read-only property that provides a larger JPG of the given image. Default dimension is 128x128 The dimensions of the small and large thumbnails can be overriden by licensees by defining certain global settings (TBD). Note that if the ThumbnailFileName property is set, the application should not also set the ThumbnailData property. These two write-only properties are mutually exclusive and setting one will free and rewrite any normalized data that was preivously stored in the ThumnbailItem.

Parameters:
[in] itemH Item structure to written to
[in] column See AlpContactsDmlColumnType for a list of string column values that can be stored for each type of item.
[in] value string to copy into item
Returns:
ALP_STATUS_OK or ALP_STATUS_CONTACTS_DML_BAD_PARAM if a parameter is NULL or the identifier does not represent a string value in the item structure.


Generated on Wed Jul 30 07:06:42 2008 by Doxygen 1.4.6 for ALP SDK + Hiker Documentation

Copyright © 1999-2008 ACCESS CO., LTD. All rights reserved.