## ESourceAlarms

ESourceAlarms — ESource extension for alarm state

## Synopsis

    #include <libedataserver/libedataserver.h>

    struct              ESourceAlarms;
    #define             E_SOURCE_EXTENSION_ALARMS
    gboolean            e_source_alarms_get_include_me      (ESourceAlarms *extension);
    void                e_source_alarms_set_include_me      (ESourceAlarms *extension,
                                                             gboolean include_me);
    const gchar *       e_source_alarms_get_last_notified   (ESourceAlarms *extension);
    gchar *             e_source_alarms_dup_last_notified   (ESourceAlarms *extension);
    void                e_source_alarms_set_last_notified   (ESourceAlarms *extension,
                                                             const gchar *last_notified);

## Object Hierarchy

      GObject
       +----ESourceExtension
             +----ESourceAlarms

## Description

The ESourceAlarms extension tracks alarm state for a calendar.

Access the extension as follows:

    1
    2
    3
    4
    5

    #include <libedataserver/libedataserver.h>

    ESourceAlarms *extension;

    extension = e_source_get_extension (source, E_SOURCE_EXTENSION_ALARMS);

## Details

### struct ESourceAlarms

    struct ESourceAlarms;

Contains only private data that should be read and manipulated using the functions below.

Since 3.6

### E_SOURCE_EXTENSION_ALARMS

    #define E_SOURCE_EXTENSION_ALARMS "Alarms"

Pass this extension name to `e_source_get_extension()` to access ESourceAlarms. This is also used as a group name in key files.

Since 3.6

### e_source_alarms_get_include_me ()

    gboolean            e_source_alarms_get_include_me      (ESourceAlarms *extension);

Returns whether the user should be alerted about upcoming appointments in the calendar described by the ESource to which `extension` belongs.

Alarm daemons such as evolution-alarm-notify can use this property to decide which calendars to query for upcoming appointments.

`extension` : | an ESourceAlarms
Returns : | whether to show alarms for upcoming appointments

Since 3.6

### e_source_alarms_set_include_me ()

    void                e_source_alarms_set_include_me      (ESourceAlarms *extension,
                                                             gboolean include_me);

Sets whether the user should be alerted about upcoming appointments in the calendar described by the ESource to which `extension` belongs.

Alarm daemons such as evolution-alarm-notify can use this property to decide which calendars to query for upcoming appointments.

`extension` : | an ESourceAlarms
`include_me` : | whether to show alarms for upcoming appointments

Since 3.6

### e_source_alarms_get_last_notified ()

    const gchar *       e_source_alarms_get_last_notified   (ESourceAlarms *extension);

Returns an ISO 8601 formatted timestamp of when the user was last alerted about an upcoming appointment in the calendar described by the ESource to which `extension` belongs. If no valid timestamp has been set, the function will return `NULL`.

`extension` : | an ESourceAlarms
Returns : | an ISO 8601 timestamp, or `NULL`

Since 3.6

### e_source_alarms_dup_last_notified ()

    gchar *             e_source_alarms_dup_last_notified   (ESourceAlarms *extension);

Thread-safe variation of `e_source_alarms_get_last_notified()`. Use this function when accessing `extension` from multiple threads.

The returned string should be freed with `g_free()` when no longer needed.

`extension` : | an ESourceAlarms
Returns : | a newly-allocated copy of "last-notified"

Since 3.6

### e_source_alarms_set_last_notified ()

    void                e_source_alarms_set_last_notified   (ESourceAlarms *extension,
                                                             const gchar *last_notified);

Sets an ISO 8601 formatted timestamp of when the user was last alerted about an upcoming appointment in the calendar described by the ESource to which `extension` belongs.

If `last_notified` is non-`NULL`, the function will validate the timestamp before setting the "last-notified" property. Invalid timestamps are discarded with a runtime warning.

Generally, this function should only be called by an alarm daemon such as evolution-alarm-notify.

`extension` : | an ESourceAlarms
`last_notified` : | an ISO 8601 timestamp, or `NULL`. [allow-none]

Since 3.6