diff options
Diffstat (limited to 'addressbook/backend/ebook/e-vcard.h')
-rw-r--r-- | addressbook/backend/ebook/e-vcard.h | 99 |
1 files changed, 78 insertions, 21 deletions
diff --git a/addressbook/backend/ebook/e-vcard.h b/addressbook/backend/ebook/e-vcard.h index 69e0a3e10b..cedc2b4c70 100644 --- a/addressbook/backend/ebook/e-vcard.h +++ b/addressbook/backend/ebook/e-vcard.h @@ -26,18 +26,56 @@ #include <glib.h> #include <glib-object.h> -#define EVC_FN "FN" -#define EVC_ORG "ORG" -#define EVC_URL "URL" -#define EVC_VERSION "VERSION" -#define EVC_REV "REV" -#define EVC_PRODID "PRODID" -#define EVC_TYPE "TYPE" -#define EVC_ADR "ADR" -#define EVC_TEL "TEL" - -#define EVC_ENCODING "ENCODING" +#define EVC_ADR "ADR" +#define EVC_BDAY "BDAY" +#define EVC_CALURI "CALURI" +#define EVC_CATEGORIES "CATEGORIES" +#define EVC_EMAIL "EMAIL" +#define EVC_ENCODING "ENCODING" +#define EVC_FBURL "FBURL" +#define EVC_FN "FN" +#define EVC_ICSCALENDAR "ICSCALENDAR" /* XXX should this be X-EVOLUTION-ICSCALENDAR? */ +#define EVC_LABEL "LABEL" +#define EVC_LOGO "LOGO" +#define EVC_MAILER "MAILER" +#define EVC_NICKNAME "NICKNAME" +#define EVC_N "N" +#define EVC_NOTE "NOTE" +#define EVC_ORG "ORG" +#define EVC_PHOTO "PHOTO" +#define EVC_PRODID "PRODID" #define EVC_QUOTEDPRINTABLE "QUOTED-PRINTABLE" +#define EVC_REV "REV" +#define EVC_ROLE "ROLE" +#define EVC_TEL "TEL" +#define EVC_TITLE "TITLE" +#define EVC_TYPE "TYPE" +#define EVC_UID "UID" +#define EVC_URL "URL" +#define EVC_VALUE "VALUE" +#define EVC_VERSION "VERSION" + +#define EVC_X_AIM "X-AIM" +#define EVC_X_ANNIVERSARY "X-EVOLUTION-ANNIVERSARY" +#define EVC_X_ASSISTANT "X-EVOLUTION-ASSISTANT" +#define EVC_X_BIRTHDAY "X-EVOLUTION-BIRTHDAY" +#define EVC_X_BLOG_URL "X-EVOLUTION-BLOG-URL" +#define EVC_X_FILE_AS "X-EVOLUTION-FILE-AS" +#define EVC_X_ICQ "X-ICQ" +#define EVC_X_JABBER "X-JABBER" +#define EVC_X_LIST_SHOW_ADDRESSES "X-EVOLUTION-LIST-SHOW_ADDRESSES" +#define EVC_X_LIST "X-EVOLUTION-LIST" +#define EVC_X_MANAGER "X-EVOLUTION-MANAGER" +#define EVC_X_MSN "X-MSN" +#define EVC_X_SPOUSE "X-EVOLUTION-SPOUSE" +#define EVC_X_WANTS_HTML "X-MOZILLA-HTML" +#define EVC_X_WANTS_HTML "X-MOZILLA-HTML" +#define EVC_X_YAHOO "X-YAHOO" + +typedef enum { + EVC_FORMAT_VCARD_21, + EVC_FORMAT_VCARD_30 +} EVCardFormat; #define E_TYPE_VCARD (e_vcard_get_type ()) #define E_VCARD(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_TYPE_VCARD, EVCard)) @@ -60,28 +98,46 @@ struct _EVCard { struct _EVCardClass { GObjectClass parent_class; + + /* Padding for future expansion */ + void (*_ebook_reserved0) (void); + void (*_ebook_reserved1) (void); + void (*_ebook_reserved2) (void); + void (*_ebook_reserved3) (void); + void (*_ebook_reserved4) (void); }; GType e_vcard_get_type (void); + +void e_vcard_construct (EVCard *evc, const char *str); EVCard* e_vcard_new (void); EVCard* e_vcard_new_from_string (const char *str); -char* e_vcard_to_string (EVCard *evcard); + +char* e_vcard_to_string (EVCard *evc, EVCardFormat format); + /* mostly for debugging */ void e_vcard_dump_structure (EVCard *evc); /* attributes */ -EVCardAttribute *e_vcard_attribute_new (const char *attr_group, const char *attr_name); -void e_vcard_attribute_free (EVCardAttribute *attr); -void e_vcard_add_attribute (EVCard *evcard, EVCardAttribute *attr); -void e_vcard_add_attribute_with_value (EVCard *evcard, EVCardAttribute *attr, const char *value); -void e_vcard_add_attribute_with_values (EVCard *evcard, EVCardAttribute *attr, ...); -void e_vcard_attribute_add_value (EVCardAttribute *attr, const char *value); -void e_vcard_attribute_add_values (EVCardAttribute *attr, ...); +EVCardAttribute *e_vcard_attribute_new (const char *attr_group, const char *attr_name); +void e_vcard_attribute_free (EVCardAttribute *attr); +EVCardAttribute *e_vcard_attribute_copy (EVCardAttribute *attr); +void e_vcard_remove_attributes (EVCard *evcard, const char *attr_group, const char *attr_name); +void e_vcard_remove_attribute (EVCard *evcard, EVCardAttribute *attr); +void e_vcard_add_attribute (EVCard *evcard, EVCardAttribute *attr); +void e_vcard_add_attribute_with_value (EVCard *evcard, EVCardAttribute *attr, const char *value); +void e_vcard_add_attribute_with_values (EVCard *evcard, EVCardAttribute *attr, ...); +void e_vcard_attribute_add_value (EVCardAttribute *attr, const char *value); +void e_vcard_attribute_add_value_decoded (EVCardAttribute *attr, const char *value, int len); +void e_vcard_attribute_add_values (EVCardAttribute *attr, ...); +void e_vcard_attribute_remove_values (EVCardAttribute *attr); +void e_vcard_attribute_remove_params (EVCardAttribute *attr); /* attribute parameters */ EVCardAttributeParam* e_vcard_attribute_param_new (const char *param_name); void e_vcard_attribute_param_free (EVCardAttributeParam *param); +EVCardAttributeParam* e_vcard_attribute_param_copy (EVCardAttributeParam *param); void e_vcard_attribute_add_param (EVCardAttribute *attr, EVCardAttributeParam *param); void e_vcard_attribute_add_param_with_value (EVCardAttribute *attr, EVCardAttributeParam *param, const char *value); @@ -92,17 +148,18 @@ void e_vcard_attribute_param_add_value (EVCardAttributePa const char *value); void e_vcard_attribute_param_add_values (EVCardAttributeParam *param, ...); +void e_vcard_attribute_param_remove_values (EVCardAttributeParam *param); /* EVCard* accessors. nothing returned from these functions should be freed by the caller. */ GList* e_vcard_get_attributes (EVCard *evcard); const char* e_vcard_attribute_get_group (EVCardAttribute *attr); const char* e_vcard_attribute_get_name (EVCardAttribute *attr); -GList* e_vcard_attribute_get_values (EVCardAttribute *attr); +GList* e_vcard_attribute_get_values (EVCardAttribute *attr); /* GList elements are of type char* */ +GList* e_vcard_attribute_get_values_decoded (EVCardAttribute *attr); /* GList elements are of type GString* */ GList* e_vcard_attribute_get_params (EVCardAttribute *attr); const char* e_vcard_attribute_param_get_name (EVCardAttributeParam *param); GList* e_vcard_attribute_param_get_values (EVCardAttributeParam *param); - #endif /* _EVCARD_H */ |