diff options
author | Danielle Madeley <danielle.madeley@collabora.co.uk> | 2011-04-14 12:44:49 +0800 |
---|---|---|
committer | Danielle Madeley <danielle.madeley@collabora.co.uk> | 2011-10-21 06:42:23 +0800 |
commit | 56c72cd7a01d0e52d32ba5a47967c8c6e7fde766 (patch) | |
tree | 83786c831d585990959ff83d69805d21c06c2a56 /libempathy-gtk/empathy-contactinfo-utils.c | |
parent | 558a3d0590e8dbd4f56e8a96dd9b023eb3241541 (diff) | |
download | gsoc2013-empathy-56c72cd7a01d0e52d32ba5a47967c8c6e7fde766.tar gsoc2013-empathy-56c72cd7a01d0e52d32ba5a47967c8c6e7fde766.tar.gz gsoc2013-empathy-56c72cd7a01d0e52d32ba5a47967c8c6e7fde766.tar.bz2 gsoc2013-empathy-56c72cd7a01d0e52d32ba5a47967c8c6e7fde766.tar.lz gsoc2013-empathy-56c72cd7a01d0e52d32ba5a47967c8c6e7fde766.tar.xz gsoc2013-empathy-56c72cd7a01d0e52d32ba5a47967c8c6e7fde766.tar.zst gsoc2013-empathy-56c72cd7a01d0e52d32ba5a47967c8c6e7fde766.zip |
Port contact-widget to contactinfo-utils
This is a reworking, rather than rebasing of the original patch because of
large changes in the codebase.
Diffstat (limited to 'libempathy-gtk/empathy-contactinfo-utils.c')
-rw-r--r-- | libempathy-gtk/empathy-contactinfo-utils.c | 33 |
1 files changed, 29 insertions, 4 deletions
diff --git a/libempathy-gtk/empathy-contactinfo-utils.c b/libempathy-gtk/empathy-contactinfo-utils.c index e4e18f19d..997225775 100644 --- a/libempathy-gtk/empathy-contactinfo-utils.c +++ b/libempathy-gtk/empathy-contactinfo-utils.c @@ -72,16 +72,32 @@ presence_hack (GStrv values) return g_markup_escape_text (values[0], -1); } -typedef gchar * (* FieldFormatFunc) (GStrv); - typedef struct { const gchar *field_name; const gchar *title; - FieldFormatFunc format; + EmpathyContactInfoFormatFunc format; } InfoFieldData; -static InfoFieldData info_field_data[] = +/* keep this syncronised with info_field_data below */ +static const char *info_field_names[] = +{ + "fn", + "tel", + "email", + "url", + "bday", + + "x-idle-time", + "x-irc-server", + "x-host", + + "x-presence-status-message", + + NULL +}; + +static InfoFieldData info_field_data[G_N_ELEMENTS (info_field_names)] = { { "fn", N_("Full name"), NULL }, { "tel", N_("Phone number"), NULL }, @@ -121,6 +137,15 @@ static InfoParameterData info_parameter_data[] = { NULL, NULL } }; +const char ** +empathy_contact_info_get_field_names (guint *nnames) +{ + if (nnames != NULL) + *nnames = G_N_ELEMENTS (info_field_names) - 1; + + return info_field_names; +} + gboolean empathy_contact_info_lookup_field (const gchar *field_name, const gchar **title, |