~ubuntu-branches/ubuntu/quantal/alarm-clock-applet/quantal

« back to all changes in this revision

Viewing changes to src/alarm-list-window.h

  • Committer: Bazaar Package Importer
  • Author(s): Chow Loong Jin
  • Date: 2010-03-17 09:02:44 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20100317090244-ni0ye04mva2hxe10
Tags: 0.3.0-1
* New upstream release
* debian/control:
  + No change bump of Standards-Version to 3.8.4
  + Update build-deps:
    - Drop libglade, libpanel-applet, libgnomevfs2, libgnome{2,ui}
    - Add libxml2-dev and libunique-dev, intltool
* debian/patches/01_update-alarms-eta,patch:
  + Dropped, applied upstream
* debian/(alarm-clock-applet.1, alarm-clock-applet.manpages):
  + Add manpage for alarm-clock-applet, now that the binary is moved to
    /usr/bin.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * alarms-list.h -- Alarm list window
 
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 ALARM_LIST_WINDOW_H_
 
25
#define ALARM_LIST_WINDOW_H_
 
26
 
 
27
#include <gtk/gtk.h>
 
28
 
 
29
typedef struct _AlarmListWindow AlarmListWindow;
 
30
 
 
31
#include "alarm-applet.h"
 
32
#include "alarm.h"
 
33
 
 
34
typedef enum {
 
35
    COLUMN_ALARM = 0,
 
36
    COLUMN_TYPE,
 
37
    COLUMN_TIME,
 
38
    COLUMN_LABEL,
 
39
    COLUMN_ACTIVE,
 
40
    COLUMN_TRIGGERED,
 
41
    COLUMN_SHOW_ICON,
 
42
    ALARMS_N_COLUMNS
 
43
} AlarmListColumn;
 
44
 
 
45
typedef enum {
 
46
    SORTID_TIME_REMAINING = 0,
 
47
} AlarmSortID;
 
48
 
 
49
struct _AlarmListWindow {
 
50
        AlarmApplet *applet;
 
51
    
 
52
    Alarm *selected_alarm;
 
53
    gboolean reordered;         // Indicates that rows have just been reordered
 
54
    gboolean toggled;           // Indicates that an alarm has just been toggled
 
55
        
 
56
        GtkWindow *window;
 
57
        GtkListStore *model;
 
58
        GtkTreeView *tree_view;
 
59
 
 
60
    GtkWidget *new_button;
 
61
    GtkWidget *edit_button;
 
62
    GtkWidget *delete_button;
 
63
    GtkWidget *enable_button;
 
64
    GtkWidget *stop_button;
 
65
    GtkWidget *snooze_button;
 
66
    GtkWidget *snooze_menu;
 
67
 
 
68
    GtkAccelGroup *accel_group;
 
69
};
 
70
 
 
71
//#define TIME_COL_FORMAT "<span font='Bold 11'>%H:%M:%S</span>"
 
72
// TODO: Does fixing the font size give a11y problems?
 
73
#define TIME_COL_CLOCK_FORMAT "<span font='Bold 11'> %H:%M</span><span font='Bold 7'>:%S</span>"
 
74
#define TIME_COL_TIMER_FORMAT "<span font='Bold 11'>-%H:%M</span><span font='Bold 7'>:%S</span>"
 
75
#define TIME_COL_REPEAT_FORMAT "\n <sup>%s</sup>"
 
76
#define LABEL_COL_FORMAT "%s"
 
77
#define LABEL_COL_TRIGGERED_FORMAT "<b>%s</b>"
 
78
 
 
79
#define CLOCK_FORMAT "%H:%M"
 
80
#define TIMER_FORMAT "-%H:%M"
 
81
 
 
82
#define DELETE_DIALOG_TITLE     _("Delete %s?")
 
83
#define DELETE_DIALOG_TEXT      _("<big>Delete %s <b>%s</b>?</big>")
 
84
#define DELETE_DIALOG_SECONDARY _("Are you sure you want to delete the %s labeled <b>%s</b> scheduled at <b>%s</b>? This action cannot be undone.")
 
85
 
 
86
AlarmListWindow *
 
87
alarm_list_window_new (AlarmApplet *applet);
 
88
 
 
89
void
 
90
alarm_list_window_show (AlarmListWindow *list_window);
 
91
 
 
92
void
 
93
alarm_list_window_hide (AlarmListWindow *list_window);
 
94
 
 
95
void
 
96
alarm_list_window_toggle (AlarmListWindow *list_window);
 
97
 
 
98
void
 
99
alarm_list_window_alarm_add (AlarmListWindow *list_window, Alarm *alarm);
 
100
 
 
101
void
 
102
alarm_list_window_alarm_update (AlarmListWindow *list_window, Alarm *alarm);
 
103
 
 
104
void
 
105
alarm_list_window_alarm_remove (AlarmListWindow *list_window, Alarm *alarm);
 
106
 
 
107
void
 
108
alarm_list_window_alarms_add (AlarmListWindow *list_window, GList *alarms);
 
109
 
 
110
gboolean
 
111
alarm_list_window_find_alarm (GtkTreeModel *model, Alarm *alarm, GtkTreeIter *iter);
 
112
 
 
113
gboolean
 
114
alarm_list_window_contains (AlarmListWindow *list_window, Alarm *alarm);
 
115
 
 
116
Alarm *
 
117
alarm_list_window_get_selected_alarm (AlarmListWindow *list_window);
 
118
 
 
119
#endif /*ALARM_LIST_WINDOW_H_*/