OssoABookContactField

OssoABookContactField — Rich representation of supported contact fields.

Synopsis

#define             OSSO_ABOOK_CONTACT_FIELD_GROUP_STEP
#define             OSSO_ABOOK_CONTACT_FIELD_GROUP_DIFF (weight1, weight2)
gboolean            (*OssoABookContactFieldPredicate)   (OssoABookContactField *field,
                                                         gpointer user_data);
enum                OssoABookContactFieldFlags;
enum                OssoABookContactFieldActionLayoutFlags;
                    OssoABookContactField;
OssoABookContactField* osso_abook_contact_field_new_full
                                                        (GHashTable *message_map,
                                                         OssoABookContact *master_contact,
                                                         OssoABookContact *roster_contact,
                                                         EVCardAttribute *attribute);
OssoABookContactField* osso_abook_contact_field_new     (GHashTable *message_map,
                                                         OssoABookContact *master_contact,
                                                         EVCardAttribute *attribute);
GHashTable*         osso_abook_contact_field_get_message_map
                                                        (OssoABookContactField *field);
void                osso_abook_contact_field_set_message_map
                                                        (OssoABookContactField *field,
                                                         GHashTable *mapping);
const char*         osso_abook_contact_field_get_name   (OssoABookContactField *field);
const char*         osso_abook_contact_field_get_path   (OssoABookContactField *field);
OssoABookContactFieldFlags osso_abook_contact_field_get_flags
                                                        (OssoABookContactField *field);
OssoABookContactField* osso_abook_contact_field_get_parent
                                                        (OssoABookContactField *field);
GList*              osso_abook_contact_field_get_children
                                                        (OssoABookContactField *field);
gboolean            osso_abook_contact_field_has_children
                                                        (OssoABookContactField *field);
EVCardAttribute*    osso_abook_contact_field_get_attribute
                                                        (OssoABookContactField *field);
EVCardAttribute*    osso_abook_contact_field_get_borrowed_attribute
                                                        (OssoABookContactField *field);
GList*              osso_abook_contact_field_get_secondary_attributes
                                                        (OssoABookContactField *field);
const char*         osso_abook_contact_field_get_display_title
                                                        (OssoABookContactField *field);
const char*         osso_abook_contact_field_get_secondary_title
                                                        (OssoABookContactField *field);
const char*         osso_abook_contact_field_get_display_value
                                                        (OssoABookContactField *field);
const char*         osso_abook_contact_field_get_icon_name
                                                        (OssoABookContactField *field);
int                 osso_abook_contact_field_get_sort_weight
                                                        (OssoABookContactField *field);
OssoABookContact*   osso_abook_contact_field_get_master_contact
                                                        (OssoABookContactField *field);
OssoABookContact*   osso_abook_contact_field_get_roster_contact
                                                        (OssoABookContactField *field);
McAccount*          osso_abook_contact_field_get_account
                                                        (OssoABookContactField *field);
GList*              osso_abook_contact_field_get_actions_full
                                                        (OssoABookContactField *field,
                                                         gboolean button);
GList*              osso_abook_contact_field_get_actions
                                                        (OssoABookContactField *field);
McAccount*          osso_abook_contact_field_action_request_account
                                                        (OssoABookContactFieldAction *action,
                                                         GtkWindow *parent,
                                                         gboolean *aborted);
gboolean            osso_abook_contact_field_action_start
                                                        (OssoABookContactFieldAction *action,
                                                         GtkWindow *parent);
gboolean            osso_abook_contact_field_action_start_with_callback
                                                        (OssoABookContactFieldAction *action,
                                                         GtkWindow *parent,
                                                         OssoABookContactActionStartCb callback,
                                                         gpointer callback_data);
OssoABookContactFieldAction* osso_abook_contact_field_action_ref
                                                        (OssoABookContactFieldAction *action);
void                osso_abook_contact_field_action_unref
                                                        (OssoABookContactFieldAction *action);
OssoABookContactAction osso_abook_contact_field_action_get_action
                                                        (OssoABookContactFieldAction *action);
OssoABookContactField* osso_abook_contact_field_action_get_field
                                                        (OssoABookContactFieldAction *action);
GtkWidget*          osso_abook_contact_field_action_get_widget
                                                        (OssoABookContactFieldAction *action);
McProfile*          osso_abook_contact_field_action_get_profile
                                                        (OssoABookContactFieldAction *action);
OssoABookContactFieldActionLayoutFlags osso_abook_contact_field_action_get_layout_flags
                                                        (OssoABookContactFieldAction *action);
gboolean            osso_abook_contact_field_action_is_basic
                                                        (OssoABookContactFieldAction *action);
GtkWidget*          osso_abook_contact_field_create_button
                                                        (OssoABookContactField *field,
                                                         const char *title,
                                                         const char *icon_name);
GtkWidget*          osso_abook_contact_field_get_label_widget
                                                        (OssoABookContactField *field);
GtkWidget*          osso_abook_contact_field_get_editor_widget
                                                        (OssoABookContactField *field);
gboolean            osso_abook_contact_field_has_editor_widget
                                                        (OssoABookContactField *field);
gboolean            osso_abook_contact_field_is_readonly
                                                        (OssoABookContactField *field);
gboolean            osso_abook_contact_field_is_bound_im
                                                        (OssoABookContactField *field);
gboolean            osso_abook_contact_field_is_modified
                                                        (OssoABookContactField *field);
gboolean            osso_abook_contact_field_is_empty   (OssoABookContactField *field);
gboolean            osso_abook_contact_field_is_mandatory
                                                        (OssoABookContactField *field);
void                osso_abook_contact_field_set_mandatory
                                                        (OssoABookContactField *field,
                                                         gboolean mandatory);
gboolean            osso_abook_contact_field_activate   (OssoABookContactField *field);
int                 osso_abook_contact_field_cmp        (OssoABookContactField *a,
                                                         OssoABookContactField *b);
GList*              osso_abook_contact_field_list_supported_fields
                                                        (GHashTable *message_map,
                                                         OssoABookContact *master_contact,
                                                         OssoABookContactFieldPredicateaccept_field ,
                                                         gpointer user_data);
GList*              osso_abook_contact_field_list_account_fields
                                                        (GHashTable *message_map,
                                                         OssoABookContact *master_contact);

Object Hierarchy

  GObject
   +----OssoABookContactField

Properties

  "attribute"                gpointer              : Read / Write / Construct Only
  "display-title"            gchar*                : Read
  "display-value"            gchar*                : Read
  "editor-widget"            GtkWidget*            : Read
  "flags"                    OssoABookContactFieldFlags  : Read / Write
  "icon-name"                gchar*                : Read
  "label-widget"             GtkWidget*            : Read
  "master-contact"           OssoABookContact*     : Read / Write / Construct Only
  "message-map"              GHashTable*           : Read / Write
  "modified"                 gboolean              : Read
  "name"                     gchar*                : Read
  "roster-contact"           OssoABookContact*     : Read / Write / Construct Only
  "sort-weight"              gint                  : Read

Description

This class is an representation of an attribute that describes a contact. It contains UI widgets for displaying and editing the attribute.

OssoABookContactFields can have heirarchical relationships. For example, creating a OssoABookContactField for an address will result in several child fields created as well: one for each sub-component of the address (e.g. one for street address, one for post code, one for city, etc).

It's unlikely that third-party applications will need to use this class at all, it is mostly provided for use by the addressbook itself, and can be safely ignored by other applications.

Details

OSSO_ABOOK_CONTACT_FIELD_GROUP_STEP

#define OSSO_ABOOK_CONTACT_FIELD_GROUP_STEP 100

OSSO_ABOOK_CONTACT_FIELD_GROUP_DIFF()

#define             OSSO_ABOOK_CONTACT_FIELD_GROUP_DIFF(weight1, weight2)

OssoABookContactFieldPredicate ()

gboolean            (*OssoABookContactFieldPredicate)   (OssoABookContactField *field,
                                                         gpointer user_data);

The signature of a function that can be used to select or reject fields in osso_abook_contact_field_list_supported_fields()


enum OssoABookContactFieldFlags

typedef enum {
        OSSO_ABOOK_CONTACT_FIELD_FLAGS_NONE        = (0),
        OSSO_ABOOK_CONTACT_FIELD_FLAGS_HOME        = (1 << 0),
        OSSO_ABOOK_CONTACT_FIELD_FLAGS_WORK        = (1 << 1),
        OSSO_ABOOK_CONTACT_FIELD_FLAGS_CELL        = (1 << 2),
        OSSO_ABOOK_CONTACT_FIELD_FLAGS_VOICE       = (1 << 3),
        OSSO_ABOOK_CONTACT_FIELD_FLAGS_OTHER       = (1 << 4),
        OSSO_ABOOK_CONTACT_FIELD_FLAGS_FAX         = (1 << 5),

        OSSO_ABOOK_CONTACT_FIELD_FLAGS_USAGE_MASK  = (OSSO_ABOOK_CONTACT_FIELD_FLAGS_HOME | OSSO_ABOOK_CONTACT_FIELD_FLAGS_WORK),
        OSSO_ABOOK_CONTACT_FIELD_FLAGS_DEVICE_MASK = (OSSO_ABOOK_CONTACT_FIELD_FLAGS_CELL | OSSO_ABOOK_CONTACT_FIELD_FLAGS_VOICE | OSSO_ABOOK_CONTACT_FIELD_FLAGS_FAX),
        OSSO_ABOOK_CONTACT_FIELD_FLAGS_TYPE_MASK   = (OSSO_ABOOK_CONTACT_FIELD_FLAGS_DEVICE_MASK | OSSO_ABOOK_CONTACT_FIELD_FLAGS_USAGE_MASK | OSSO_ABOOK_CONTACT_FIELD_FLAGS_OTHER),

        OSSO_ABOOK_CONTACT_FIELD_FLAGS_SINGLETON   = (1 << 10),
        OSSO_ABOOK_CONTACT_FIELD_FLAGS_MANDATORY   = (1 << 11),
        OSSO_ABOOK_CONTACT_FIELD_FLAGS_DYNAMIC     = (1 << 12),
        OSSO_ABOOK_CONTACT_FIELD_FLAGS_NO_LABEL    = (1 << 13),
        OSSO_ABOOK_CONTACT_FIELD_FLAGS_DETAILED    = (1 << 14),
} OssoABookContactFieldFlags;

A set of flags that describe various properties about a OssoABookContactField

OSSO_ABOOK_CONTACT_FIELD_FLAGS_NONE No flags
OSSO_ABOOK_CONTACT_FIELD_FLAGS_HOME The field is related to the contact's home
OSSO_ABOOK_CONTACT_FIELD_FLAGS_WORK The field is related to the contact's work
OSSO_ABOOK_CONTACT_FIELD_FLAGS_CELL The field is related to the contact's mobile device
OSSO_ABOOK_CONTACT_FIELD_FLAGS_VOICE The field is related to voice communication
OSSO_ABOOK_CONTACT_FIELD_FLAGS_OTHER The field is related to something other than those previously described
OSSO_ABOOK_CONTACT_FIELD_FLAGS_FAX The field is for sending Fax messages
OSSO_ABOOK_CONTACT_FIELD_FLAGS_USAGE_MASK A mask for fields that describe the usage of the device
OSSO_ABOOK_CONTACT_FIELD_FLAGS_DEVICE_MASK A mask for fields that describe the device itself
OSSO_ABOOK_CONTACT_FIELD_FLAGS_TYPE_MASK A mask of all previous flags
OSSO_ABOOK_CONTACT_FIELD_FLAGS_SINGLETON Only one field of this type is allowed
OSSO_ABOOK_CONTACT_FIELD_FLAGS_MANDATORY The field must exist for every contact
OSSO_ABOOK_CONTACT_FIELD_FLAGS_DYNAMIC The field is dynamic
OSSO_ABOOK_CONTACT_FIELD_FLAGS_NO_LABEL The field has no label
OSSO_ABOOK_CONTACT_FIELD_FLAGS_DETAILED The field has additional details (e.g. "Phone (home)")

enum OssoABookContactFieldActionLayoutFlags

typedef enum {
        OSSO_ABOOK_CONTACT_FIELD_ACTION_LAYOUT_NORMAL     = 0,
        OSSO_ABOOK_CONTACT_FIELD_ACTION_LAYOUT_PRIMARY    = (1 << 0),
        OSSO_ABOOK_CONTACT_FIELD_ACTION_LAYOUT_EXPANDABLE = (1 << 1),
        OSSO_ABOOK_CONTACT_FIELD_ACTION_LAYOUT_EXTRA      = (1 << 2),
} OssoABookContactFieldActionLayoutFlags;

Hints telling how a OssoABookContactFieldAction should be placed in UI like OssoABookTouchContactStarter.

Examples: - Cell-call action is PRIMARY. - SMS action is EXPANDABLE, to be placed in the same row than Cell-call if there are more than one phone number, on a new row otherwise. - SkypeOut/SipOut-call action is EXTRA|PRIMARY, to be placed after all other cell-call and SMS actions, in a new row. - SipOut-SMS action is EXTRA, to be placed after all other cell-call and SMS actions and on the same row than SipOut-call action.

OSSO_ABOOK_CONTACT_FIELD_ACTION_LAYOUT_NORMAL Action should be placed in the same row than previous actions, or in a new row if the layout don't have enough columns. This is the normal behaviour to fill completely the table.
OSSO_ABOOK_CONTACT_FIELD_ACTION_LAYOUT_PRIMARY Action should be placed in a new row, even if previous row was not completely filled.
OSSO_ABOOK_CONTACT_FIELD_ACTION_LAYOUT_EXPANDABLE Like PRIMARY if the action is alone in its group. Like NORMAL otherwise.
OSSO_ABOOK_CONTACT_FIELD_ACTION_LAYOUT_EXTRA Action should be placed after all other actions from OssoABookContactField having the same sort weight.

OssoABookContactField

typedef struct _OssoABookContactField OssoABookContactField;

osso_abook_contact_field_new_full ()

OssoABookContactField* osso_abook_contact_field_new_full
                                                        (GHashTable *message_map,
                                                         OssoABookContact *master_contact,
                                                         OssoABookContact *roster_contact,
                                                         EVCardAttribute *attribute);

Creates a new OssoABookContactField to represent the specified attribute

message_map : a map from generic ids to contextual ids (see osso_abook_message_map_new())
master_contact : the master contact associated with this field, if any
roster_contact : the roster contact associated with this field, if any
attribute : the EVCardAttribute represented by this field
Returns : a new OssoABookContactField

osso_abook_contact_field_new ()

OssoABookContactField* osso_abook_contact_field_new     (GHashTable *message_map,
                                                         OssoABookContact *master_contact,
                                                         EVCardAttribute *attribute);

Creates a new OssoABookContactField to represent the specified attribute. This constructor can be used if the field is not relevant to a particular roster contact.

message_map : a map from generic ids to contextual ids (see osso_abook_message_map_new())
master_contact : the master contact associated with this field, if any
attribute : the EVCardAttribute represented by this field
Returns : a new OssoABookContactField

osso_abook_contact_field_get_message_map ()

GHashTable*         osso_abook_contact_field_get_message_map
                                                        (OssoABookContactField *field);

Retrieve the message map for field

field : a OssoABookContactField
Returns : the contact field's message map

osso_abook_contact_field_set_message_map ()

void                osso_abook_contact_field_set_message_map
                                                        (OssoABookContactField *field,
                                                         GHashTable *mapping);

Set the message map for a OssoABookContactField

field : a OssoABookContactField
map : the new message map for field

osso_abook_contact_field_get_name ()

const char*         osso_abook_contact_field_get_name   (OssoABookContactField *field);

Get the name of the attribute represented by field

field : a OssoABookContactField
Returns : the name of the contact field

osso_abook_contact_field_get_path ()

const char*         osso_abook_contact_field_get_path   (OssoABookContactField *field);

Gets the heirarchical path for field. The format of the path string is something like: parentfieldname.thisfieldname

field : a OssoABookContactField
Returns : the path for field. This string is owned by the field and should not be freed

osso_abook_contact_field_get_flags ()

OssoABookContactFieldFlags osso_abook_contact_field_get_flags
                                                        (OssoABookContactField *field);

Gets the flags associated with field

field : a OssoABookContactField
Returns : the field's flags

osso_abook_contact_field_get_parent ()

OssoABookContactField* osso_abook_contact_field_get_parent
                                                        (OssoABookContactField *field);

Gets the parent field for field

field : a OssoABookContactField
Returns : field's parent

osso_abook_contact_field_get_children ()

GList*              osso_abook_contact_field_get_children
                                                        (OssoABookContactField *field);

Gets the list of children for field

field : a OssoABookContactField
Returns : a list of OssoABookContactFields, or NULL if field has no children. The list and its contents are owned by field, and should not be freed

osso_abook_contact_field_has_children ()

gboolean            osso_abook_contact_field_has_children
                                                        (OssoABookContactField *field);

Checks whether field has any child fields

field : a OssoABookContactField
Returns : TRUE if field has children, else FALSE

osso_abook_contact_field_get_attribute ()

EVCardAttribute*    osso_abook_contact_field_get_attribute
                                                        (OssoABookContactField *field);

Gets the EVCardAttribute that is backing this field.

field : a OssoABookContactField
Returns : the backing EVCardAttribute. The attribute is owned by field.

osso_abook_contact_field_get_borrowed_attribute ()

EVCardAttribute*    osso_abook_contact_field_get_borrowed_attribute
                                                        (OssoABookContactField *field);

Generally an OssoABookContactField will operate on a copy of the backing EVCardAttribute, but this function will return the real backing EVCardAttribute.

field : an OssoABookContactField
Returns : the backing EVCardAttribute, owned by field

osso_abook_contact_field_get_secondary_attributes ()

GList*              osso_abook_contact_field_get_secondary_attributes
                                                        (OssoABookContactField *field);

Gets a list of all secondary attributes for field. A secondary attribute is an attribute that is automatically generated from the original attribute. For instance, the vcard attribute FN is automatically generated from the vcard attribute N

field : a OssoABookContactField
Returns : a list of EVCardAttributes. The list is owned by field.

osso_abook_contact_field_get_display_title ()

const char*         osso_abook_contact_field_get_display_title
                                                        (OssoABookContactField *field);

Gets a string to be used as a display title for field

field : a OssoABookContactField
Returns : the display title. This string is owned by field

osso_abook_contact_field_get_secondary_title ()

const char*         osso_abook_contact_field_get_secondary_title
                                                        (OssoABookContactField *field);

For fields with a OSSO_ABOOK_CONTACT_FIELD_FLAGS_DETAILED flag, gets the secondary title.

field : a OssoABookContactField
Returns : the secondary title or NULL. This string is owned by field

osso_abook_contact_field_get_display_value ()

const char*         osso_abook_contact_field_get_display_value
                                                        (OssoABookContactField *field);

Gets the value of field as a displayable string

field : a OssoABookContactField
Returns : the value of field. The string is owned by field

osso_abook_contact_field_get_icon_name ()

const char*         osso_abook_contact_field_get_icon_name
                                                        (OssoABookContactField *field);

Gets the icon name for field

field : a OssoABookContactField
Returns : a icon name. The string is owned by field

osso_abook_contact_field_get_sort_weight ()

int                 osso_abook_contact_field_get_sort_weight
                                                        (OssoABookContactField *field);

Gets the sort weight for field. The sort weight determines the display order of attributes in the contact starter and contact editor. Higher values are sorted first.

field : a OssoABookContactField
Returns : the sort weight

osso_abook_contact_field_get_master_contact ()

OssoABookContact*   osso_abook_contact_field_get_master_contact
                                                        (OssoABookContactField *field);

Gets the master contact associated with field.

field : a OssoABookContactField
Returns : the master contact, if any. The contact is owned by field.

osso_abook_contact_field_get_roster_contact ()

OssoABookContact*   osso_abook_contact_field_get_roster_contact
                                                        (OssoABookContactField *field);

Gets the roster contact associated with field.

field : a OssoABookContactField
Returns : the roster contact, if any. The contact is owned by field.

osso_abook_contact_field_get_account ()

McAccount*          osso_abook_contact_field_get_account
                                                        (OssoABookContactField *field);

Gets the account associated with field, if any.

field : a OssoABookContactField
Returns : a McAccount or NULL. The account is owned by field

osso_abook_contact_field_get_actions_full ()

GList*              osso_abook_contact_field_get_actions_full
                                                        (OssoABookContactField *field,
                                                         gboolean button);

Gets the list of actions associated with field based on the interactivity mode of field. If button is TRUE, returns the list of actions when field is interactive. if button is FALSE, returns the list of actions when field is non-interactive

field : a OssoABookContactField
button : whether the field should be interactive or not
Returns : a newly-allocated list of OssoABookContactFieldActions. The list and its contents are owned by the caller and should be freed when no longer needed

osso_abook_contact_field_get_actions ()

GList*              osso_abook_contact_field_get_actions
                                                        (OssoABookContactField *field);

Gets a list of actions that can be performed for this field. Actions can be activated with osso_abook_contact_field_action_start() or osso_abook_contact_field_action_start_with_callback().

field : a OssoABookContactField
Returns : a newly-allocated list of OssoABookContactFieldActions. The list and its contents are owned by the caller and should be freed when no longer needed

osso_abook_contact_field_action_request_account ()

McAccount*          osso_abook_contact_field_action_request_account
                                                        (OssoABookContactFieldAction *action,
                                                         GtkWindow *parent,
                                                         gboolean *aborted);

Get an account to associate with the specified action. If more than one account matches, presents a dialog to the user prompting them to choose between the available options.

action : an OssoABookContactFieldAction
parent : an optional parent GtkWindow to make dialogs transient for
aborted : return location to report whether the action was aborted
Returns : an McAccount or NULL. Caller owns a reference.

osso_abook_contact_field_action_start ()

gboolean            osso_abook_contact_field_action_start
                                                        (OssoABookContactFieldAction *action,
                                                         GtkWindow *parent);

Activates the specified action

action : a OssoABookContactFieldAction
parent : an optional parent GtkWindow to make dialogs transient for
Returns : TRUE on success, FALSE otherwise

osso_abook_contact_field_action_start_with_callback ()

gboolean            osso_abook_contact_field_action_start_with_callback
                                                        (OssoABookContactFieldAction *action,
                                                         GtkWindow *parent,
                                                         OssoABookContactActionStartCb callback,
                                                         gpointer callback_data);

Activates the specified action and calls callback when complete.

action : a OssoABookContactFieldAction
parent : an optional parent GtkWindow to make dialogs transient for
callback : function to call when action is started
callback_data : data to pass to callback
Returns : TRUE on success, FALSE otherwise

osso_abook_contact_field_action_ref ()

OssoABookContactFieldAction* osso_abook_contact_field_action_ref
                                                        (OssoABookContactFieldAction *action);

Takes a reference on action

action : a OssoABookContactFieldAction
Returns : action with reference count increased by one

osso_abook_contact_field_action_unref ()

void                osso_abook_contact_field_action_unref
                                                        (OssoABookContactFieldAction *action);

Releases a reference on action. if the reference count reaches 0, action will be freed

action : a OssoABookContactFieldAction

osso_abook_contact_field_action_get_action ()

OssoABookContactAction osso_abook_contact_field_action_get_action
                                                        (OssoABookContactFieldAction *action);

action : a OssoABookContactFieldAction
Returns : the action type for the specified action

osso_abook_contact_field_action_get_field ()

OssoABookContactField* osso_abook_contact_field_action_get_field
                                                        (OssoABookContactFieldAction *action);

action : a OssoABookContactFieldAction
Returns : the OssoABookContactField associated with action

osso_abook_contact_field_action_get_widget ()

GtkWidget*          osso_abook_contact_field_action_get_widget
                                                        (OssoABookContactFieldAction *action);

action : a OssoABookContactFieldAction
Returns : the GtkWidget associated with action

osso_abook_contact_field_action_get_profile ()

McProfile*          osso_abook_contact_field_action_get_profile
                                                        (OssoABookContactFieldAction *action);

action : a OssoABookContactFieldAction
Returns : the McProfile associated with action

osso_abook_contact_field_action_get_layout_flags ()

OssoABookContactFieldActionLayoutFlags osso_abook_contact_field_action_get_layout_flags
                                                        (OssoABookContactFieldAction *action);

action : a OssoABookContactFieldAction
Returns : the layout flags associated with action

osso_abook_contact_field_action_is_basic ()

gboolean            osso_abook_contact_field_action_is_basic
                                                        (OssoABookContactFieldAction *action);

osso_abook_contact_field_create_button ()

GtkWidget*          osso_abook_contact_field_create_button
                                                        (OssoABookContactField *field,
                                                         const char *title,
                                                         const char *icon_name);

Creates an action button for field.

field : the OssoABookContactField
title : title for this button, or NULL to use default title
icon_name : icon name for this button, or NULL to use default icon
Returns : A new action button for this contact field.

osso_abook_contact_field_get_label_widget ()

GtkWidget*          osso_abook_contact_field_get_label_widget
                                                        (OssoABookContactField *field);

Gets a widget to be used as a label for the specified field. This widget is not necessarily a GtkLabel. For example, the label widget for a phone number field may be a button that allows you to choose different types of phone types (e.g. home / work / mobile).

field : a OssoABookContactField
Returns : a label widget owned by field

osso_abook_contact_field_get_editor_widget ()

GtkWidget*          osso_abook_contact_field_get_editor_widget
                                                        (OssoABookContactField *field);

osso_abook_contact_field_has_editor_widget ()

gboolean            osso_abook_contact_field_has_editor_widget
                                                        (OssoABookContactField *field);

osso_abook_contact_field_is_readonly ()

gboolean            osso_abook_contact_field_is_readonly
                                                        (OssoABookContactField *field);

Checks whether field is read-only or writable

field : a OssoABookContactField
Returns : TRUE if field is read-only, else FALSE

osso_abook_contact_field_is_bound_im ()

gboolean            osso_abook_contact_field_is_bound_im
                                                        (OssoABookContactField *field);

This function returns whether the field refers to a bound IM username. In other words, it returns TRUE if the contact is stored on the roster on the server, FALSE if not (and thus the field is editable in the contact editor). The term 'bound username' also implies that it has been normalized by the server.

field : An OssoABookContactField
Returns : TRUE if the contact is bound, FALSE otherwise.

osso_abook_contact_field_is_modified ()

gboolean            osso_abook_contact_field_is_modified
                                                        (OssoABookContactField *field);

field : An OssoABookContactField
Returns : TRUE if the field has been modified locally, else FALSE

osso_abook_contact_field_is_empty ()

gboolean            osso_abook_contact_field_is_empty   (OssoABookContactField *field);

field : An OssoABookContactField
Returns : TRUE if the field is empty, else FALSE

osso_abook_contact_field_is_mandatory ()

gboolean            osso_abook_contact_field_is_mandatory
                                                        (OssoABookContactField *field);

Checks whether field is required to exist for each contact. If a field is mandatory, it cannot be removed and must be present in order to save a contact.

field : An OssoABookContactField
Returns : TRUE if the field is mandatory, else FALSE

osso_abook_contact_field_set_mandatory ()

void                osso_abook_contact_field_set_mandatory
                                                        (OssoABookContactField *field,
                                                         gboolean mandatory);

Marks field as a mandatory field. See osso_abook_contact_field_is_mandatory() for more information about what this means.

field : An OssoABookContactField

osso_abook_contact_field_activate ()

gboolean            osso_abook_contact_field_activate   (OssoABookContactField *field);

Activates the editor widget for field, if any. Generally this will display a picker dialog so that the user can choose a new value for the field.

field : An OssoABookContactField
Returns : TRUE if the field has been modified, else FALSE

osso_abook_contact_field_cmp ()

int                 osso_abook_contact_field_cmp        (OssoABookContactField *a,
                                                         OssoABookContactField *b);

Compares a and b according to sort order, grouping children together with their parents.

a : First OssoABookContactField to compare
b : Second OssoABookContactField to compare
Returns : 0 if fields are equal, -1 if a comes before b, +1 if b comes before a

osso_abook_contact_field_list_supported_fields ()

GList*              osso_abook_contact_field_list_supported_fields
                                                        (GHashTable *message_map,
                                                         OssoABookContact *master_contact,
                                                         OssoABookContactFieldPredicateaccept_field ,
                                                         gpointer user_data);

Iterates through all possible fields and calls accept_field on them. If accept_field returns TRUE, the field will be added to the list of supported fields.

message_map : a map from generic ids to contextual ids (see osso_abook_message_map_new())
master_contact : the master contact associated with this field, if any
accept_field : Function which determines whether field is accepted
user_data : additional data passed to accept_field for each field
Returns : List of supported fields. The list and its contents are owned by the caller.

osso_abook_contact_field_list_account_fields ()

GList*              osso_abook_contact_field_list_account_fields
                                                        (GHashTable *message_map,
                                                         OssoABookContact *master_contact);

Property Details

The "attribute" property

  "attribute"                gpointer              : Read / Write / Construct Only

The VCard attribute backing this field.


The "display-title" property

  "display-title"            gchar*                : Read

The message ID field labels.

Default value: NULL


The "display-value" property

  "display-value"            gchar*                : Read

A human friendly string represeting the attribute value.

Default value: NULL


The "editor-widget" property

  "editor-widget"            GtkWidget*            : Read

The widget for editing this field.


The "flags" property

  "flags"                    OssoABookContactFieldFlags  : Read / Write

Flags describing this field.


The "icon-name" property

  "icon-name"                gchar*                : Read

The name of the icon to use with this field.

Default value: NULL


The "label-widget" property

  "label-widget"             GtkWidget*            : Read

The widget describing this field.


The "master-contact" property

  "master-contact"           OssoABookContact*     : Read / Write / Construct Only

The master contact if one is associated with this field.


The "message-map" property

  "message-map"              GHashTable*           : Read / Write

Mapping for generic message ids to context ids.


The "modified" property

  "modified"                 gboolean              : Read

Check if the field has been modified.

Default value: FALSE


The "name" property

  "name"                     gchar*                : Read

The name of this field.

Default value: NULL


The "roster-contact" property

  "roster-contact"           OssoABookContact*     : Read / Write / Construct Only

The roster contact if one is associated with this field.


The "sort-weight" property

  "sort-weight"              gint                  : Read

The weight of this field when sorting them.

Default value: -2147483648