File: alarm-applet.h

package info (click to toggle)
alarm-clock-applet 0.3.4-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 1,720 kB
  • sloc: ansic: 5,121; sh: 1,382; makefile: 189
file content (154 lines) | stat: -rw-r--r-- 3,809 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
/*
 * alarm-applet.h -- Alarm Clock applet bootstrap
 *
 * Copyright (C) 2007-2008 Johannes H. Jensen <joh@pseudoberries.com>
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 *
 * Authors:
 * 		Johannes H. Jensen <joh@pseudoberries.com>
 */

#ifndef ALARMAPPLET_H_
#define ALARMAPPLET_H_

#include <string.h>
#include <sys/time.h>
#include <time.h>
#include <libxml/parser.h>

#include <gtk/gtk.h>
#include <glib/gi18n.h>
#include <gdk/gdkkeysyms.h>
#include <gconf/gconf-client.h>
#include <gst/gst.h>
#include <unique/unique.h>

#include <config.h>

#ifdef HAVE_APP_INDICATOR
#include <libappindicator/app-indicator.h>
#endif

G_BEGIN_DECLS

typedef struct _AlarmApplet AlarmApplet;

GHashTable *app_command_map;

void alarm_applet_label_update (AlarmApplet *applet);
void alarm_applet_clear_alarms (AlarmApplet *applet);

#include "alarm.h"
#include "prefs.h"
#include "alarm-gconf.h"
#include "player.h"
#include "util.h"
#include "list-entry.h"
#include "ui.h"

#define ALARM_NAME		 "Alarm Clock"
#define ALARM_ICON 		 "alarm-clock"
#define TIMER_ICON		 "alarm-timer"
#define TRIGGERED_ICON	 "alarm-clock-triggered"
#define ALARM_GCONF_DIR	 "/apps/alarm-clock"
#define ALARM_STD_SNOOZE 9

typedef enum {
	LABEL_TYPE_INVALID = 0,
	LABEL_TYPE_TIME,
	LABEL_TYPE_REMAIN,
} LabelType;

struct _AlarmApplet {
	/* Unique app */
	UniqueApp *unique_app;

    /* User Interface */
    GtkBuilder *ui;

#ifdef HAVE_APP_INDICATOR
    /* App Indicator */
    AppIndicator *app_indicator;
#else
	/* Status Icon */
	GtkStatusIcon *status_icon;
#endif

	/* Status menu */
    GtkWidget *status_menu;
    
	/* Alarms */
	GList	*alarms;
    guint   n_triggered;        // Number of triggered alarms

	/* Sounds & apps list */
	GList *sounds;
	GList *apps;

	/* List-alarms UI */
	AlarmListWindow *list_window;

    /* Alarm settings dialog */
    AlarmSettingsDialog *settings_dialog;
    
	/* Preferences */
	GtkDialog *prefs_dialog;
	GtkWidget *prefs_autostart_check;
    
    guint snooze_mins;

    // Actions on one alarm
    GtkActionGroup *actions_alarm;
    
    GtkAction *action_edit;
    GtkAction *action_delete;
    GtkToggleAction *action_enabled;
    GtkAction *action_stop;
    GtkAction *action_snooze;

    // Global actions
    GtkActionGroup *actions_global;
    GtkAction *action_new;
    GtkAction *action_stop_all;
    GtkAction *action_snooze_all;
    GtkToggleAction *action_toggle_list_win;
    GtkToggleAction *action_toggle_autostart;
    GtkToggleAction *action_toggle_show_label;
};

void alarm_applet_sounds_load (AlarmApplet *applet);

void alarm_applet_apps_load (AlarmApplet *applet);

void alarm_applet_alarms_load (AlarmApplet *applet);

void alarm_applet_alarms_add (AlarmApplet *applet, Alarm *alarm);

void alarm_applet_alarms_remove (AlarmApplet *applet, Alarm *alarm);

guint alarm_applet_alarms_snooze (AlarmApplet *applet);

guint alarm_applet_alarms_stop (AlarmApplet *applet);

void alarm_applet_alarm_snooze (AlarmApplet *applet, Alarm *alarm);

void alarm_applet_alarm_stop (AlarmApplet *applet, Alarm *alarm);

void alarm_applet_destroy (AlarmApplet *applet);

G_END_DECLS

#endif /*ALARMAPPLET_H_*/