2
* alarm-applet.h -- Alarm Clock applet bootstrap
4
* Copyright (C) 2007-2008 Johannes H. Jensen <joh@pseudoberries.com>
6
* This program is free software; you can redistribute it and/or
7
* modify it under the terms of the GNU General Public License
8
* as published by the Free Software Foundation; either version 2
9
* of the License, or (at your option) any later version.
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
16
* You should have received a copy of the GNU General Public License
17
* along with this program; if not, write to the Free Software
18
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21
* Johannes H. Jensen <joh@pseudoberries.com>
24
#ifndef ALARMAPPLET_H_
25
#define ALARMAPPLET_H_
30
#include <libxml/parser.h>
34
#include <glade/glade.h>
35
#include <gdk/gdkkeysyms.h>
36
#include <gconf/gconf-client.h>
38
#include <libgnomevfs/gnome-vfs.h>
39
#include <libgnomevfs/gnome-vfs-application-registry.h>
41
#include <panel-applet.h>
42
#include <panel-applet-gconf.h>
46
typedef struct _AlarmApplet AlarmApplet;
48
gchar *supported_sound_mime_types[];
49
GHashTable *app_command_map;
51
void alarm_applet_label_update (AlarmApplet *applet);
52
void alarm_applet_clear_alarms (AlarmApplet *applet);
56
#include "alarm-gconf.h"
59
#include "list-entry.h"
62
#define ALARM_NAME "Alarm Clock"
63
#define ALARM_ICON "alarm-clock"
64
#define TIMER_ICON "alarm-timer"
65
#define SNOOZE_ICON "alarm-snooze"
66
#define ALARM_GCONF_DIR "/apps/alarm-clock"
67
#define ALARM_SCHEMA_DIR "/schemas/apps/alarm_clock/prefs"
68
#define ALARM_UI_XML ALARM_GLADEDIR "/alarm-clock.glade"
69
#define ALARM_DEF_LABEL _("No alarms")
70
#define ALARM_DEF_SNOOZE 9
77
LABEL_TYPE_INVALID = 0,
84
PanelAppletOrient orient;
88
GtkWidget *icon; /* alarm icon */
89
GtkWidget *label; /* clock label */
90
GtkWidget *box; /* packing box */
92
guint timer_id; /* timer ID for updating the label */
96
Alarm *upcoming_alarm; /* Next upcoming alarm */
98
/* Sounds & apps list */
103
GtkDialog *list_alarms_dialog;
104
GtkListStore *list_alarms_store;
105
GtkTreeView *list_alarms_view;
106
GList *list_alarms_args;
108
/* Open edit alarm dialogs
110
GHashTable *edit_alarm_dialogs;
113
GtkDialog *preferences_dialog;
116
#ifdef HAVE_LIBNOTIFY
117
NotifyNotification *notify;
121
GtkWidget *pref_label_show;
122
GtkWidget *pref_label_type_box;
123
GtkWidget *pref_label_type_time;
124
GtkWidget *pref_label_type_remain;
126
/* Actual preferences data */
128
LabelType label_type;
131
guint listeners [N_GCONF_PREFS];
134
static void set_alarm_time (AlarmApplet *applet, guint hour, guint minute, guint second);
135
//static void time_changed_cb (GtkSpinButton *spinbutton, gpointer data);
137
void alarm_applet_sounds_load (AlarmApplet *applet);
139
void alarm_applet_apps_load (AlarmApplet *applet);
141
void alarm_applet_alarms_load (AlarmApplet *applet);
143
void alarm_applet_alarms_add (AlarmApplet *applet, Alarm *alarm);
145
void alarm_applet_alarms_remove (AlarmApplet *applet, Alarm *alarm);
147
void alarm_applet_destroy (AlarmApplet *applet);
151
#endif /*ALARMAPPLET_H_*/