Top | ![]() |
![]() |
![]() |
![]() |
GQuark | gcal_event_error_quark () |
GcalEvent * | gcal_event_new () |
gboolean | gcal_event_get_all_day () |
void | gcal_event_set_all_day () |
GdkRGBA * | gcal_event_get_color () |
void | gcal_event_set_color () |
ECalComponent * | gcal_event_get_component () |
GDateTime * | gcal_event_get_date_end () |
void | gcal_event_set_date_end () |
GDateTime * | gcal_event_get_date_start () |
void | gcal_event_set_date_start () |
const gchar * | gcal_event_get_description () |
void | gcal_event_set_description () |
gboolean | gcal_event_has_alarms () |
GList * | gcal_event_get_alarms () |
void | gcal_event_add_alarm () |
void | gcal_event_remove_alarm () |
const gchar * | gcal_event_get_location () |
void | gcal_event_set_location () |
ESource * | gcal_event_get_source () |
void | gcal_event_set_source () |
const gchar * | gcal_event_get_summary () |
void | gcal_event_set_summary () |
const gchar * | gcal_event_get_uid () |
gboolean | gcal_event_is_multiday () |
gint | gcal_event_compare () |
gint | gcal_event_compare_with_current () |
gboolean | all-day | Read / Write |
GdkRGBA * | color | Read / Write |
ECalComponent * | component | Read / Write / Construct Only |
GDateTime * | date-end | Read / Write |
GDateTime * | date-start | Read / Write |
gchar * | description | Read / Write |
gboolean | has-recurrence | Read |
gchar * | location | Read / Write |
GcalRecurrence * | recurrence | Read / Write |
ESource * | source | Read / Write / Construct |
gchar * | summary | Read / Write |
GTimeZone * | timezone | Read / Write |
gchar * | uid | Read |
The GcalEvent class represents an appointment, with
various functions to modify it. All the changes are
transient. To persistently store the changes, you
need to call gcal_manager_update_event()
.
Although the ECalComponent may have no end date. In this
case, gcal_event_get_date_end()
returns the same date that
gcal_event_get_date_start()
.
GcalEvent implements GInitable, and creating it possibly can generate an error. At the moment, the only error that can be generate is GCAL_EVENT_ERROR_INVALID_START_DATE.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
GcalEvent *event; GError *error; error = NULL; event = gcal_event_new (source, component, &error); if (error) { g_warning ("Error creating event: %s", error->message); g_clear_error (&error); return; } ... |
GcalEvent * gcal_event_new (ESource *source
,ECalComponent *component
,GError **error
);
Creates a new event which belongs to source
and
is represented by component
. New events will have
a NULL
source
.
gboolean
gcal_event_get_all_day (GcalEvent *self
);
Retrieves whether the event is all day or not.
void gcal_event_set_all_day (GcalEvent *self
,gboolean all_day
);
Sets the GcalEvent
::all-day property.
GdkRGBA *
gcal_event_get_color (GcalEvent *self
);
Retrieves the color of the event.
void gcal_event_set_color (GcalEvent *self
,GdkRGBA *color
);
Sets the color of the event, which is passed to the parent ESource.
ECalComponent *
gcal_event_get_component (GcalEvent *self
);
Retrieves the internal component of the event.
GDateTime *
gcal_event_get_date_end (GcalEvent *self
);
Retrieves the end date of self
. If the component doesn't
have an end date, then the returned date is the same of
gcal_event_get_date_start()
.
void gcal_event_set_date_end (GcalEvent *self
,GDateTime *dt
);
Sets the end date as dt
.
GDateTime *
gcal_event_get_date_start (GcalEvent *self
);
Retrieves the start date of self
.
void gcal_event_set_date_start (GcalEvent *self
,GDateTime *dt
);
Sets the start date as dt
.
const gchar *
gcal_event_get_description (GcalEvent *self
);
Retrieves the description of self
.
void gcal_event_set_description (GcalEvent *self
,const gchar *description
);
Sets the description of the event.
gboolean
gcal_event_has_alarms (GcalEvent *self
);
Retrieves whether the event has alarms or not.
GList *
gcal_event_get_alarms (GcalEvent *self
);
Retrieves the alarms available for self
.
void gcal_event_add_alarm (GcalEvent *self
,guint type
,gboolean has_sound
);
Adds an alarm to self
that triggers type
minutes before the event's
start date.
If there's already an alarm for type
, it'll be replaced.
void gcal_event_remove_alarm (GcalEvent *self
,guint type
);
Removes an alarm from self
that triggers type
minutes before the event's
start date.
If there's no alarm set for type
, nothing happens.
const gchar *
gcal_event_get_location (GcalEvent *self
);
Retrieves the location of the event.
void gcal_event_set_location (GcalEvent *self
,const gchar *location
);
Sets the location of the event.
ESource *
gcal_event_get_source (GcalEvent *self
);
Retrieves the source of the event.
void gcal_event_set_source (GcalEvent *self
,ESource *source
);
Sets the source of this event. The color of the event is automatically tied with the source's color.
The source should only be set once.
const gchar *
gcal_event_get_summary (GcalEvent *self
);
Retrieves the summary of this event.
void gcal_event_set_summary (GcalEvent *self
,const gchar *summary
);
Sets the summary of event
.
const gchar *
gcal_event_get_uid (GcalEvent *self
);
Retrieves the unique identifier of the event. The UID consists of '[source id]:[event id]:[recurrency id]'. If there's no recurrency assigned, the last field is ignored.
gboolean
gcal_event_is_multiday (GcalEvent *self
);
Whether the event visibly spans more than one day in the calendar.
This function can return different values for the same event depending on your timezone. For example, an event that spans [ 02:00, 22:00 ) +0000 would assume the following values:
1 2 3 4 |
D-1 D D+1 -0600 [ ---][------- ][ ] (multiday) +0000 [ ][ ---------- ][ ] (single day) +0800 [ ][ -------][--- ] (multiday) |
gint gcal_event_compare (GcalEvent *event1
,GcalEvent *event2
);
Compare event1
and event2
. It compares the start dates of
the events and, when they have the same date (time is ignored),
the GcalEvent
::all-day is the tiebreaker criteria.
Events with equal start dates are sorted by the length.
“all-day”
property “all-day” gboolean
Whether the event is all day or not.
Flags: Read / Write
Default value: FALSE
“component”
property “component” ECalComponent *
The ECalComponent of the event.
Flags: Read / Write / Construct Only
“description”
property “description” gchar *
The description of the event.
Flags: Read / Write
Default value: ""
“has-recurrence”
property “has-recurrence” gboolean
Whether the event has recurrence or not.
Flags: Read
Default value: FALSE
“location”
property “location” gchar *
The location of the event.
Flags: Read / Write
Default value: ""
“recurrence”
property “recurrence” GcalRecurrence *
The recurrence property of the event.
Flags: Read / Write
“source”
property “source” ESource *
The ESource this event belongs to.
Flags: Read / Write / Construct
“summary”
property “summary” gchar *
The summary of the event.
Flags: Read / Write
Default value: ""