![]() |
![]() |
![]() |
GPE Manual: libeventdb Reference Manual |
---|
Event DatabaseEvent Database — Event database programmers interface. |
#define SECONDS_IN_DAY #define MON #define TUE #define WED #define THU #define FRI #define SAT #define SUN enum recur_type_t; #define FLAG_UNTIMED #define FLAG_ALARM #define FLAG_TENTATIVE #define FLAG_CLONE #define FLAG_RECUR struct calendar_time_s; typedef calendar_time_t; #define EVENT_DB_USE_MEMCHUNK #define event_db__alloc_event () #define event_db__alloc_recur () #define event_db__free_event (_x) #define event_db__free_recur (_x) gboolean event_db_start (void); gboolean event_db_refresh (void); gboolean event_db_stop (void); gboolean event_db_add (event_t ev); gboolean event_db_remove (event_t ev); gboolean event_db_flush (event_t ev); event_t event_db_clone (event_t ev); event_t event_db_new (void); event_t event_db_find_by_uid (guint uid); void event_db_destroy (event_t ev); event_details_t event_db_alloc_details (event_t ev); event_details_t event_db_get_details (event_t ev); void event_db_forget_details (event_t ev); GSList* event_db_list_for_period (time_t start, time_t end); GSList* event_db_list_alarms_for_period (time_t start, time_t end); GSList* event_db_list_for_future (time_t start, guint max); GSList* event_db_untimed_list_for_period (time_t start, time_t end, gboolean yes); void event_db_list_destroy (GSList *l); recur_t event_db_get_recurrence (event_t ev);
typedef enum { RECUR_NONE, RECUR_DAILY, RECUR_WEEKLY, RECUR_MONTHLY, RECUR_YEARLY } recur_type_t;
gboolean event_db_start (void);
Initialise the event database for use. Needs to be called on application start before acessing events.
Returns : | TRUE on success, FALSE otherwise. |
gboolean event_db_refresh (void);
Refresh event information from database on disk.
Returns : | TRUE on success, FALSE otherwise. |
gboolean event_db_stop (void);
Closes the event database and frees all remaining events in memory.
Returns : | TRUE on success, FALSE otherwise. |
gboolean event_db_add (event_t ev);
Add an event to both the in-memory list and the SQL database. This makes sure the event is accessible by all application including the application which adds the event instantly.
ev : |
Event |
Returns : | TRUE on success, FALSE otherwise. |
gboolean event_db_remove (event_t ev);
This function removes an event from the event database.
ev : |
Event |
Returns : | TRUE on success, FALSE otherwise. |
gboolean event_db_flush (event_t ev);
Remove an event from the database.
ev : |
Event |
Returns : | TRUE on success, FALSE otherwise. |
event_t event_db_clone (event_t ev);
Clones a given event. The new event is marked to be a clone instead of the original event by setting the FLAG_CLONE flag.
ev : |
Event to clone. |
Returns : | The event clone. |
event_t event_db_new (void);
Create and initialise a new event_t event structure.
Returns : | A new event. |
event_details_t event_db_alloc_details (event_t ev);
Allocates a new, clean event_details_t structure which is attached to the given event.
ev : |
Event |
Returns : | The new details structure. |
event_details_t event_db_get_details (event_t ev);
Retrieves detailed information for a given event and increments the
reference counter of the event_details_t structure which will be
attached to the event. If the event details are already
there they will not be loaded again but the reference counter is increased.
If you mant to make sure the event details are updated you need to use
event_db_forget_details()
first.
ev : |
Event to get details for. |
Returns : | The event_details_t event detail data attached to the event. |
void event_db_forget_details (event_t ev);
Decrease the reference counter of the event detail information in an event_t. If the reference counter is 0 the detail information is freed.
ev : |
Event to get details for. |
GSList* event_db_list_for_period (time_t start, time_t end);
Create a list of all events for a given period.
start : |
Start time |
end : |
End time |
Returns : | A list of events. |
GSList* event_db_list_alarms_for_period (time_t start, time_t end);
Create a list of all alarm events for a given period.
start : |
Start time |
end : |
End time |
Returns : | A list of events. |
GSList* event_db_list_for_future (time_t start, guint max);
Get a list of all future events starting at a given time. The total amount
of events may be limited by the max
parameter. Set this to 0 for an
unlimited amount of events.
start : |
Start time |
max : |
Maximum number of events to retrieve. |
Returns : | A list of events. |
GSList* event_db_untimed_list_for_period (time_t start, time_t end, gboolean yes);
Create a list of all untimed events for a given period.
start : |
Start time |
end : |
End time |
yes : |
|
Returns : | A list of events. |
void event_db_list_destroy (GSList *l);
This function frees a given list of events including the list itself.
l : |
Event list |
<< Programmers Interface |