Use signed tags for releases
[email-reminder.git] / EmailReminder / BirthdayStore.pm
blob5d568c51f5b4dfe3709c25975e97b4519345c9a0
1 # This file is part of Email-Reminder.
3 # Email-Reminder is free software; you can redistribute it and/or
4 # modify it under the terms of the GNU General Public License as
5 # published by the Free Software Foundation; either version 3 of the
6 # License, or (at your option) any later version.
8 # Email-Reminder is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 # General Public License for more details.
13 # You should have received a copy of the GNU General Public License
14 # along with Email-Reminder; if not, write to the Free Software
15 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
16 # 02110-1301, USA.
18 package EmailReminder::BirthdayStore;
20 use strict;
21 use warnings;
23 use Gtk2;
24 use Glib::Object::Subclass
25 Glib::Object::,
26 interfaces => [ Gtk2::TreeModel:: ],
29 use EmailReminder::BirthdayEvent;
30 use EmailReminder::EventStore;
32 use base qw(EmailReminder::EventStore);
34 # Column indices
35 my $EMAIL_INDEX = 3;
37 sub init
39 my ($self) = @_;
41 $self->{TYPE} = EmailReminder::BirthdayEvent->get_type();
42 $self->{NB_COLUMNS} = EmailReminder::BirthdayEvent->get_nb_fields();
44 $self->EmailReminder::EventStore::init();
45 return 1;
48 sub get_event_column
50 my ($self, $event, $col) = @_;
52 if ($col == $EMAIL_INDEX) {
53 return $event->get_email();
55 else {
56 return $self->EmailReminder::YearlyStore::get_event_column($event, $col);
60 sub set_event_column
62 my ($self, $event, $col, $new_value) = @_;
64 if ($col == $EMAIL_INDEX) {
65 $event->set_email($new_value);
67 else {
68 $self->EmailReminder::YearlyStore::set_event_column($event, $col, $new_value);
70 return 1;