aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/cal-util
diff options
context:
space:
mode:
authorDamon Chaplin <damon@ximian.com>2001-08-15 09:13:37 +0800
committerDamon Chaplin <damon@src.gnome.org>2001-08-15 09:13:37 +0800
commit6684b4627d4767f6ea5d2969d70ae6f2cf863a79 (patch)
tree89d7a6fba9713ff48fe44ed4bad3ee94471030e6 /calendar/cal-util
parent84f12a913e4a46c198a951dd2b10512fb87ce0a3 (diff)
downloadgsoc2013-evolution-6684b4627d4767f6ea5d2969d70ae6f2cf863a79.tar
gsoc2013-evolution-6684b4627d4767f6ea5d2969d70ae6f2cf863a79.tar.gz
gsoc2013-evolution-6684b4627d4767f6ea5d2969d70ae6f2cf863a79.tar.bz2
gsoc2013-evolution-6684b4627d4767f6ea5d2969d70ae6f2cf863a79.tar.lz
gsoc2013-evolution-6684b4627d4767f6ea5d2969d70ae6f2cf863a79.tar.xz
gsoc2013-evolution-6684b4627d4767f6ea5d2969d70ae6f2cf863a79.tar.zst
gsoc2013-evolution-6684b4627d4767f6ea5d2969d70ae6f2cf863a79.zip
added support for the Contacts field. Note that I'm not sure what we
2001-08-14 Damon Chaplin <damon@ximian.com> * gui/dialogs/task-page.c: * gui/dialogs/event-page.c: added support for the Contacts field. Note that I'm not sure what we should put in the iCalendar CONTACT properties. Currently we put "name <email>", but it isn't recognized as a contact when we reopen the dialog, so we may need more info here. Also we currently use a simple parser to parse the above format, and we should maybe use some camel function. * gui/dialogs/task-page.glade: * gui/dialogs/event-page.glade: replaced the GtkEntry fields for the Contacts with a GtkEventBox which we put the BonoboControl in at runtime. * gui/dialogs/meeting-page.c (invite_entry_changed): added FIXMEs since it doesn't seem to be freeing the EDestination stuff. JP? * gui/dialogs/comp-editor-util.c: added bunch of utility functions to handle the Contacts field in the main Event and Task pages. * gui/gnome-cal.c: added visible_start and visible_end fields, so we only emit the 'dates-shown-changed' signal when really necessary. Currently changing the folder title bar label results in a complete redraw of the Evolution window (silly GtkLabel queueing a resize), so we want to avoid that as much as possible. (gnome_calendar_new_appointment_for): only move the event's end time to the end of the day if it is not already 00:00:00. * gui/e-week-view-event-item.c: * gui/e-week-view.c: * gui/e-day-view.c: added support for double-clicking on an event to open it, and for double-clicking on the background to create a new event. There is still a minor problem to sort out, but it basically works. * cal-util/cal-component.c: added support for CONTACT properties, mainly by copying the code for COMMENT properties which are exactly the same type. * gui/e-day-view.c (e_day_view_realize): use the same color for the top canvas background as the shortcut bar, to make it look a little nicer (I think). Although we still have the theme problem with hard-coded colors. svn path=/trunk/; revision=12039
Diffstat (limited to 'calendar/cal-util')
-rw-r--r--calendar/cal-util/cal-component.c57
-rw-r--r--calendar/cal-util/cal-component.h3
2 files changed, 60 insertions, 0 deletions
diff --git a/calendar/cal-util/cal-component.c b/calendar/cal-util/cal-component.c
index 7bacfb5432..c7800f0456 100644
--- a/calendar/cal-util/cal-component.c
+++ b/calendar/cal-util/cal-component.c
@@ -71,6 +71,9 @@ struct _CalComponentPrivate {
GSList *comment_list; /* list of struct text */
icalproperty *completed;
+
+ GSList *contact_list; /* list of struct text */
+
icalproperty *created;
GSList *description_list; /* list of struct text */
@@ -286,6 +289,7 @@ free_icalcomponent (CalComponent *comp)
priv->classification = NULL;
priv->comment_list = NULL;
priv->completed = NULL;
+ priv->contact_list = NULL;
priv->created = NULL;
priv->description_list = free_slist (priv->description_list);
@@ -599,6 +603,10 @@ scan_property (CalComponent *comp, icalproperty *prop)
priv->completed = prop;
break;
+ case ICAL_CONTACT_PROPERTY:
+ scan_text (comp, &priv->contact_list, prop);
+ break;
+
case ICAL_CREATED_PROPERTY:
priv->created = prop;
break;
@@ -1617,6 +1625,55 @@ cal_component_set_comment_list (CalComponent *comp, GSList *text_list)
set_text_list (comp, icalproperty_new_comment, &priv->comment_list, text_list);
}
+/**
+ * cal_component_get_contact_list:
+ * @comp: A calendar component object.
+ * @text_list: Return value for the contact properties and their parameters, as
+ * a list of #CalComponentText structures. This should be freed using the
+ * cal_component_free_text_list() function.
+ *
+ * Queries the contact of a calendar component object. The contact property can
+ * appear several times inside a calendar component, and so a list of
+ * #CalComponentText is returned.
+ **/
+void
+cal_component_get_contact_list (CalComponent *comp, GSList **text_list)
+{
+ CalComponentPrivate *priv;
+
+ g_return_if_fail (comp != NULL);
+ g_return_if_fail (IS_CAL_COMPONENT (comp));
+ g_return_if_fail (text_list != NULL);
+
+ priv = comp->priv;
+ g_return_if_fail (priv->icalcomp != NULL);
+
+ get_text_list (priv->contact_list, icalproperty_get_contact, text_list);
+}
+
+/**
+ * cal_component_set_contact_list:
+ * @comp: A calendar component object.
+ * @text_list: List of #CalComponentText structures.
+ *
+ * Sets the contact of a calendar component object. The contact property can
+ * appear several times inside a calendar component, and so a list of
+ * #CalComponentText structures is used.
+ **/
+void
+cal_component_set_contact_list (CalComponent *comp, GSList *text_list)
+{
+ CalComponentPrivate *priv;
+
+ g_return_if_fail (comp != NULL);
+ g_return_if_fail (IS_CAL_COMPONENT (comp));
+
+ priv = comp->priv;
+ g_return_if_fail (priv->icalcomp != NULL);
+
+ set_text_list (comp, icalproperty_new_contact, &priv->contact_list, text_list);
+}
+
/* Gets a struct icaltimetype value */
static void
get_icaltimetype (icalproperty *prop,
diff --git a/calendar/cal-util/cal-component.h b/calendar/cal-util/cal-component.h
index e1f4022b91..b0545397b4 100644
--- a/calendar/cal-util/cal-component.h
+++ b/calendar/cal-util/cal-component.h
@@ -257,6 +257,9 @@ void cal_component_set_comment_list (CalComponent *comp, GSList *text_list);
void cal_component_get_completed (CalComponent *comp, struct icaltimetype **t);
void cal_component_set_completed (CalComponent *comp, struct icaltimetype *t);
+void cal_component_get_contact_list (CalComponent *comp, GSList **text_list);
+void cal_component_set_contact_list (CalComponent *comp, GSList *text_list);
+
void cal_component_get_created (CalComponent *comp, struct icaltimetype **t);
void cal_component_set_created (CalComponent *comp, struct icaltimetype *t);