From c55a14f76a8ba5d564c8b203582e6d8480a7e4eb Mon Sep 17 00:00:00 2001 From: JP Rosevear Date: Thu, 12 Jul 2001 18:56:07 +0000 Subject: new proto 2001-07-12 JP Rosevear * cal-util/cal-util.h: new proto * cal-util/cal-util.c (cal_util_new_top_level): standard place to get your top level calendar component * pcs/cal-backend-file.c (create_cal): use it * gui/itip-utils.c (itip_send_comp): ditto * gui/e-calendar-table.c (e_calendar_table_copy_clipboard): ditto svn path=/trunk/; revision=11053 --- calendar/cal-util/cal-util.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'calendar/cal-util/cal-util.c') diff --git a/calendar/cal-util/cal-util.c b/calendar/cal-util/cal-util.c index 160d984533..bb1b8a2f51 100644 --- a/calendar/cal-util/cal-util.c +++ b/calendar/cal-util/cal-util.c @@ -73,3 +73,28 @@ cal_obj_uid_list_free (GList *list) g_list_free (list); } + +icalcomponent * +cal_util_new_top_level (void) +{ + icalcomponent *icalcomp; + icalproperty *prop; + + icalcomp = icalcomponent_new (ICAL_VCALENDAR_COMPONENT); + + /* RFC 2445, section 4.7.1 */ + prop = icalproperty_new_calscale ("GREGORIAN"); + icalcomponent_add_property (icalcomp, prop); + + /* RFC 2445, section 4.7.3 */ + prop = icalproperty_new_prodid ("-//Ximian//NONSGML Evolution Calendar//EN"); + icalcomponent_add_property (icalcomp, prop); + + /* RFC 2445, section 4.7.4. This is the iCalendar spec version, *NOT* + * the product version! Do not change this! + */ + prop = icalproperty_new_version ("2.0"); + icalcomponent_add_property (icalcomp, prop); + + return icalcomp; +} -- cgit v1.2.3