diff options
Diffstat (limited to 'addressbook/backend/ebook/e-card.c')
-rw-r--r-- | addressbook/backend/ebook/e-card.c | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/addressbook/backend/ebook/e-card.c b/addressbook/backend/ebook/e-card.c index c2ab80a734..e18dc681ec 100644 --- a/addressbook/backend/ebook/e-card.c +++ b/addressbook/backend/ebook/e-card.c @@ -28,6 +28,7 @@ #define XEV_PILOT_ID "X-EVOLUTION-PILOTID" #define XEV_PILOT_STATUS "X-EVOLUTION-PILOTSTATUS" +#define XEV_WANTS_HTML "X-MOZILLA-HTML" #define XEV_ARBITRARY "X-EVOLUTION-ARBITRARY" /* Object argument IDs */ @@ -57,6 +58,8 @@ enum { ARG_NOTE, ARG_CATEGORIES, ARG_CATEGORY_LIST, + ARG_WANTS_HTML, + ARG_WANTS_HTML_SET, ARG_PILOTID, ARG_PILOTSTATUS, ARG_ARBITRARY, @@ -101,6 +104,7 @@ static void parse_mailer(ECard *card, VObject *object); static void parse_fburl(ECard *card, VObject *object); static void parse_note(ECard *card, VObject *object); static void parse_categories(ECard *card, VObject *object); +static void parse_wants_html(ECard *card, VObject *object); static void parse_pilot_id(ECard *card, VObject *object); static void parse_pilot_status(ECard *card, VObject *object); static void parse_arbitrary(ECard *card, VObject *object); @@ -140,6 +144,7 @@ struct { { "FBURL", parse_fburl }, { VCNoteProp, parse_note }, { "CATEGORIES", parse_categories }, + { XEV_WANTS_HTML, parse_wants_html }, { XEV_PILOT_ID, parse_pilot_id }, { XEV_PILOT_STATUS, parse_pilot_status }, { XEV_ARBITRARY, parse_arbitrary }, @@ -435,6 +440,10 @@ char g_free(string); } + if (card->wants_html_set) { + addPropValue (vobj, XEV_WANTS_HTML, card->wants_html ? "TRUE" : "FALSE"); + } + if (card->pilot_id) { gchar *pilotid_str; pilotid_str = g_strdup_printf ("%d", card->pilot_id); @@ -840,6 +849,23 @@ parse_categories(ECard *card, VObject *vobj) } static void +parse_wants_html(ECard *card, VObject *vobj) +{ + if ( vObjectValueType (vobj) ) { + char *str = fakeCString (vObjectUStringZValue (vobj)); + if (!strcasecmp(str, "true")) { + card->wants_html = TRUE; + card->wants_html_set = TRUE; + } + if (!strcasecmp(str, "false")) { + card->wants_html = FALSE; + card->wants_html_set = TRUE; + } + free(str); + } +} + +static void parse_pilot_id(ECard *card, VObject *vobj) { if ( vObjectValueType (vobj) ) { @@ -1012,6 +1038,10 @@ e_card_class_init (ECardClass *klass) GTK_TYPE_STRING, GTK_ARG_READWRITE, ARG_CATEGORIES); gtk_object_add_arg_type ("ECard::category_list", GTK_TYPE_OBJECT, GTK_ARG_READWRITE, ARG_CATEGORY_LIST); + gtk_object_add_arg_type ("ECard::wants_html", + GTK_TYPE_BOOL, GTK_ARG_READWRITE, ARG_WANTS_HTML); + gtk_object_add_arg_type ("ECard::wants_html_set", + GTK_TYPE_BOOL, GTK_ARG_READABLE, ARG_WANTS_HTML); gtk_object_add_arg_type ("ECard::pilot_id", GTK_TYPE_INT, GTK_ARG_READWRITE, ARG_PILOTID); gtk_object_add_arg_type ("ECard::pilot_status", @@ -1474,6 +1504,10 @@ e_card_set_arg (GtkObject *object, GtkArg *arg, guint arg_id) g_free (card->note); card->note = g_strdup(GTK_VALUE_STRING(*arg)); break; + case ARG_WANTS_HTML: + card->wants_html = GTK_VALUE_BOOL(*arg); + card->wants_html_set = TRUE; + break; case ARG_PILOTID: card->pilot_id = GTK_VALUE_INT(*arg); break; @@ -1614,6 +1648,12 @@ e_card_get_arg (GtkObject *object, GtkArg *arg, guint arg_id) case ARG_NOTE: GTK_VALUE_STRING(*arg) = card->note; break; + case ARG_WANTS_HTML: + GTK_VALUE_BOOL(*arg) = card->wants_html; + break; + case ARG_WANTS_HTML_SET: + GTK_VALUE_BOOL(*arg) = card->wants_html_set; + break; case ARG_PILOTID: GTK_VALUE_INT(*arg) = card->pilot_id; break; @@ -1669,6 +1709,8 @@ e_card_init (ECard *card) card->fburl = NULL; card->note = NULL; card->categories = NULL; + card->wants_html = FALSE; + card->wants_html_set = FALSE; card->pilot_id = 0; card->pilot_status = 0; card->arbitrary = NULL; |