ECal.ReminderWatcher

g ECal.ReminderWatcher ECal.ReminderWatcher GObject.Object GObject.Object GObject.Object->ECal.ReminderWatcher

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new (registry)

describe_data (rd, flags)

dismiss (rd, cancellable, callback, *user_data)

dismiss_all (cancellable, callback, *user_data)

dismiss_all_finish (result)

dismiss_all_sync (cancellable)

dismiss_finish (result)

dismiss_sync (rd, cancellable)

dup_default_zone ()

dup_past ()

dup_snoozed ()

get_registry ()

get_timers_enabled ()

ref_opened_client (source_uid)

set_default_zone (zone)

set_timers_enabled (enabled)

snooze (rd, until)

timer_elapsed ()

Virtual Methods

Inherited:

GObject.Object (7)

do_cal_client_connect (source, source_type, wait_for_connected_seconds, cancellable, callback, *user_data)

do_changed ()

do_format_time (rd, itt, inout_buffer, buffer_size)

do_schedule_timer (at_time)

Properties

Name

Type

Flags

Short Description

default-zone

ICalGLib.Timezone

r/w/en

The default time zone

registry

EDataServer.SourceRegistry

r/w/co

Data source registry

timers-enabled

bool

r/w/en

Whether can schedule timers

Signals

Inherited:

GObject.Object (1)

Name

Short Description

changed

Signal is emitted when the list of past or snoozed reminders changes.

format-time

Formats time itt to a string and writes it to inout_buffer, which can hold up to buffer_size bytes.

triggered

Signal is emitted when any reminder is either overdue or triggered.

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent

GObject.Object

r

Class Details

class ECal.ReminderWatcher(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

ECal.ReminderWatcherClass

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

New in version 3.30.

classmethod new(registry)
Parameters:

registry (EDataServer.SourceRegistry) – an EDataServer.SourceRegistry

Returns:

a new instance of ECal.ReminderWatcher

Return type:

ECal.ReminderWatcher

Creates a new ECal.ReminderWatcher, which will use the registry. It adds its own reference to registry. Free the created ECal.ReminderWatcher with GObject.Object.unref() when no longer needed.

New in version 3.30.

describe_data(rd, flags)
Parameters:
Returns:

a new string with a text description of the rd.

Return type:

str

Returns a new string with a text description of the rd. The text format can be influenced with flags.

Free the returned string with GLib.free(), when no longer needed.

New in version 3.30.

dismiss(rd, cancellable, callback, *user_data)
Parameters:

Asynchronously dismiss single reminder in the past or snoozed reminders.

When the operation is finished, callback will be called. You can then call ECal.ReminderWatcher.dismiss_finish() to get the result of the operation.

New in version 3.30.

dismiss_all(cancellable, callback, *user_data)
Parameters:

Asynchronously dismiss all past reminders.

When the operation is finished, callback will be called. You can then call ECal.ReminderWatcher.dismiss_all_finish() to get the result of the operation.

New in version 3.30.

dismiss_all_finish(result)
Parameters:

result (Gio.AsyncResult) – a Gio.AsyncResult

Raises:

GLib.Error

Returns:

whether succeeded

Return type:

bool

Finishes the operation started with ECal.ReminderWatcher.dismiss_all().

New in version 3.30.

dismiss_all_sync(cancellable)
Parameters:

cancellable (Gio.Cancellable or None) – optional Gio.Cancellable object, or None

Raises:

GLib.Error

Returns:

whether succeeded.

Return type:

bool

Synchronously dismiss all past reminders. The operation stops after the first error is encountered, which can be before all the past reminders are dismissed.

New in version 3.30.

dismiss_finish(result)
Parameters:

result (Gio.AsyncResult) – a Gio.AsyncResult

Raises:

GLib.Error

Returns:

whether succeeded

Return type:

bool

Finishes the operation started with ECal.ReminderWatcher.dismiss().

New in version 3.30.

dismiss_sync(rd, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

whether succeeded

Return type:

bool

Synchronously dismiss single reminder in the past or snoozed reminders.

New in version 3.30.

dup_default_zone()
Returns:

A copy of the currently set default time zone. Free it with GObject.Object.unref(), when no longer needed.

Return type:

ICalGLib.Timezone

New in version 3.30.

dup_past()
Returns:

a newly allocated GLib.SList of the past reminders, or None, when there are none

Return type:

[ECal.ReminderData] or None

Gathers a GLib.SList of all past reminders which had not been removed after ECal.ReminderWatcher ::triggered signal. Such reminders are remembered across sessions, until they are dismissed by ECal.ReminderWatcher.dismiss() or its synchronous variant. These reminders can be also snoozed with ECal.ReminderWatcher.snooze(), which removes them from the past reminders into the list of snoozed reminders, see ECal.ReminderWatcher.dup_snoozed().

Free the returned GLib.SList with g_slist_free_full (reminders, ECal.ReminderData.free); when no longer needed.

New in version 3.30.

dup_snoozed()
Returns:

a newly allocated GLib.SList of the snoozed reminders, or None, when there are none

Return type:

[ECal.ReminderData] or None

Gathers a GLib.SList of currently snoozed reminder with ECal.ReminderWatcher.snooze(). The snoozed reminders are remembered across sessions and they are re-triggered when their snooze time elapses, which can move them back to the list of past reminders.

Free the returned GLib.SList with g_slist_free_full (reminders, ECal.ReminderData.free); when no longer needed.

New in version 3.30.

get_registry()
Returns:

an EDataServer.SourceRegistry with which the self had been created

Return type:

EDataServer.SourceRegistry

get_timers_enabled()
Returns:

whether timers are enabled for the self. See ECal.ReminderWatcher.set_timers_enabled() for more information what it means.

Return type:

bool

New in version 3.30.

ref_opened_client(source_uid)
Parameters:

source_uid (str) – an EDataServer.Source UID of the calendar to return

Returns:

a referenced ECal.Client for the source_uid, if any such is opened; None otherwise.

Return type:

ECal.Client or None

New in version 3.30.

set_default_zone(zone)
Parameters:

zone (ICalGLib.Timezone or None) – an ICalGLib.Timezone

Sets the default zone for the self. This is used when calculating trigger times for floating component times. When the zone is None, then sets a UTC time zone.

New in version 3.30.

set_timers_enabled(enabled)
Parameters:

enabled (bool) – a value to set

The self can be used both for scheduling the timers for the reminders and respond to them through the “triggered” signal, or only to listen for changes on the past reminders. The default is to have timers enabled, thus to response to scheduled reminders. Disabling the timers also means there will be less resources needed by the self.

New in version 3.30.

snooze(rd, until)
Parameters:

Snoozes rd until until, which is an absolute time when the rd should be retriggered. This moves the rd from the list of past reminders into the list of snoozed reminders and invokes the “changed” signal.

The until can be a special value 0, to set the time as the event start, if it’s in the future. The function does nothing when the event time is in the past.

New in version 3.30.

timer_elapsed()

Notifies the #watcher that the timer previously scheduled with EReminderWatcherClass::schedule_timer elapsed. This can be used by the descendants which override the default implementation of EReminderWatcherClass::schedule_timer. There is always scheduled only one timer and once it’s elapsed it should be also removed, the same when the EReminderWatcherClass::schedule_timer is called and the previously scheduled timer was not elapsed yet, the previous should be removed first, aka every call to EReminderWatcherClass::schedule_timer replaces any previously scheduled timer.

New in version 3.30.

do_cal_client_connect(source, source_type, wait_for_connected_seconds, cancellable, callback, *user_data) virtual
Parameters:
do_changed() virtual
do_format_time(rd, itt, inout_buffer, buffer_size) virtual
Parameters:
do_schedule_timer(at_time) virtual
Parameters:

at_time (int) –

Signal Details

ECal.ReminderWatcher.signals.changed(reminder_watcher)
Signal Name:

changed

Flags:

RUN_LAST

Parameters:

reminder_watcher (ECal.ReminderWatcher) – The object which received the signal

Signal is emitted when the list of past or snoozed reminders changes. It’s called also when Gio.Settings key for past reminders is notified as changed, because this list is not held in memory.

New in version 3.30.

ECal.ReminderWatcher.signals.format_time(reminder_watcher, rd, itt, inout_buffer, buffer_size)
Signal Name:

format-time

Flags:

ACTION

Parameters:
Returns:

a pointer to a buffer to fill with formatted itt

Return type:

inout_buffer: object

Formats time itt to a string and writes it to inout_buffer, which can hold up to buffer_size bytes. The first character of inout_buffer is the nul-byte when nothing wrote to it yet.

New in version 3.30.

ECal.ReminderWatcher.signals.triggered(reminder_watcher, reminders, snoozed)
Signal Name:

triggered

Flags:

RUN_LAST

Parameters:

Signal is emitted when any reminder is either overdue or triggered.

New in version 3.30.

Property Details

ECal.ReminderWatcher.props.default_zone
Name:

default-zone

Type:

ICalGLib.Timezone

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

An ICalGLib.Timezone to be used as the default time zone.

New in version 3.30.

ECal.ReminderWatcher.props.registry
Name:

registry

Type:

EDataServer.SourceRegistry

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

The EDataServer.SourceRegistry which manages EDataServer.Source instances.

New in version 3.30.

ECal.ReminderWatcher.props.timers_enabled
Name:

timers-enabled

Type:

bool

Default Value:

True

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Whether timers are enabled for the ECal.ReminderWatcher. See ECal.ReminderWatcher.set_timers_enabled() for more information what it means.

Default: True

New in version 3.30.