~ubuntu-branches/debian/sid/alarm-clock-applet/sid

« back to all changes in this revision

Viewing changes to src/alarm-applet.h

  • Committer: Bazaar Package Importer
  • Author(s): Chow Loong Jin
  • Date: 2009-05-30 23:24:27 UTC
  • Revision ID: james.westby@ubuntu.com-20090530232427-88on1j2ily4ajxdz
Tags: upstream-0.2.6
ImportĀ upstreamĀ versionĀ 0.2.6

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * alarm-applet.h -- Alarm Clock applet bootstrap
 
3
 *
 
4
 * Copyright (C) 2007-2008 Johannes H. Jensen <joh@pseudoberries.com>
 
5
 *
 
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.
 
10
 *
 
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.
 
15
 *
 
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.
 
19
 *
 
20
 * Authors:
 
21
 *              Johannes H. Jensen <joh@pseudoberries.com>
 
22
 */
 
23
 
 
24
#ifndef ALARMAPPLET_H_
 
25
#define ALARMAPPLET_H_
 
26
 
 
27
#include <string.h>
 
28
#include <sys/time.h>
 
29
#include <time.h>
 
30
#include <libxml/parser.h>
 
31
 
 
32
#include <gtk/gtk.h>
 
33
#include <gnome.h>
 
34
#include <glade/glade.h>
 
35
#include <gdk/gdkkeysyms.h>
 
36
#include <gconf/gconf-client.h>
 
37
#include <gst/gst.h>
 
38
#include <libgnomevfs/gnome-vfs.h>
 
39
#include <libgnomevfs/gnome-vfs-application-registry.h>
 
40
 
 
41
#include <panel-applet.h>
 
42
#include <panel-applet-gconf.h>
 
43
 
 
44
G_BEGIN_DECLS
 
45
 
 
46
typedef struct _AlarmApplet AlarmApplet;
 
47
 
 
48
gchar *supported_sound_mime_types[];
 
49
GHashTable *app_command_map;
 
50
 
 
51
void alarm_applet_label_update (AlarmApplet *applet);
 
52
void alarm_applet_clear_alarms (AlarmApplet *applet);
 
53
 
 
54
#include "alarm.h"
 
55
#include "prefs.h"
 
56
#include "alarm-gconf.h"
 
57
#include "player.h"
 
58
#include "util.h"
 
59
#include "list-entry.h"
 
60
#include "ui.h"
 
61
 
 
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
 
71
 
 
72
#ifndef VERSION
 
73
#define VERSION "0.1"
 
74
#endif
 
75
 
 
76
typedef enum {
 
77
        LABEL_TYPE_INVALID = 0,
 
78
        LABEL_TYPE_TIME,
 
79
        LABEL_TYPE_REMAIN,
 
80
} LabelType;
 
81
 
 
82
struct _AlarmApplet {
 
83
        PanelApplet *parent;
 
84
        PanelAppletOrient orient;
 
85
        gchar *gconf_dir;
 
86
 
 
87
        /* Panel UI */
 
88
        GtkWidget *icon;        /* alarm icon */
 
89
        GtkWidget *label;       /* clock label */
 
90
        GtkWidget *box;         /* packing box */
 
91
 
 
92
        guint timer_id;         /* timer ID for updating the label */
 
93
 
 
94
        /* Alarms */
 
95
        GList   *alarms;
 
96
        Alarm   *upcoming_alarm;        /* Next upcoming alarm */
 
97
 
 
98
        /* Sounds & apps list */
 
99
        GList *sounds;
 
100
        GList *apps;
 
101
 
 
102
        /* List-alarms UI */
 
103
        GtkDialog *list_alarms_dialog;
 
104
        GtkListStore *list_alarms_store;
 
105
        GtkTreeView *list_alarms_view;
 
106
        GList *list_alarms_args;
 
107
 
 
108
        /* Open edit alarm dialogs
 
109
         * Hashed by ID */
 
110
        GHashTable *edit_alarm_dialogs;
 
111
 
 
112
        /* Preferences */
 
113
        GtkDialog *preferences_dialog;
 
114
 
 
115
        /* Notification */
 
116
#ifdef HAVE_LIBNOTIFY
 
117
        NotifyNotification *notify;
 
118
#endif
 
119
 
 
120
        /* Label */
 
121
        GtkWidget *pref_label_show;
 
122
        GtkWidget *pref_label_type_box;
 
123
        GtkWidget *pref_label_type_time;
 
124
        GtkWidget *pref_label_type_remain;
 
125
 
 
126
        /* Actual preferences data */
 
127
        gboolean show_label;
 
128
        LabelType label_type;
 
129
 
 
130
        /* GConf */
 
131
        guint listeners [N_GCONF_PREFS];
 
132
};
 
133
 
 
134
static void set_alarm_time (AlarmApplet *applet, guint hour, guint minute, guint second);
 
135
//static void time_changed_cb (GtkSpinButton *spinbutton, gpointer data);
 
136
 
 
137
void alarm_applet_sounds_load (AlarmApplet *applet);
 
138
 
 
139
void alarm_applet_apps_load (AlarmApplet *applet);
 
140
 
 
141
void alarm_applet_alarms_load (AlarmApplet *applet);
 
142
 
 
143
void alarm_applet_alarms_add (AlarmApplet *applet, Alarm *alarm);
 
144
 
 
145
void alarm_applet_alarms_remove (AlarmApplet *applet, Alarm *alarm);
 
146
 
 
147
void alarm_applet_destroy (AlarmApplet *applet);
 
148
 
 
149
G_END_DECLS
 
150
 
 
151
#endif /*ALARMAPPLET_H_*/