Main Page | Data Structures | File List | Data Fields | Globals

event.c File Reference

#include <glib.h>
#include <glib-object.h>
#include "include/alarm_event.h"
#include "queue.h"
#include "event.h"
#include "action.h"
#include "debug.h"

Include dependency graph for event.c:

Go to the source code of this file.

Defines

#define ALARMD_EVENT_GET_PRIVATE(obj)

Typedefs

typedef _AlarmdEventPrivate AlarmdEventPrivate

Enumerations

enum  signals {
  SIGNAL_FIRE,
  SIGNAL_CANCEL,
  SIGNAL_ACKNOWLEDGE,
  SIGNAL_SNOOZE,
  SIGNAL_QUEUE,
  SIGNAL_DEQUEUE,
  SIGNAL_COUNT
}
enum  properties {
  PROP_ACTION = 1,
  PROP_TIME,
  PROP_SNOOZE_INT,
  PROP_SNOOZE,
  PROP_COOKIE,
  PROP_QUEUE
}
enum  saved_props {
  S_ACTION,
  S_TIME,
  S_SNOOZE_INT,
  S_SNOOZE,
  S_COOKIE,
  S_COUNT
}

Functions

static void alarmd_event_init (AlarmdEvent *event)
static void alarmd_event_class_init (AlarmdEventClass *klass)
static void _alarmd_event_set_property (GObject *object, guint param_id, const GValue *value, GParamSpec *pspec)
static void _alarmd_event_get_property (GObject *object, guint param_id, GValue *value, GParamSpec *pspec)
static void _alarmd_event_real_fire (AlarmdEvent *event, gboolean delayed)
static void _alarmd_event_fired (AlarmdEvent *event, gboolean delayed)
static void _alarmd_event_real_cancel (AlarmdEvent *event)
static void _alarmd_event_real_acknowledge (AlarmdEvent *event)
static void _alarmd_event_real_snooze (AlarmdEvent *event)
static void _alarmd_event_real_queue (AlarmdEvent *event, TimerPlugin *plugin)
static void _alarmd_event_real_dequeue (AlarmdEvent *event)
static void _alarmd_event_real_dequeued (AlarmdEvent *event)
static time_t _alarmd_event_real_get_time (AlarmdEvent *event)
static gint32 _alarmd_event_real_get_flags (AlarmdEvent *event)
static void _alarmd_event_finalize (GObject *object)
static void _alarmd_event_changed (AlarmdEvent *event, gpointer user_data)
static GSList * _alarmd_event_get_saved_properties (void)
static void _alarmd_event_action_acknowledge (AlarmdEvent *event, guint ack_type, AlarmdAction *action)
static gboolean _alarmd_event_real_need_power_up (AlarmdEvent *event)
static void _alarmd_event_time_changed (AlarmdObject *object)
GType alarmd_event_get_type (void)
 AlarmdEvent::snooze: : The AlarmdEvent that is being snoozed.
AlarmdEventalarmd_event_new (void)
 alarmd_event_new:
void alarmd_event_fire (AlarmdEvent *event, gboolean delayed)
 alarmd_event_fire: : Event that should be fired.
void alarmd_event_cancel (AlarmdEvent *event)
 alarmd_event_cancel: : Event that should be cancelled.
void alarmd_event_acknowledge (AlarmdEvent *event)
 alarmd_event_acknowledge: : Event that should be acknowledged.
void alarmd_event_snooze (AlarmdEvent *event)
 alarmd_event_snooze: : Event that should be snoozed.
void alarmd_event_queue (AlarmdEvent *event, TimerPlugin *plugin)
 alarmd_event_queue: : Event that should be put on a timer.
void alarmd_event_dequeue (AlarmdEvent *event)
 alarmd_event_dequeue: : Event that should be taken off a timer.
time_t alarmd_event_get_time (AlarmdEvent *event)
 alarmd_event_get_time: : AlarmdEvent to get the time from.
gboolean alarmd_event_need_power_up (AlarmdEvent *event)
 alarmd_event_need_power_up: : The AlarmdEvent that is being queried.
gint32 alarmd_event_get_flags (AlarmdEvent *event)
 alarmd_event_get_flags: : The AlarmdEvent that is being queried.

Variables

static const time_t _day_in_seconds = 24 * 60 * 60
 This file is part of alarmd.
static const gchar *const saved_properties [S_COUNT]
static guint event_signals [SIGNAL_COUNT]


Define Documentation

#define ALARMD_EVENT_GET_PRIVATE obj   ) 
 

Value:

(G_TYPE_INSTANCE_GET_PRIVATE ((obj), \
                              ALARMD_TYPE_EVENT, AlarmdEventPrivate));

Definition at line 113 of file event.c.

Referenced by _alarmd_event_action_acknowledge(), _alarmd_event_finalize(), _alarmd_event_fired(), _alarmd_event_get_property(), _alarmd_event_real_cancel(), _alarmd_event_real_dequeue(), _alarmd_event_real_dequeued(), _alarmd_event_real_fire(), _alarmd_event_real_get_flags(), _alarmd_event_real_get_time(), _alarmd_event_real_need_power_up(), _alarmd_event_real_queue(), _alarmd_event_real_snooze(), _alarmd_event_set_property(), _alarmd_event_time_changed(), and alarmd_event_init().


Typedef Documentation

typedef struct _AlarmdEventPrivate AlarmdEventPrivate
 

Definition at line 99 of file event.c.


Enumeration Type Documentation

enum properties
 

Enumeration values:
PROP_ACTION 
PROP_TIME 
PROP_SNOOZE_INT 
PROP_SNOOZE 
PROP_COOKIE 
PROP_QUEUE 

Definition at line 70 of file event.c.

enum saved_props
 

Enumeration values:
S_ACTION 
S_TIME 
S_SNOOZE_INT 
S_SNOOZE 
S_COOKIE 
S_COUNT 

Definition at line 79 of file event.c.

enum signals
 

Enumeration values:
SIGNAL_FIRE 
SIGNAL_CANCEL 
SIGNAL_ACKNOWLEDGE 
SIGNAL_SNOOZE 
SIGNAL_QUEUE 
SIGNAL_DEQUEUE 
SIGNAL_COUNT 

Definition at line 60 of file event.c.


Function Documentation

static void _alarmd_event_action_acknowledge AlarmdEvent event,
guint  ack_type,
AlarmdAction action
[static]
 

Definition at line 346 of file event.c.

References ACK_NORMAL, _AlarmdEventPrivate::action, _AlarmdEventPrivate::action_acknowledged_signal, ALARMD_EVENT_GET_PRIVATE, ALARMD_OBJECT, ENTER_FUNC, event_signals, LEAVE_FUNC, SIGNAL_ACKNOWLEDGE, and SIGNAL_SNOOZE.

Referenced by _alarmd_event_real_fire().

static void _alarmd_event_changed AlarmdEvent event,
gpointer  user_data
[static]
 

Definition at line 537 of file event.c.

References ALARMD_OBJECT, alarmd_object_changed(), ENTER_FUNC, and LEAVE_FUNC.

Referenced by _alarmd_event_set_property().

static void _alarmd_event_finalize GObject *  object  )  [static]
 

Definition at line 643 of file event.c.

References _AlarmdEventPrivate::action, _AlarmdEventPrivate::alarm_time, ALARMD_EVENT_GET_PRIVATE, ALARMD_TYPE_EVENT, DEBUG, ENTER_FUNC, LEAVE_FUNC, _AlarmdEventPrivate::queue, and _AlarmdEventPrivate::queued.

Referenced by alarmd_event_class_init().

static void _alarmd_event_fired AlarmdEvent event,
gboolean  delayed
[static]
 

Definition at line 399 of file event.c.

References alarmd_event_fire(), ALARMD_EVENT_GET_PRIVATE, DEBUG, ENTER_FUNC, LEAVE_FUNC, and _AlarmdEventPrivate::queued.

Referenced by _alarmd_event_real_queue().

static void _alarmd_event_get_property GObject *  object,
guint  param_id,
GValue *  value,
GParamSpec *  pspec
[static]
 

Definition at line 608 of file event.c.

References _AlarmdEventPrivate::action, _AlarmdEventPrivate::alarm_time, ALARMD_EVENT_GET_PRIVATE, _AlarmdEventPrivate::cookie, ENTER_FUNC, LEAVE_FUNC, PROP_ACTION, PROP_COOKIE, PROP_QUEUE, PROP_SNOOZE, PROP_SNOOZE_INT, PROP_TIME, _AlarmdEventPrivate::queue, _AlarmdEventPrivate::snooze, and _AlarmdEventPrivate::snooze_interval.

Referenced by alarmd_event_class_init().

static GSList * _alarmd_event_get_saved_properties void   )  [static]
 

Definition at line 662 of file event.c.

References ALARMD_OBJECT_CLASS, ALARMD_TYPE_EVENT, ENTER_FUNC, LEAVE_FUNC, S_COUNT, and saved_properties.

Referenced by alarmd_event_class_init().

static void _alarmd_event_real_acknowledge AlarmdEvent event  )  [static]
 

Definition at line 448 of file event.c.

References ALARMD_OBJECT, ENTER_FUNC, event_signals, LEAVE_FUNC, and SIGNAL_CANCEL.

Referenced by alarmd_event_class_init().

static void _alarmd_event_real_cancel AlarmdEvent event  )  [static]
 

Definition at line 413 of file event.c.

References ALARMD_EVENT_GET_PRIVATE, DEBUG, ENTER_FUNC, LEAVE_FUNC, _AlarmdEventPrivate::queued, and _TimerPlugin::remove_event.

Referenced by alarmd_event_class_init().

static void _alarmd_event_real_dequeue AlarmdEvent event  )  [static]
 

Definition at line 502 of file event.c.

References ALARMD_EVENT_GET_PRIVATE, DEBUG, ENTER_FUNC, LEAVE_FUNC, _AlarmdEventPrivate::queued, and _TimerPlugin::remove_event.

Referenced by alarmd_event_class_init().

static void _alarmd_event_real_dequeued AlarmdEvent event  )  [static]
 

Definition at line 486 of file event.c.

References alarmd_event_dequeue(), ALARMD_EVENT_GET_PRIVATE, DEBUG, ENTER_FUNC, LEAVE_FUNC, and _AlarmdEventPrivate::queued.

Referenced by _alarmd_event_real_queue().

static void _alarmd_event_real_fire AlarmdEvent event,
gboolean  delayed
[static]
 

Definition at line 361 of file event.c.

References _alarmd_event_action_acknowledge(), _day_in_seconds, _AlarmdEventPrivate::action, _AlarmdEventPrivate::action_acknowledged_signal, ALARM_EVENT_POSTPONE_DELAYED, _AlarmdEventPrivate::alarm_time, alarmd_action_run(), ALARMD_EVENT_GET_PRIVATE, ALARMD_OBJECT, ENTER_FUNC, event_signals, LEAVE_FUNC, and SIGNAL_ACKNOWLEDGE.

Referenced by alarmd_event_class_init().

static gint32 _alarmd_event_real_get_flags AlarmdEvent event  )  [static]
 

Definition at line 523 of file event.c.

References _AlarmdEventPrivate::action, ALARMD_EVENT_GET_PRIVATE, ENTER_FUNC, and LEAVE_FUNC.

Referenced by alarmd_event_class_init().

static time_t _alarmd_event_real_get_time AlarmdEvent event  )  [static]
 

Definition at line 514 of file event.c.

References _AlarmdEventPrivate::alarm_time, ALARMD_EVENT_GET_PRIVATE, ENTER_FUNC, LEAVE_FUNC, and _AlarmdEventPrivate::snooze.

Referenced by alarmd_event_class_init().

static gboolean _alarmd_event_real_need_power_up AlarmdEvent event  )  [static]
 

Definition at line 675 of file event.c.

References _AlarmdEventPrivate::action, alarmd_action_need_power_up(), ALARMD_EVENT_GET_PRIVATE, ENTER_FUNC, and LEAVE_FUNC.

Referenced by alarmd_event_class_init().

static void _alarmd_event_real_queue AlarmdEvent event,
TimerPlugin plugin
[static]
 

Definition at line 455 of file event.c.

References _alarmd_event_fired(), _alarmd_event_real_dequeued(), ALARMD_EVENT_GET_PRIVATE, alarmd_event_get_time(), DEBUG, ENTER_FUNC, LEAVE_FUNC, _AlarmdEventPrivate::queued, _TimerPlugin::remove_event, and _TimerPlugin::set_event.

Referenced by alarmd_event_class_init().

static void _alarmd_event_real_snooze AlarmdEvent event  )  [static]
 

Definition at line 425 of file event.c.

References _AlarmdEventPrivate::alarm_time, ALARMD_EVENT_GET_PRIVATE, ALARMD_OBJECT, alarmd_object_changed(), ENTER_FUNC, LEAVE_FUNC, _AlarmdEventPrivate::queue, _AlarmdEventPrivate::snooze, and _AlarmdEventPrivate::snooze_interval.

Referenced by alarmd_event_class_init().

static void _alarmd_event_set_property GObject *  object,
guint  param_id,
const GValue *  value,
GParamSpec *  pspec
[static]
 

Definition at line 546 of file event.c.

References _alarmd_event_changed(), _AlarmdEventPrivate::action, _AlarmdEventPrivate::action_changed_signal, _AlarmdEventPrivate::alarm_time, ALARMD_EVENT_GET_PRIVATE, ALARMD_OBJECT, alarmd_object_changed(), alarmd_queue_remove_event(), _AlarmdEventPrivate::cookie, DEBUG, ENTER_FUNC, LEAVE_FUNC, PROP_ACTION, PROP_COOKIE, PROP_QUEUE, PROP_SNOOZE, PROP_SNOOZE_INT, PROP_TIME, _AlarmdEventPrivate::queue, _AlarmdEventPrivate::snooze, and _AlarmdEventPrivate::snooze_interval.

Referenced by alarmd_event_class_init().

static void _alarmd_event_time_changed AlarmdObject object  )  [static]
 

Definition at line 689 of file event.c.

References ALARMD_EVENT, alarmd_event_fire(), ALARMD_EVENT_GET_PRIVATE, alarmd_event_get_time(), ENTER_FUNC, LEAVE_FUNC, and _AlarmdEventPrivate::queued.

Referenced by alarmd_event_class_init().

void alarmd_event_acknowledge AlarmdEvent event  ) 
 

alarmd_event_acknowledge: : Event that should be acknowledged.

Emits a #AlarmdEvent::acknowledge signal on the given .

Definition at line 169 of file event.c.

References ALARMD_OBJECT, ENTER_FUNC, event_signals, LEAVE_FUNC, and SIGNAL_ACKNOWLEDGE.

void alarmd_event_cancel AlarmdEvent event  ) 
 

alarmd_event_cancel: : Event that should be cancelled.

Emits a #AlarmdEvent::cancel signal on the given .

Definition at line 162 of file event.c.

References ALARMD_OBJECT, ENTER_FUNC, event_signals, LEAVE_FUNC, and SIGNAL_CANCEL.

Referenced by _alarmd_event_recurring_real_acknowledge(), and _alarmd_queue_real_remove_event().

static void alarmd_event_class_init AlarmdEventClass klass  )  [static]
 

Definition at line 222 of file event.c.

References _alarmd_event_finalize(), _alarmd_event_get_property(), _alarmd_event_get_saved_properties(), _alarmd_event_real_acknowledge(), _alarmd_event_real_cancel(), _alarmd_event_real_dequeue(), _alarmd_event_real_fire(), _alarmd_event_real_get_flags(), _alarmd_event_real_get_time(), _alarmd_event_real_need_power_up(), _alarmd_event_real_queue(), _alarmd_event_real_snooze(), _alarmd_event_set_property(), _alarmd_event_time_changed(), _AlarmdEventClass::acknowledge, ALARMD_OBJECT_CLASS, ALARMD_TYPE_ACTION, ALARMD_TYPE_QUEUE, _AlarmdEventClass::cancel, _AlarmdEventClass::dequeue, ENTER_FUNC, event_signals, _AlarmdEventClass::fire, _AlarmdEventClass::get_flags, _AlarmdObjectClass::get_saved_properties, _AlarmdEventClass::get_time, LEAVE_FUNC, _AlarmdEventClass::need_power_up, PROP_ACTION, PROP_COOKIE, PROP_QUEUE, PROP_SNOOZE, PROP_SNOOZE_INT, PROP_TIME, _AlarmdEventClass::queue, SIGNAL_ACKNOWLEDGE, SIGNAL_CANCEL, SIGNAL_DEQUEUE, SIGNAL_FIRE, SIGNAL_QUEUE, SIGNAL_SNOOZE, _AlarmdEventClass::snooze, and _AlarmdObjectClass::time_changed.

Referenced by alarmd_event_get_type().

void alarmd_event_dequeue AlarmdEvent event  ) 
 

alarmd_event_dequeue: : Event that should be taken off a timer.

Emits a #AlarmdEvent::dequeue signal on the given .

Definition at line 190 of file event.c.

References ALARMD_OBJECT, ENTER_FUNC, event_signals, LEAVE_FUNC, and SIGNAL_DEQUEUE.

Referenced by _alarmd_event_real_dequeued(), _alarmd_queue_event_changed(), _alarmd_queue_real_add_event(), and _alarmd_queue_set_property().

void alarmd_event_fire AlarmdEvent event,
gboolean  delayed
 

alarmd_event_fire: : Event that should be fired.

: TRUE if the event is fired delayed.

Emits a #AlarmdEvent::fire signal on the given .

Definition at line 155 of file event.c.

References ALARMD_OBJECT, ENTER_FUNC, event_signals, LEAVE_FUNC, and SIGNAL_FIRE.

Referenced by _alarmd_event_fired(), and _alarmd_event_time_changed().

gint32 alarmd_event_get_flags AlarmdEvent event  ) 
 

alarmd_event_get_flags: : The AlarmdEvent that is being queried.

Queries an event for its flags. Returns: The bitfield for the flags.

Definition at line 712 of file event.c.

References ALARMD_EVENT_GET_CLASS, ENTER_FUNC, _AlarmdEventClass::get_flags, and LEAVE_FUNC.

Referenced by _alarmd_queue_real_query_events().

time_t alarmd_event_get_time AlarmdEvent event  ) 
 

alarmd_event_get_time: : AlarmdEvent to get the time from.

Gets the next time an event should be run. Returns: The time that the event should next be run.

Definition at line 197 of file event.c.

References ALARMD_EVENT_GET_CLASS, ENTER_FUNC, _AlarmdEventClass::get_time, and LEAVE_FUNC.

Referenced by _alarmd_action_dialog_connected(), _alarmd_action_dialog_run(), _alarmd_event_compare_func(), _alarmd_event_real_queue(), _alarmd_event_recurring_time_changed(), _alarmd_event_time_changed(), _alarmd_queue_real_query_events(), and _real_write_data().

GType alarmd_event_get_type void   ) 
 

AlarmdEvent::snooze: : The AlarmdEvent that is being snoozed.

Whenever an AlarmdEvent is snoozed, a #AlarmdEvent::snooze signal is emitted.

Definition at line 118 of file event.c.

References alarmd_event_class_init(), alarmd_event_init(), and ALARMD_TYPE_OBJECT.

static void alarmd_event_init AlarmdEvent event  )  [static]
 

Definition at line 207 of file event.c.

References _AlarmdEventPrivate::action, _AlarmdEventPrivate::alarm_time, ALARMD_EVENT_GET_PRIVATE, _AlarmdEventPrivate::cookie, ENTER_FUNC, LEAVE_FUNC, _AlarmdEventPrivate::queue, _AlarmdEventPrivate::queued, _AlarmdEventPrivate::snooze, and _AlarmdEventPrivate::snooze_interval.

Referenced by alarmd_event_get_type().

gboolean alarmd_event_need_power_up AlarmdEvent event  ) 
 

alarmd_event_need_power_up: : The AlarmdEvent that is being queried.

Queries an event, if it needs the "power up" feature. Returns: TRUE if the power up feature is needed.

Definition at line 702 of file event.c.

References ALARMD_EVENT_GET_CLASS, ENTER_FUNC, LEAVE_FUNC, and _AlarmdEventClass::need_power_up.

Referenced by _alarmd_queue_find_first_event(), _alarmd_queue_real_add_event(), and _alarmd_queue_set_property().

AlarmdEvent* alarmd_event_new void   ) 
 

alarmd_event_new:

Creates new alarmd event. Returns: Newly created AlarmdEvent

Definition at line 146 of file event.c.

References ALARMD_TYPE_EVENT, ENTER_FUNC, and LEAVE_FUNC.

void alarmd_event_queue AlarmdEvent event,
TimerPlugin plugin
 

alarmd_event_queue: : Event that should be put on a timer.

: The timer the event should be put on.

Emits a #AlarmdEvent::queue signal on the given .

Definition at line 183 of file event.c.

References ALARMD_OBJECT, ENTER_FUNC, event_signals, LEAVE_FUNC, and SIGNAL_QUEUE.

Referenced by _alarmd_queue_event_dequeued().

void alarmd_event_snooze AlarmdEvent event  ) 
 

alarmd_event_snooze: : Event that should be snoozed.

Emits a #AlarmdEvent::snooze signal on the given .

Definition at line 176 of file event.c.

References ALARMD_OBJECT, ENTER_FUNC, event_signals, LEAVE_FUNC, and SIGNAL_SNOOZE.


Variable Documentation

const time_t _day_in_seconds = 24 * 60 * 60 [static]
 

This file is part of alarmd.

Contact Person: David Weinehall <david.weinehall@nokia.com>

Copyright (C) 2006 Nokia Corporation alarmd and libalarm are free software; you can redistribute them and/or modify them under the terms of the GNU Lesser General Public License version 2.1 as published by the Free Software Foundation.

alarmd and libalarm are distributed in the hope that they will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this software; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

Definition at line 30 of file event.c.

Referenced by _alarmd_event_real_fire().

guint event_signals[SIGNAL_COUNT] [static]
 

Definition at line 97 of file event.c.

Referenced by _alarmd_event_action_acknowledge(), _alarmd_event_real_acknowledge(), _alarmd_event_real_fire(), alarmd_event_acknowledge(), alarmd_event_cancel(), alarmd_event_class_init(), alarmd_event_dequeue(), alarmd_event_fire(), alarmd_event_queue(), and alarmd_event_snooze().

const gchar* const saved_properties[S_COUNT] [static]
 

Initial value:

{
        "action",
        "time",
        "snooze_interval",
        "snooze",
        "cookie",
}

Definition at line 88 of file event.c.


Generated on Thu Dec 21 18:23:30 2006 for Alarmd by  doxygen 1.4.2