| 1 | 11 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 2 | 11 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | |||||||||||
| 4 | package Data::ICal::Entry::Todo; | ||||||||||
| 5 | |||||||||||
| 6 | 11 | ▶ | use base qw/Data::ICal::Entry/; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | |||||||||||
| 8 | =head1 NAME | ||||||||||
| 9 | |||||||||||
| 10 | Data::ICal::Entry::Todo - Represents a to-do entry in an iCalendar file | ||||||||||
| 11 | |||||||||||
| 12 | =head1 SYNOPSIS | ||||||||||
| 13 | |||||||||||
| 14 | my $vtodo = Data::ICal::Entry::Todo->new(); | ||||||||||
| 15 | $vtodo->add_properties( | ||||||||||
| 16 | summary => "go to sleep", | ||||||||||
| 17 | status => 'INCOMPLETE', | ||||||||||
| 18 | # Dat*e*::ICal is not a typo here | ||||||||||
| 19 | dtstart => Date::ICal->new( epoch => time )->ical, | ||||||||||
| 20 | ); | ||||||||||
| 21 | |||||||||||
| 22 | $calendar->add_entry($vtodo); | ||||||||||
| 23 | |||||||||||
| 24 | $vtodo->add_entry($alarm); | ||||||||||
| 25 | |||||||||||
| 26 | =head1 DESCRIPTION | ||||||||||
| 27 | |||||||||||
| 28 | A L<Data::ICal::Entry::Todo> object represents a single to-do entry in | ||||||||||
| 29 | an iCalendar file. (Note that the iCalendar RFC refers to entries as | ||||||||||
| 30 | "components".) It is a subclass of L<Data::ICal::Entry> and accepts | ||||||||||
| 31 | all of its methods. | ||||||||||
| 32 | |||||||||||
| 33 | =head1 METHODS | ||||||||||
| 34 | |||||||||||
| 35 | =cut | ||||||||||
| 36 | |||||||||||
| 37 | =head2 ical_entry_type | ||||||||||
| 38 | |||||||||||
| 39 | Returns C<VTODO>, its iCalendar entry name. | ||||||||||
| 40 | |||||||||||
| 41 | =cut | ||||||||||
| 42 | |||||||||||
| 43 | 42 | ▶ | sub ical_entry_type {'VTODO'} | ||||||||
|
Subroutine
ical_entry_type: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 44 | |||||||||||
| 45 | =head2 mandatory_unique_properties | ||||||||||
| 46 | |||||||||||
| 47 | The C<uid> property is mandatory if C<rfc_strict> was passed to | ||||||||||
| 48 | L<Data::ICal/new>. | ||||||||||
| 49 | |||||||||||
| 50 | =cut | ||||||||||
| 51 | |||||||||||
| 52 | 87 | ▶ | sub mandatory_unique_properties { | ||||||||
|
Subroutine
mandatory_unique_properties: called CC=2 SCAR=7.2
Pod
documented
| |||||||||||
| 53 | 87 | my $self = shift; | |||||||||
| 54 | 87 | ▶ | return $self->rfc_strict ? ("uid") : () | ||||||||
|
Branch: 1 branch
| |||||||||||
| 55 | } | ||||||||||
| 56 | |||||||||||
| 57 | =head2 optional_unique_properties | ||||||||||
| 58 | |||||||||||
| 59 | According to the iCalendar standard, the following properties may be | ||||||||||
| 60 | specified at most one time for a to-do item: | ||||||||||
| 61 | |||||||||||
| 62 | class completed created description dtstamp | ||||||||||
| 63 | dtstart geo last-modified location organizer | ||||||||||
| 64 | percent-complete priority recurrence-id sequence status | ||||||||||
| 65 | summary uid url | ||||||||||
| 66 | |||||||||||
| 67 | In addition, C<due> and C<duration> may be specified at most once | ||||||||||
| 68 | each, but not both in the same entry (though this restriction is not | ||||||||||
| 69 | enforced). | ||||||||||
| 70 | |||||||||||
| 71 | Or if C<< vcal10 => 1 >>: | ||||||||||
| 72 | |||||||||||
| 73 | class dcreated completed description dtstart due | ||||||||||
| 74 | last-modified location rnum priority | ||||||||||
| 75 | sequence status summary transp | ||||||||||
| 76 | url uid | ||||||||||
| 77 | |||||||||||
| 78 | =cut | ||||||||||
| 79 | |||||||||||
| 80 | 66 | ▶ | sub optional_unique_properties { | ||||||||
|
Subroutine
optional_unique_properties: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||
| 81 | 66 | my $self = shift; | |||||||||
| 82 | 66 | ▶ | my @ret = $self->rfc_strict ? () : ("uid"); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 83 | 66 | ▶ | if (not $self->vcal10) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 84 | 62 | push @ret, qw( | |||||||||
| 85 | class completed created description dtstamp | ||||||||||
| 86 | dtstart geo last-modified location organizer | ||||||||||
| 87 | percent-complete priority recurrence-id sequence status | ||||||||||
| 88 | summary uid url | ||||||||||
| 89 | |||||||||||
| 90 | due duration | ||||||||||
| 91 | ); | ||||||||||
| 92 | } else { | ||||||||||
| 93 | 4 | push @ret, qw( | |||||||||
| 94 | class dcreated completed description dtstart due | ||||||||||
| 95 | last-modified location rnum priority | ||||||||||
| 96 | sequence status summary transp | ||||||||||
| 97 | url uid | ||||||||||
| 98 | ); | ||||||||||
| 99 | } | ||||||||||
| 100 | 66 | return @ret; | |||||||||
| 101 | } | ||||||||||
| 102 | |||||||||||
| 103 | =head2 optional_repeatable_properties | ||||||||||
| 104 | |||||||||||
| 105 | According to the iCalendar standard, the following properties may be | ||||||||||
| 106 | specified any number of times for a to-do item: | ||||||||||
| 107 | |||||||||||
| 108 | attach attendee categories comment contact | ||||||||||
| 109 | exdate exrule request-status related-to resources | ||||||||||
| 110 | rdate rrule | ||||||||||
| 111 | |||||||||||
| 112 | Or if C<< vcal10 => 1 >>: | ||||||||||
| 113 | |||||||||||
| 114 | aalarm attach attendee categories | ||||||||||
| 115 | dalarm exdate exrule malarm palarm related-to | ||||||||||
| 116 | resources rdate rrule | ||||||||||
| 117 | |||||||||||
| 118 | =cut | ||||||||||
| 119 | |||||||||||
| 120 | 33 | ▶ | sub optional_repeatable_properties { | ||||||||
|
Subroutine
optional_repeatable_properties: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||
| 121 | 33 | my $self = shift; | |||||||||
| 122 | 33 | ▶ | if (not $self->vcal10) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 123 | 31 | qw( | |||||||||
| 124 | attach attendee categories comment contact | ||||||||||
| 125 | exdate exrule request-status related-to resources | ||||||||||
| 126 | rdate rrule | ||||||||||
| 127 | ); | ||||||||||
| 128 | } else { | ||||||||||
| 129 | 2 | qw( | |||||||||
| 130 | aalarm attach attendee categories | ||||||||||
| 131 | dalarm exdate exrule malarm palarm related-to | ||||||||||
| 132 | resources rdate rrule | ||||||||||
| 133 | ); | ||||||||||
| 134 | } | ||||||||||
| 135 | } | ||||||||||
| 136 | |||||||||||
| 137 | =head1 AUTHOR | ||||||||||
| 138 | |||||||||||
| 139 | Best Practical Solutions, LLC E<lt>modules@bestpractical.comE<gt> | ||||||||||
| 140 | |||||||||||
| 141 | =head1 LICENCE AND COPYRIGHT | ||||||||||
| 142 | |||||||||||
| 143 | Copyright (c) 2005 - 2020, Best Practical Solutions, LLC. All rights reserved. | ||||||||||
| 144 | |||||||||||
| 145 | This module is free software; you can redistribute it and/or | ||||||||||
| 146 | modify it under the same terms as Perl itself. See L<perlartistic>. | ||||||||||
| 147 | |||||||||||
| 148 | =cut | ||||||||||
| 149 | |||||||||||
| 150 | 11 | 1; | |||||||||