~ubuntu-branches/ubuntu/lucid/libdata-ical-perl/lucid

« back to all changes in this revision

Viewing changes to lib/Data/ICal/Entry/Alarm/Email.pm

  • Committer: Bazaar Package Importer
  • Author(s): Peter Makholm
  • Date: 2007-12-04 07:39:22 UTC
  • Revision ID: james.westby@ubuntu.com-20071204073922-mosdr2aj4ks656xz
Tags: upstream-0.13+dfsg
ImportĀ upstreamĀ versionĀ 0.13+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
use warnings;
 
2
use strict;
 
3
 
 
4
package Data::ICal::Entry::Alarm::Email;
 
5
 
 
6
use base qw/Data::ICal::Entry/;
 
7
 
 
8
=head1 NAME
 
9
 
 
10
Data::ICal::Entry::Alarm::Email - Represents an emailed alarm in an iCalendar file
 
11
 
 
12
 
 
13
=head1 SYNOPSIS
 
14
 
 
15
    my $valarm = Data::ICal::Entry::Alarm::Audio->new();
 
16
    $valarm->add_properties(
 
17
        attach => [ "basic:ftp://host.com/pub/sounds/bell-01.aud", { fmttype => "audio/basic" } ],
 
18
        # Dat*e*::ICal is not a typo here
 
19
        trigger   => [ Date::ICal->new( epoch => ... )->ical, { value => 'DATE-TIME' } ],
 
20
    );
 
21
 
 
22
    $vevent->add_entry($valarm);
 
23
  
 
24
=head1 DESCRIPTION
 
25
 
 
26
A L<Data::ICal::Entry::Alarm::Email> object represents an emailed alarm attached
 
27
to a todo item or event in an iCalendar file.  (Note that the iCalendar RFC
 
28
refers to entries as "components".)  It is a subclass of L<Data::ICal::Entry>
 
29
and accepts all of its methods.
 
30
 
 
31
The C<attendee> properties are intended as the recipient list of the email; the C<summary>
 
32
as its subject; the C<description> as its body; and the C<attach>  as its attachments.
 
33
 
 
34
=head1 METHODS
 
35
 
 
36
=cut
 
37
 
 
38
=head2 new
 
39
 
 
40
Creates a new L<Data::ICal::Entry::Alarm::Email> object; sets its C<ACTION> property
 
41
to C<EMAIL>.
 
42
 
 
43
=cut
 
44
 
 
45
sub new {
 
46
    my $class = shift;
 
47
    my $self  = $class->SUPER::new(@_);
 
48
    $self->add_property( action => "EMAIL" );
 
49
    return $self;
 
50
}
 
51
 
 
52
=head2 ical_entry_type
 
53
 
 
54
Returns C<VALARM>, its iCalendar entry name.
 
55
 
 
56
=cut
 
57
 
 
58
sub ical_entry_type {'VALARM'}
 
59
 
 
60
=head2 optional_unique_properties
 
61
 
 
62
According to the iCalendar standard, the C<duration> and C<retreat> properties may be specified
 
63
at most one time for an emailed alarm, and if one is specified, the other one must be also,
 
64
though this module does not enforce that restriction.
 
65
 
 
66
=cut
 
67
 
 
68
sub optional_unique_properties {
 
69
    qw(
 
70
        duration repeat
 
71
    );
 
72
}
 
73
 
 
74
=head2 mandatory_unique_properties
 
75
 
 
76
According to the iCalendar standard, the following properties must be specified
 
77
exactly once for an emailed alarm:
 
78
 
 
79
  description summary trigger
 
80
 
 
81
In addition, the C<action> property must be specified exactly once, but the
 
82
module automatically sets it for you.
 
83
 
 
84
=cut
 
85
 
 
86
sub mandatory_unique_properties {
 
87
    qw(
 
88
        action description summary trigger
 
89
    );
 
90
}
 
91
 
 
92
=head2 mandatory_repeatable_properties
 
93
 
 
94
According to the iCalendar standard, the C<attendee> property must be specified
 
95
at least once for an emailed alarm.
 
96
 
 
97
=cut
 
98
 
 
99
sub mandatory_repeatable_properties {
 
100
    qw(
 
101
        attendee
 
102
    );
 
103
}
 
104
 
 
105
=head2 optional_repeatable_properties
 
106
 
 
107
According to the iCalendar standard, the C<attach> property may be specified
 
108
any number of times for an emailed alarm.
 
109
 
 
110
=cut
 
111
 
 
112
sub optional_repeatable_properties {
 
113
    qw(
 
114
        attach
 
115
    );
 
116
}
 
117
 
 
118
=head1 AUTHOR
 
119
 
 
120
Jesse Vincent  C<< <jesse@bestpractical.com> >> with David Glasser and Simon Wistow
 
121
 
 
122
 
 
123
=head1 LICENCE AND COPYRIGHT
 
124
 
 
125
Copyright (c) 2005, Best Practical Solutions, LLC.  All rights reserved.
 
126
 
 
127
This module is free software; you can redistribute it and/or
 
128
modify it under the same terms as Perl itself. See L<perlartistic>.
 
129
 
 
130
 
 
131
=head1 DISCLAIMER OF WARRANTY
 
132
 
 
133
BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
 
134
FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
 
135
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
 
136
PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
 
137
EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 
138
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE
 
139
ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH
 
140
YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL
 
141
NECESSARY SERVICING, REPAIR, OR CORRECTION.
 
142
 
 
143
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
 
144
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
 
145
REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENCE, BE
 
146
LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL,
 
147
OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE
 
148
THE SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
 
149
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
 
150
FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
 
151
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
 
152
SUCH DAMAGES.
 
153
 
 
154
=cut
 
155
 
 
156
1;