aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/cal-util
diff options
context:
space:
mode:
Diffstat (limited to 'calendar/cal-util')
-rw-r--r--calendar/cal-util/cal-util.c25
-rw-r--r--calendar/cal-util/cal-util.h3
2 files changed, 28 insertions, 0 deletions
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;
+}
diff --git a/calendar/cal-util/cal-util.h b/calendar/cal-util/cal-util.h
index 6541515c22..1333bc3334 100644
--- a/calendar/cal-util/cal-util.h
+++ b/calendar/cal-util/cal-util.h
@@ -24,6 +24,7 @@
#define CAL_UTIL_H
#include <libgnome/gnome-defs.h>
+#include <ical.h>
#include <time.h>
#include <glib.h>
@@ -52,6 +53,8 @@ typedef enum {
void cal_obj_uid_list_free (GList *list);
+icalcomponent *cal_util_new_top_level (void);
+
END_GNOME_DECLS
#endif