libdata-ical-perl-0.21+dfsg.orig/0000755000175000017500000000000012213437735014371 5ustar fsfslibdata-ical-perl-0.21+dfsg.orig/README0000644000175000017500000001370111225533622015245 0ustar fsfsNAME Data::ICal - Generates iCalendar (RFC 2445) calendar files INSTALLATION perl Makefile.PL make make test make install SYNOPSIS use Data::ICal; my $calendar = Data::ICal->new(); my $vtodo = Data::ICal::Entry::Todo->new(); $vtodo->add_properties( # ... see Data::ICal::Entry::Todo documentation ); # ... or $calendar = Data::ICal->new(filename => 'foo.ics'); # parse existing file $calendar = Data::ICal->new(data => 'BEGIN:VCALENDAR...'); # parse from scalar $calendar->add_entry($vtodo); print $calendar->as_string; DESCRIPTION A Data::ICal object represents a "VCALENDAR" object as defined in the iCalendar protocol (RFC 2445, MIME type "text/calendar"), as implemented in many popular calendaring programs such as Apple's iCal. Each Data::ICal object is a collection of "entries", which are objects of a subclass of Data::ICal::Entry. The types of entries defined by iCalendar (which refers to them as "components") include events, to-do items, journal entries, free/busy time indicators, and time zone descriptors; in addition, events and to-do items can contain alarm entries. (Currently, Data::ICal only implements to-do items and events.) Data::ICal is a subclass of Data::ICal::Entry; see its manpage for more methods applicable to Data::ICal. METHODS new [ data => $data, ] [ filename => $file ], [ vcal10 => $bool ] Creates a new Data::ICal object. If it is given a filename or data argument is passed, then this parses the content of the file or string into the object. If the "vcal10" flag is passed, parses it according to vCalendar 1.0, not iCalendar 2.0; this in particular impacts the parsing of continuation lines in quoted-printable sections. If a filename or data argument is not passed, this just sets its "VERSION" and "PRODID" properties to "2.0" (or "1.0" if the "vcal10" flag is passed) and the value of the "product_id" method respectively. Returns a false value upon failure to open or parse the file or data; this false value is a Class::ReturnValue object and can be queried as to its "error_message". parse [ data => $data, ] [ filename => $file, ] Parse a ".ics" file or string containing one, and populate $self with its contents. Should only be called once on a given object, and will be automatically called by "new" if you provide arguments to "new". Returns $self on success. Returns a false value upon failure to open or parse the file or data; this false value is a Class::ReturnValue object and can be queried as to its "error_message". ical_entry_type Returns "VCALENDAR", its iCalendar entry name. product_id Returns the product ID used in the calendar's "PRODID" property; you may wish to override this in a subclass for your own application. mandatory_unique_properties According to the iCalendar standard, the following properties must be specified exactly one time for a calendar: prodid version optional_unique_properties According to the iCalendar standard, the following properties may be specified at most one time for a calendar: calscale method DEPENDENCIES Data::ICal requires Class::Accessor, Text::vFile::asData, MIME::QuotedPrint, and Class::ReturnValue. BUGS AND LIMITATIONS Data::ICal does not support time zone daylight or standard entries, so time zone components are basically useless. While Data::ICal tries to check which properties are required and repeatable, this only works in simple cases; it does not check for properties that must either both exist or both not exist, or for mutually exclusive properties. Data::ICal does not check to see if property parameter names are known in general or allowed on the particular property. Data::ICal does not check to see if nested entries are nested properly (alarms in todos and events only, everything else in calendars only). The only property encoding supported by Data::ICal is quoted printable. There is no Data::ICal::Entry::Alarm base class. Please report any bugs or feature requests to "bug-data-ical@rt.cpan.org", or through the web interface at . AUTHOR Jesse Vincent "" with David Glasser, Simon Wistow, and Alex Vandiver LICENCE AND COPYRIGHT Copyright (c) 2005 - 2009, Best Practical Solutions, LLC. All rights reserved. This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic. DISCLAIMER OF WARRANTY BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR, OR CORRECTION. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENCE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. libdata-ical-perl-0.21+dfsg.orig/Changes0000644000175000017500000000545212165124040015656 0ustar fsfsRevision history for Data-ICal 0.21 * Examine properties in consistent order, so tests pass on 5.18 and above 0.20 * Properly restrict the valid properties when iCal version 1.0 (Ashley Willis) 0.19 * Always output the VERSION property first 0.18 * Spelling fixes from Debian (Salvatore Bonaccorso) 0.17 * Allow chaining of methods (H.Merijn Brand) * Allow properties and entries in constructor (H.Merijn Brand) 0.16 * Use \r\n as the newline character, per RFC 3445 * Escaping of \ was being done incorrectly, and tested incorrectly * Remove a useless and incorrect "escape code" * Mention Data::ICal::DateTime (patch from Mark Stosberg) * Update copyright * POD cleanup * Update README from POD * POD nits; mostly reflowing and whitespace fixes * Perltidy 0.15 * Escaping fixes 0.14 * No longer explodes if your .ics file lacks a VERSION property * Perl 5.11 adds additional strictures. Patch from ANDK to deal [rt.cpan.org #34717] 0.13 * We now ignore blank lines in parsed files (by ignoring null properties when adding them to a data structure) * ical2html example script contributed by Tatsuhiko Miyagawa 0.12 * Better handling of properties that should read "0" - Patch from Duncan Forsyth * Removed the note about Google and weird folding behaviour 0.11 Mon Nov 27 12:57:03 EST 2006 * Added the ability to not fold the output, to appease the great Google-monster 0.10 Sun Oct 15 15:55:28 EDT 2006 * Fix the test suite to stop assuming version numbers 0.09 Sun Oct 15 15:49:29 EDT 2006 * Quieted down ::Property when you passed in undef strings. 0.08 Sat Sep 16 14:03:03 BST 2006 * The recur type is defined in section 4.3.10 in RFC2445. This type is separated by comma or semicolon as shown in "description" part of this section; | multiple "recur" values are specified by a COMMA character (US-ASCII decimal 44) separated list of values. | The rule parts are separated from each other by the SEMICOLON character (US-ASCII decimal 59). At the middle of this section, an example is presented; | RRULE:FREQ=MONTHLY;BYDAY=MO,TU,WE,TH,FR;BYSETPOS=-1 See http://www.kanzaki.com/docs/ical/recur.html - Takeru Inoue 0.07 * Doc patches from MARKSTOS * Proper quoting in properties, from MARKSTOS 0.05 Thu Oct 6 20:56:05 EDT 2005 * Fixed a signature file 0.04 Tue Aug 30 05:30:59 EDT 2005 * Better roundtripping to .ics 0.03 Mon Aug 15 16:05:00 EDT 2005 * Can parse strings, not just files (this is an incompatible API change) 0.02 Wed Aug 03 11:25:00 EDT 2005 * Parser support, thanks to Simon Wistow * Full Time Zone support 0.01 Wed Jul 27 11:52:12 EDT 2005 * Initial release libdata-ical-perl-0.21+dfsg.orig/doc/0000755000175000017500000000000012213437735015136 5ustar fsfslibdata-ical-perl-0.21+dfsg.orig/examples/0000755000175000017500000000000012165124375016206 5ustar fsfslibdata-ical-perl-0.21+dfsg.orig/examples/ical2html.pl0000644000175000017500000000777311225501241020423 0ustar fsfs#!/usr/bin/perl # # Contributed by: Tatsuhiko Miyagawa # use strict; use warnings; use Data::ICal; use DateTime; use DateTime::Format::ISO8601; use List::Util qw(min max); use Math::BigInt; my $axis = 15; # 15 minutes my @events = map { my $cal = Data::ICal->new(filename => $_); @{$cal->entries}; } @ARGV; my $iso8601 = DateTime::Format::ISO8601->new; my(%dates, %where); for my $event (@events) { next unless $event->ical_entry_type eq 'VEVENT'; $event->{__dtstart} = $iso8601->parse_datetime( prop($event, 'DTSTART') ); $event->{__dtend} = $iso8601->parse_datetime( prop($event, 'DTEND') ); my $loc = prop($event, 'LOCATION'); push @{$dates{$event->{__dtstart}->ymd}{$loc}}, $event; $where{$loc}++; } for my $date (keys %dates) { for my $loc (keys %{$dates{$date}}) { @{$dates{$date}{$loc}} = sort { $a->{__dtstart} cmp $b->{__dtstart} } @{$dates{$date}{$loc}}; } my @events = values %{$dates{$date}}; my $start = (sort(map $_->[0]->{__dtstart}, @events))[0]; my $end = (sort(map $_->[-1]->{__dtend}, @events))[-1]; my $unit = determine_unit(map @$_, @events); my $output; $output = qq(

) . $start->strftime('%b %d, %Y') . qq(

\n); $output .= qq(\n); my $locmap = location_map(); for my $loc ( sort { $locmap->{$a} <=> $locmap->{$b} } keys %where) { $output .= qq(); } $output .= qq(\n); my $curr = $start->clone; my $fill_slots; while ($curr < $end) { $output .= qq(); if ($curr->delta_ms($start)->minutes % $axis == 0) { use integer; my $row = $axis / $unit; $output .= qq(); } for my $loc ( sort { $locmap->{$a} <=> $locmap->{$b} } keys %where ) { my $event_per_loc = $dates{$date}{$loc}; if ($event_per_loc->[0] && $event_per_loc->[0]->{__dtstart} <= $curr) { use integer; my $event = shift @$event_per_loc; my @stuff = split / \- /, prop($event, 'SUMMARY'); my $author = pop @stuff if @stuff >= 2; my $title = join " - ", @stuff; my $url = prop($event, 'URL'); my $row = $event->{__dtend}->delta_ms($event->{__dtstart})->delta_minutes / $unit; $output .= qq(); $fill_slots->{$loc} = $row - 1; } elsif ($fill_slots->{$loc}) { $fill_slots->{$loc}--; } else { my $next = $event_per_loc->[0] ? $event_per_loc->[0]->{__dtstart} : $end; my $label = $event_per_loc->[0] ? '(break)' : '(empty)'; my $row = $next->delta_ms($curr)->delta_minutes / $unit; $output .= qq(); # break $fill_slots->{$loc} = $row - 1; } } $curr->add( minutes => $unit ); $output .= qq(\n); } $output .= qq(
Time$loc
) . $curr->strftime('%H:%M') . qq(); $output .= qq($title); $output .= qq(
$author) if $author; $output .= qq(
$label
\n); print $output; } sub location_map { return { 'Tsuda Hall' => 0, 'T101+102' => 1, }; } sub determine_unit { my @events = @_; my @dates = sort map { $_->{__dtstart}, $_->{__dtend} } @events; my(@diffs, $prev); for my $date (@dates) { if ($prev) { my $diff = $date->delta_ms($prev); if ($prev and $diff->delta_minutes) { push @diffs, $diff->delta_minutes; } } $prev = $date; } return Math::BigInt::bgcd(@diffs)->numify; } sub prop { my($event, $key) = @_; my $v = $event->property($key) or return; $v->[0]->value; } libdata-ical-perl-0.21+dfsg.orig/SIGNATURE0000644000175000017500000001022012165124376015650 0ustar fsfsThis file contains message digests of all files listed in MANIFEST, signed via the Module::Signature module, version 0.73. To verify the content in this distribution, first make sure you have Module::Signature installed, then type: % cpansign -v It will check each file's integrity, as well as the signature's validity. If "==> Signature verified OK! <==" is not displayed, the distribution may already have been compromised, and you should not run its Makefile.PL or Build.PL. -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 SHA1 b862022b7a735c00ba5e2d55f27d1b9159927877 Changes SHA1 36a4059f46c930b446797d7a6f16110f2be01e91 MANIFEST SHA1 265866090edcc76a436670eb3052042a6af06da3 META.yml SHA1 2e091ae7e52799ba1f315134ce2a2d2bfd703ce0 Makefile.PL SHA1 ec8bde7d78141c610ceeb9f8f74d48dfca294406 README SHA1 53368d91c157d1932b76db94854288903ae7ec59 doc/rfc2445.txt SHA1 1ca8755782cececa8cb19deddbcbe03be8e73cfc examples/ical2html.pl SHA1 06c410f05488c1612ed66b06d3a86b2580581e4a inc/Module/AutoInstall.pm SHA1 8a924add836b60fb23b25c8506d45945e02f42f4 inc/Module/Install.pm SHA1 61ab1dd37e33ddbe155907ce51df8a3e56ac8bbf inc/Module/Install/AutoInstall.pm SHA1 2d0fad3bf255f8c1e7e1e34eafccc4f595603ddc inc/Module/Install/Base.pm SHA1 f0e01fff7d73cd145fbf22331579918d4628ddb0 inc/Module/Install/Can.pm SHA1 7328966e4fda0c8451a6d3850704da0b84ac1540 inc/Module/Install/Fetch.pm SHA1 66d3d335a03492583a3be121a7d888f63f08412c inc/Module/Install/Include.pm SHA1 b62ca5e2d58fa66766ccf4d64574f9e1a2250b34 inc/Module/Install/Makefile.pm SHA1 1aa925be410bb3bfcd84a16985921f66073cc1d2 inc/Module/Install/Metadata.pm SHA1 e4196994fa75e98bdfa2be0bdeeffef66de88171 inc/Module/Install/Win32.pm SHA1 c3a6d0d5b84feb3280622e9599e86247d58b0d18 inc/Module/Install/WriteAll.pm SHA1 9c9428c27ac2a259bdcb8e52139280b447e5519d lib/Data/ICal.pm SHA1 f3e2c835c44cc4653b9c90c0d83dbd98f15ceefa lib/Data/ICal/Entry.pm SHA1 f0cc8271b2e60eec93e87bd05dd462943b13f489 lib/Data/ICal/Entry/Alarm/Audio.pm SHA1 bff66b1c333f650c9f0547cf22eb37926f47592c lib/Data/ICal/Entry/Alarm/Display.pm SHA1 0b7a52987c20ff10eb2d5cd3749b490ccc29b5f8 lib/Data/ICal/Entry/Alarm/Email.pm SHA1 2f541e922a7ef4c8c568052384b8d0581f8704cc lib/Data/ICal/Entry/Alarm/Procedure.pm SHA1 ead91787e4480afc23e8e4a8cab70fc57642872e lib/Data/ICal/Entry/Event.pm SHA1 3db110b20d7305b13a88989fb76036bca9558f0b lib/Data/ICal/Entry/FreeBusy.pm SHA1 e664c1a273a10b050d45a3a3ef53dd41c33231c6 lib/Data/ICal/Entry/Journal.pm SHA1 19e11a8dd9d32eb2d3ba70420ad7ffd641094282 lib/Data/ICal/Entry/TimeZone.pm SHA1 46b0edc6769e166efc32caf47c6f63a9b3e5ecd4 lib/Data/ICal/Entry/TimeZone/Daylight.pm SHA1 25715bf3c06276c0d846abd43c107c0ef4b39455 lib/Data/ICal/Entry/TimeZone/Standard.pm SHA1 e6f2c19ca0ac7687ec65ac0e3686408e266bd42a lib/Data/ICal/Entry/Todo.pm SHA1 cce2044a3f73addd4823c9933617585567e78f3b lib/Data/ICal/Property.pm SHA1 371dc48be4670c99ffa5f732e7d7584465e39edc t/00.load.t SHA1 33d5621be343fcf0a596391bafba78f4b59b04ba t/01.simplegen.t SHA1 0ef26a49106e23a1a99e77f48b18e94a002ca350 t/02.linewrap.t SHA1 7aec87bcc3d62d762a2ec4adfaf120016fa1e3e0 t/03.unknown-props.t SHA1 1b8e8dde570944000c11b1ac7bdfe44bcdda96ab t/04.mandatory-props.t SHA1 e96acd335c8651c924bb2132fd53140fa0423d9c t/05.prop-params.t SHA1 e19a41be80213d3a306738f074992457623aa200 t/06.prop-bad-quote.t SHA1 6a3f262179361be328ae6ba4a6c9b0f63b4fa2b9 t/07.roundtrip.t SHA1 1d27dd46b94878b7494701eb143393f0438675c0 t/08.parse.t SHA1 69fce006e3f65f2dfc3c028126d7052cdc676dbb t/09.mime.t SHA1 e82bdabfb8322259de9c583fc5c161c4a1d0dcd1 t/10.mime-vcal10.t SHA1 b21127ca78036efd5296828b7f9d76c9c2d8f4da t/11.crlf.t SHA1 4296bf4950cffca77098c8c85562c444e9c0f897 t/12.verson1.t SHA1 21854f472cd60fd9ce6f88872691f2a744e0af5e t/ics/badlyformed.ics SHA1 3157614223f00a48699992314b1d48946fc45af7 t/ics/noversion.ics SHA1 7ad07fa3318aec73b0fe97ccbb8caa1d35b63927 t/ics/test.ics SHA1 4ff82f77563bdd06b4aec84830238b4535cfd07a t/ics/version1.ics SHA1 6da39b48ce64b584e4c3274bff96fc76ff484820 t/pod-coverage.t SHA1 0190346d7072d458c8a10a45c19f86db641dcc48 t/pod.t -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iEYEARECAAYFAlHUqP4ACgkQMflWJZZAbqCLcwCgtgO9BEe8svmwHoaewzhtcHSN pbgAoK7JJjT9KPjR+SZeAOfyWZPNa7bg =Tu0E -----END PGP SIGNATURE----- libdata-ical-perl-0.21+dfsg.orig/META.yml0000644000175000017500000000131512165124302015627 0ustar fsfs--- abstract: 'Generates iCalendar (RFC 2445) calendar files' author: - 'Jesse Vincent ' build_requires: ExtUtils::MakeMaker: 6.36 Test::LongString: 0 Test::More: 0 Test::NoWarnings: 0 Test::Warn: 0 configure_requires: ExtUtils::MakeMaker: 6.36 distribution_type: module dynamic_config: 1 generated_by: 'Module::Install version 1.06' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: 1.4 name: Data-ICal no_index: directory: - examples - inc - t requires: Class::Accessor: 0 Class::ReturnValue: 0 MIME::QuotedPrint: 0 Text::vFile::asData: 0 resources: license: http://dev.perl.org/licenses/ version: 0.21 libdata-ical-perl-0.21+dfsg.orig/MANIFEST0000644000175000017500000000223112213437735015520 0ustar fsfsChanges examples/ical2html.pl inc/Module/AutoInstall.pm inc/Module/Install.pm inc/Module/Install/AutoInstall.pm inc/Module/Install/Base.pm inc/Module/Install/Can.pm inc/Module/Install/Fetch.pm inc/Module/Install/Include.pm inc/Module/Install/Makefile.pm inc/Module/Install/Metadata.pm inc/Module/Install/Win32.pm inc/Module/Install/WriteAll.pm lib/Data/ICal.pm lib/Data/ICal/Entry.pm lib/Data/ICal/Entry/Alarm/Audio.pm lib/Data/ICal/Entry/Alarm/Display.pm lib/Data/ICal/Entry/Alarm/Email.pm lib/Data/ICal/Entry/Alarm/Procedure.pm lib/Data/ICal/Entry/Event.pm lib/Data/ICal/Entry/FreeBusy.pm lib/Data/ICal/Entry/Journal.pm lib/Data/ICal/Entry/TimeZone.pm lib/Data/ICal/Entry/TimeZone/Daylight.pm lib/Data/ICal/Entry/TimeZone/Standard.pm lib/Data/ICal/Entry/Todo.pm lib/Data/ICal/Property.pm Makefile.PL MANIFEST This list of files META.yml README SIGNATURE t/00.load.t t/01.simplegen.t t/02.linewrap.t t/03.unknown-props.t t/04.mandatory-props.t t/05.prop-params.t t/06.prop-bad-quote.t t/07.roundtrip.t t/08.parse.t t/09.mime.t t/10.mime-vcal10.t t/11.crlf.t t/12.verson1.t t/ics/badlyformed.ics t/ics/noversion.ics t/ics/test.ics t/ics/version1.ics t/pod-coverage.t t/pod.t libdata-ical-perl-0.21+dfsg.orig/lib/0000755000175000017500000000000012165124375015136 5ustar fsfslibdata-ical-perl-0.21+dfsg.orig/lib/Data/0000755000175000017500000000000012165124375016007 5ustar fsfslibdata-ical-perl-0.21+dfsg.orig/lib/Data/ICal/0000755000175000017500000000000012165124375016617 5ustar fsfslibdata-ical-perl-0.21+dfsg.orig/lib/Data/ICal/Entry.pm0000644000175000017500000004161512165123410020252 0ustar fsfsuse warnings; use strict; package Data::ICal::Entry; use base qw/Class::Accessor/; use Data::ICal::Property; use Carp; use constant CRLF => "\x0d\x0a"; =head1 NAME Data::ICal::Entry - Represents an entry in an iCalendar file =head1 SYNOPSIS my $vtodo = Data::ICal::Entry::Todo->new(); $vtodo->add_property( # ... see Data::ICal::Entry::Todo documentation ); $vtodo->add_properties( ... ); $calendar->add_entry($vtodo); $event->add_entry($alarm); $event->add_entries($alarm1, ...); # or all in one go my $vtodo = Data::ICal::Entry::Todo->new( \%props, \@entries ); =head1 DESCRIPTION A L object represents a single entry in an iCalendar file. (Note that the iCalendar RFC refers to entries as "components".) iCalendar defines several types of entries, such as events and to-do lists; each of these corresponds to a subclass of L (though only to-do lists and events are currently implemented). L should be treated as an abstract base class -- all objects created should be of its subclasses. The entire calendar itself (the L object) is also represented as a L object. Each entry has an entry type (such as C or C), a series of "properties", and possibly some sub-entries. (Only the root L object can have sub-entries, except for alarm entries contained in events and to-dos (not yet implemented).) =head1 METHODS =cut =head2 new Creates a new entry object with no properties or sub-entries. =cut sub new { my $class = shift; my $self = $class->SUPER::new(); # ALLOW passing arguments here! $self->set( properties => {} ); $self->set( entries => [] ); for (@_) { ref $_ eq "HASH" and $self->add_properties( %$_ ); ref $_ eq "ARRAY" and $self->add_entries( @$_ ); } return $self; } =head2 as_string [ crlf => C ] Returns the entry as an appropriately formatted string (with trailing newline). Properties are returned in alphabetical order, with multiple properties of the same name returned in the order added. (Property order is unimportant in iCalendar, and this makes testing easier.) If any mandatory property is missing, issues a warning. The string to use as a newline can optionally be specified by giving the a C argument, which defaults to C<\x0d\x0a>, per RFC 2445 spec; this option is primarily for backwards compatibility with versions of this module before 0.16. =cut sub as_string { my $self = shift; my %args = ( crlf => CRLF, @_ ); my $output = $self->header(%args); for my $name ( $self->mandatory_unique_properties, $self->mandatory_repeatable_properties ) { carp "Mandatory property for " . ( ref $self ) . " missing: $name" unless $self->properties->{$name} and @{ $self->properties->{$name} }; } my @properties = sort { # RFC2445 implies an order (see 4.6 Calendar Components) but does not # require it. However, some applications break if VERSION is not first # (see http://icalvalid.cloudapp.net/Default.aspx and [rt.cpan.org # #65447]). return -1 if $a eq 'version'; return 1 if $b eq 'version'; return $a cmp $b; } keys %{ $self->properties }; for my $name (@properties) { $output .= $_ for map { $_->as_string(%args) } @{ $self->properties->{$name} }; } for my $entry ( @{ $self->entries } ) { $output .= $entry->as_string(%args); } $output .= $self->footer(%args); return $output; } =head2 add_entry $entry Adds an entry to this entry. (According to the standard, this should only be called on either a to-do or event entry with an alarm entry, or on a calendar entry (L) with a to-do, event, journal, timezone, or free/busy entry.) Returns true if the entry was successfully added, and false otherwise (perhaps because you tried to add an entry of an invalid type, but this check hasn't been implemented yet). =cut sub add_entry { my $self = shift; my $entry = shift; push @{ $self->{entries} }, $entry; $entry->vcal10( $self->vcal10 ); return $self; } =head2 add_entries $entry1, [$entry2, ...] Convenience function to call C several times with a list of entries. =cut sub add_entries { my $self = shift; $self->add_entry( $_ ) for @_; return $self; } =head2 entries Returns a reference to the array of subentries of this entry. =cut __PACKAGE__->mk_ro_accessors('entries'); =head2 properties Returns a reference to the hash of properties of this entry. The keys are property names and the values are array references containing L objects. =cut __PACKAGE__->mk_ro_accessors('properties'); =head2 property Given a property name returns a reference to the array of L objects. =cut sub property { my $self = shift; my $prop = lc shift; return $self->{'properties'}->{$prop}; } =head2 add_property $propname => $propval Creates a new L object with name C<$propname> and value C<$propval> and adds it to the event. If the property is not known to exist for that object type and does not begin with C, issues a warning. If the property is known to be unique, replaces the original property. To specify parameters for the property, let C<$propval> be a two-element array reference where the first element is the property value and the second element is a hash reference. The keys of the hash are parameter names; the values should be either strings or array references of strings, depending on whether the parameter should have one or multiple (to be comma-separated) values. Examples of setting parameters: # Add a property with a parameter of VALUE set to 'DATE' $event->add_property( rdate => [ $date, { VALUE => 'DATE' } ] ); =cut sub add_property { my $self = shift; my $prop = lc shift; my $val = shift; return unless defined $prop; unless ( $self->is_property($prop) or $prop =~ /^x-/i ) { carp "Unknown property for " . ( ref $self ) . ": $prop"; } if ( $self->is_unique($prop) ) { # It should be unique, so clear out anything we might have first $self->properties->{$prop} = []; } $val = [ $val, {} ] unless ref $val eq 'ARRAY'; my ( $prop_value, $param_hash ) = @$val; my $p = Data::ICal::Property->new( $prop => $prop_value, $param_hash ); $p->vcal10( $self->vcal10 ); push @{ $self->properties->{$prop} }, $p; return $self; } =head2 add_properties $propname1 => $propval1, [$propname2 => $propname2, ...] Convenience function to call C several times with a list of properties. This method is guaranteed to call add C on them in the order given, so that unique properties given later in the call will take precedence over those given earlier. (This is unrelated to the order of properties when the entry is rendered as a string, though.) Parameters for the properties are specified in the same way as in C. =cut sub add_properties { my $self = shift; if ( @_ % 2 ) { carp "Odd number of elements in add_properties call"; return; } while (@_) { my $prop = shift; my $val = shift; $self->add_property( $prop => $val ); } return $self; } =head2 mandatory_unique_properties Subclasses should override this method (which returns an empty list by default) to provide a list of lower case strings identifying the properties which must appear exactly once in the subclass's entry type. =cut sub mandatory_unique_properties { () } =head2 mandatory_repeatable_properties Subclasses should override this method (which returns an empty list by default) to provide a list of lower case strings identifying the properties which must appear at least once in the subclass's entry type. =cut sub mandatory_repeatable_properties { () } =head2 optional_unique_properties Subclasses should override this method (which returns an empty list by default) to provide a list of lower case strings identifying the properties which must appear at most once in the subclass's entry type. =cut sub optional_unique_properties { () } =head2 optional_repeatable_properties Subclasses should override this method (which returns an empty list by default) to provide a list of lower case strings identifying the properties which may appear zero, one, or more times in the subclass's entry type. =cut sub optional_repeatable_properties { () } =head2 is_property $name Returns a boolean value indicating whether or not the property C<$name> is known to the class (that is, if it's listed in C<(mandatory/optional)_(unique/repeatable)_properties>). =cut sub is_property { my $self = shift; my $name = shift; return scalar grep { $_ eq $name } $self->mandatory_unique_properties, $self->mandatory_repeatable_properties, $self->optional_unique_properties, $self->optional_repeatable_properties; } =head2 is_mandatory $name Returns a boolean value indicating whether or not the property C<$name> is known to the class as mandatory (that is, if it's listed in C). =cut sub is_mandatory { my $self = shift; my $name = shift; return scalar grep { $_ eq $name } $self->mandatory_unique_properties, $self->mandatory_repeatable_properties; } =head2 is_optional $name Returns a boolean value indicating whether or not the property C<$name> is known to the class as optional (that is, if it's listed in C). =cut sub is_optional { my $self = shift; my $name = shift; return scalar grep { $_ eq $name } $self->optional_unique_properties, $self->optional_repeatable_properties; } =head2 is_unique $name Returns a boolean value indicating whether or not the property C<$name> is known to the class as unique (that is, if it's listed in C<(mandatory/optional)_unique_properties>). =cut sub is_unique { my $self = shift; my $name = shift; return scalar grep { $_ eq $name } $self->mandatory_unique_properties, $self->optional_unique_properties; } =head2 is_repeatable $name Returns a boolean value indicating whether or not the property C<$name> is known to the class as repeatable (that is, if it's listed in C<(mandatory/optional)_repeatable_properties>). =cut sub is_repeatable { my $self = shift; my $name = shift; return scalar grep { $_ eq $name } $self->mandatory_repeatable_properties, $self->optional_repeatable_properties; } =head2 ical_entry_type Subclasses should override this method to provide the identifying type name of the entry (such as C or C). =cut sub ical_entry_type {'UNDEFINED'} =head2 vcal10 [$bool] Gets or sets a boolean saying whether this entry should be interpreted as vCalendar 1.0 (as opposed to iCalendar 2.0). Generally, you can just set this on your main L object when you construct it; C automatically makes sure that sub-entries end up with the same value as their parents. =cut __PACKAGE__->mk_accessors('vcal10'); =head2 header Returns the header line for the entry (including trailing newline). =cut sub header { my $self = shift; my %args = ( crlf => CRLF, @_ ); return 'BEGIN:' . $self->ical_entry_type . $args{crlf}; } =head2 footer Returns the footer line for the entry (including trailing newline). =cut sub footer { my $self = shift; my %args = ( crlf => CRLF, @_ ); return 'END:' . $self->ical_entry_type . $args{crlf}; } # mapping of event types to class (under the Data::Ical::Event namespace) my %_generic = ( vevent => 'Event', vtodo => 'Todo', vjournal => 'Journal', vfreebusy => 'FreeBusy', vtimezone => 'TimeZone', standard => 'TimeZone::Standard', daylight => 'TimeZone::Daylight', ); =head2 parse_object Translate a L sub object into the appropriate L subtype. =cut # TODO: this is currently recursive which could blow the stack - # it might be worth refactoring to make it sequential sub parse_object { my ( $self, $object ) = @_; my $type = $object->{type}; my $new_self; # First check to see if it's generic long name just in case there # event turns out to be a VGENERIC entry type if ( my $class = $_generic{ lc($type) } ) { $new_self = $self->_parse_data_ical_generic( $class, $object ); # then look for specific overrides } elsif ( my $sub = $self->can( '_parse_' . lc($type) ) ) { $new_self = $self->$sub($object); # complain } else { warn "Can't parse type $type yet"; return; } # recurse through sub-objects foreach my $sub_object ( @{ $object->{objects} } ) { $new_self->parse_object($sub_object); } return $self; } # special because we want to use ourselves as the parent sub _parse_vcalendar { my ( $self, $object ) = @_; $self->_parse_generic_event( $self, $object ); return $self; } # mapping of action types to class (under the Data::Ical::Event::Alarm namespace) my %_action_map = ( AUDIO => 'Audio', DISPLAY => 'Display', EMAIL => 'Email', PROCEDURE => 'Procedure', ); # alarms have actions sub _parse_valarm { my ( $parent, $object ) = @_; # ick my $action = $object->{properties}->{ACTION}->[0]->{value}; die "Can't parse VALARM with action $action" unless exists $_action_map{$action}; my $alarm_class = "Data::ICal::Entry::Alarm::" . $_action_map{$action}; eval "require $alarm_class"; die "Failed to require $alarm_class : $@" if $@; $alarm_class->import; my $alarm = $alarm_class->new; $parent->_parse_generic_event( $alarm, $object ); $parent->add_entry($alarm); return $alarm; } # generic event handler sub _parse_data_ical_generic { my ( $parent, $class, $object ) = @_; my $entry_class = "Data::ICal::Entry::$class"; eval "require $entry_class"; die "Failed to require $entry_class : $@" if $@; $entry_class->import; my $entry = $entry_class->new; $entry->vcal10($parent->vcal10); $parent->_parse_generic_event( $entry, $object ); $parent->add_entry($entry); return $entry; } # handle transferring of properties sub _parse_generic_event { my ( $parent, $entry, $object ) = @_; my $p = $object->{properties}; for my $key ( sort keys %$p ) { foreach my $occurence (@{ $p->{$key} }) { my $prop; # Unescapes, but only in v2, and not if it's explicitly not TEXT if (not $parent->vcal10 and ( not $occurence->{param} or not defined $occurence->{param}{VALUE} or $occurence->{param}{VALUE} eq "TEXT" ) ) { $occurence->{value} =~ s/\\([;,\\])/$1/g; $occurence->{value} =~ s/\\n/\n/ig; } # handle optional params and 'normal' key/value pairs # TODO: line wrapping? if ( $occurence->{param} ) { $prop = [ $occurence->{value}, $occurence->{param} ]; } else { $prop = $occurence->{value}; } $entry->add_property( lc($key) => $prop ); } } return $entry; } =head1 AUTHOR Jesse Vincent C<< >> with David Glasser, Simon Wistow, and Alex Vandiver =head1 LICENCE AND COPYRIGHT Copyright (c) 2005 - 2009, Best Practical Solutions, LLC. All rights reserved. This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See L. =head1 DISCLAIMER OF WARRANTY BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR, OR CORRECTION. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENCE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. =cut 1; libdata-ical-perl-0.21+dfsg.orig/lib/Data/ICal/Property.pm0000644000175000017500000002330012016754324020775 0ustar fsfsuse warnings; use strict; package Data::ICal::Property; use base qw/Class::Accessor/; use Carp; use MIME::QuotedPrint (); our $VERSION = '0.06'; =head1 NAME Data::ICal::Property - Represents a property on an entry in an iCalendar file =head1 DESCRIPTION A L object represents a single property on an entry in an iCalendar file. Properties have parameters in addition to their value. You shouldn't need to create L values directly -- just use C in L. The C parameter value is only interpreted by L in the C and C methods: all other methods access the encoded version directly (if there is an encoding). Currently, the only supported encoding is C. =head1 METHODS =cut =head2 new $key, $value, [$parameter_hash] Creates a new L with key C<$key> and value C<$value>. If C<$parameter_hash> is provided, sets the property's parameters to it. The parameter hash should have keys equal to the names of the parameters (case insensitive; parameter hashes should not contain two different keys which are the same when converted to upper case); the values should either be a string if the parameter has a single value or an array reference of strings if the parameter has multiple values. =cut sub new { my $class = shift; my $self = {}; bless $self, $class; $self->key(shift); $self->value(shift); $self->parameters( shift || {} ); return ($self); } =head2 key [$key] Gets or sets the key name of this property. =head2 value [$value] Gets or sets the value of this property. =head2 parameters [$param_hash] Gets or sets the parameter hash reference of this property. Parameter keys are converted to upper case. =head2 vcal10 [$bool] Gets or sets a boolean saying whether this should be interpreted as vCalendar 1.0 (as opposed to iCalendar 2.0). Generally, you can just set this on your main L object when you construct it; C automatically makes sure that sub-entries end up with the same value as their parents, and C makes sure that properties end up with the same value as their entry. =cut __PACKAGE__->mk_accessors(qw(key value _parameters vcal10)); sub parameters { my $self = shift; if (@_) { my $params = shift; my $new_params = {}; while ( my ( $k, $v ) = each %$params ) { $new_params->{ uc $k } = $v; } $self->_parameters($new_params); } return $self->_parameters; } my %ENCODINGS = ( 'QUOTED-PRINTABLE' => { encode => sub { my $dec = shift || ''; $dec =~ s/\n/\r\n/g; return MIME::QuotedPrint::encode( $dec, '' ); }, decode => sub { my $dec = MIME::QuotedPrint::decode( shift || '' ); $dec =~ s/\r\n/\n/g; return $dec; } }, ); =head2 decoded_value Gets the value of this property, converted from the encoding specified in its encoding parameter. (That is, C will return the encoded version; this will apply the encoding.) If the encoding is not specified or recognized, just returns the raw value. =cut sub decoded_value { my $self = shift; my $value = $self->value; my $encoding = uc( $self->parameters->{'ENCODING'} || "" ); if ( $ENCODINGS{$encoding} ) { return $ENCODINGS{$encoding}{'decode'}->($value); } else { return $value; } } =head2 encode $encoding Calls C to get the current decoded value, then encodes it in C<$encoding>, sets the value to that, and sets the encoding parameter to C<$encoding>. (C<$encoding> is first converted to upper case.) If C<$encoding> is undef, deletes the encoding parameter and sets the value to the decoded value. Does nothing if the encoding is not recognized. =cut sub encode { my $self = shift; my $encoding = uc shift; my $decoded_value = $self->decoded_value; if ( not defined $encoding ) { $self->value($decoded_value); delete $self->parameters->{'ENCODING'}; } elsif ( $ENCODINGS{$encoding} ) { $self->value( $ENCODINGS{$encoding}{'encode'}->($decoded_value) ); $self->parameters->{'ENCODING'} = $encoding; } return $self; } =head2 as_string ARGS Returns the property formatted as a string (including trailing newline). Takes named arguments: =over =item fold Defaults to true. pass in a false value if you need to generate non-rfc-compliant calendars. =item crlf Defaults to C<\x0d\x0a>, per RFC 2445 spec. This option is primarily for backwards compatibility with version of this module prior to 0.16, which used C<\x0a>. =back =cut sub as_string { my $self = shift; my %args = ( fold => 1, crlf => Data::ICal::Entry->CRLF, @_ ); my $string = uc( $self->key ) . $self->_parameters_as_string . ":" . $self->_value_as_string( $self->key ) . $args{crlf}; # Assumption: the only place in an iCalendar that needs folding are property # lines if ( $args{'fold'} ) { return $self->_fold( $string, $args{crlf} ); } return $string; } =begin private =head2 _value_as_string Returns the property's value as a string. Comma and semicolon are not escaped when the value is recur type (the key is rrule). Values are quoted according the iCal spec, unless this is in vCal 1.0 mode. =end private =cut sub _value_as_string { my $self = shift; my $key = shift; my $value = defined( $self->value() ) ? $self->value() : ''; unless ( $self->vcal10 ) { $value =~ s/\\/\\\\/gs; $value =~ s/;/\\;/gs unless lc($key) eq 'rrule'; $value =~ s/,/\\,/gs unless lc($key) eq 'rrule'; $value =~ s/\x0d?\x0a/\\n/gs; } return $value; } =begin private =head2 _parameters_as_string Returns the property's parameters as a string. Properties are sorted alphabetically to aid testing. =end private =cut sub _parameters_as_string { my $self = shift; my $out = ''; for my $name ( sort keys %{ $self->parameters } ) { my $value = $self->parameters->{$name}; $out .= ';' . $name . '=' . $self->_quoted_parameter_values( ref $value ? @$value : $value ); } return $out; } =begin private =head2 _quoted_parameter_values @values Quotes any of the values in C<@values> that need to be quoted and returns the quoted values joined by commas. If any of the values contains a double-quote, erases it and emits a warning. =end private =cut sub _quoted_parameter_values { my $self = shift; my @values = @_; for my $val (@values) { if ( $val =~ /"/ ) { # Get all the way back to the user's code local $Carp::CarpLevel = $Carp::CarpLevel + 1; carp "Invalid parameter value (contains double quote): $val"; $val =~ tr/"//d; } } return join ',', map { /[;,:]/ ? qq("$_") : $_ } @values; } =begin private =head2 _fold $string $crlf Returns C<$string> folded with newlines and leading whitespace so that each line is at most 75 characters. (Note that it folds at 75 characters, not 75 bytes as specified in the standard.) If this is vCalendar 1.0 and encoded with QUOTED-PRINTABLE, does not fold at all. =end private =cut sub _fold { my $self = shift; my $string = shift; my $crlf = shift; my $quoted_printable = $self->vcal10 && uc( $self->parameters->{'ENCODING'} || '' ) eq 'QUOTED-PRINTABLE'; if ($quoted_printable) { # In old vcal, quoted-printable properties have different folding rules. # But some interop tests suggest it's wiser just to not fold for vcal 1.0 # at all (in quoted-printable). } else { my $pos = 0; # Walk through the value, looking to replace 75 characters at # a time. We assign to pos() to update where to pick up for # the next match. while ( $string =~ s/\G(.{75})(?=.)/$1$crlf / ) { $pos += 75 + length($crlf); pos($string) = $pos; } } return $string; } =head1 AUTHOR Jesse Vincent C<< >> with David Glasser, Simon Wistow, and Alex Vandiver =head1 LICENCE AND COPYRIGHT Copyright (c) 2005 - 2009, Best Practical Solutions, LLC. All rights reserved. This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See L. =head1 DISCLAIMER OF WARRANTY BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR, OR CORRECTION. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENCE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. =cut 1; libdata-ical-perl-0.21+dfsg.orig/lib/Data/ICal/Entry/0000755000175000017500000000000012165124375017720 5ustar fsfslibdata-ical-perl-0.21+dfsg.orig/lib/Data/ICal/Entry/FreeBusy.pm0000644000175000017500000000635111225535473022010 0ustar fsfsuse warnings; use strict; package Data::ICal::Entry::FreeBusy; use base qw/Data::ICal::Entry/; =head1 NAME Data::ICal::Entry::FreeBusy - Represents blocks of free and busy time in an iCalendar file =head1 SYNOPSIS my $vfreebusy = Data::ICal::Entry::FreeBusy->new(); $vfreebusy->add_properties( organizer => 'MAILTO:jsmith@host.com', # Dat*e*::ICal is not a typo here freebusy => Date::ICal->new( epoch => ... )->ical . '/' . Date::ICal->new( epoch => ... )->ical, ); $calendar->add_entry($vfreebusy); =head1 DESCRIPTION A L object represents a request for information about free and busy time or a reponse to such a request, in an iCalendar file. (Note that the iCalendar RFC refers to entries as "components".) It is a subclass of L and accepts all of its methods. =head1 METHODS =cut =head2 ical_entry_type Returns C, its iCalendar entry name. =cut sub ical_entry_type {'VFREEBUSY'} =head2 optional_unique_properties According to the iCalendar standard, the following properties may be specified at most one time for a free/busy entry: contact dtstart dtend duration dtstamp organizer uid url =cut sub optional_unique_properties { qw( contact dtstart dtend duration dtstamp organizer uid url ); } =head2 optional_repeatable_properties According to the iCalendar standard, the following properties may be specified any number of times for free/busy entry: attendee comment freebusy request-status =cut sub optional_repeatable_properties { qw( attendee comment freebusy request-status ); } =head1 AUTHOR Jesse Vincent C<< >> with David Glasser, Simon Wistow, and Alex Vandiver =head1 LICENCE AND COPYRIGHT Copyright (c) 2005 - 2009, Best Practical Solutions, LLC. All rights reserved. This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See L. =head1 DISCLAIMER OF WARRANTY BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR, OR CORRECTION. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENCE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. =cut 1; libdata-ical-perl-0.21+dfsg.orig/lib/Data/ICal/Entry/Journal.pm0000644000175000017500000000665511225535470021702 0ustar fsfsuse warnings; use strict; package Data::ICal::Entry::Journal; use base qw/Data::ICal::Entry/; =head1 NAME Data::ICal::Entry::Journal - Represents a journal entry in an iCalendar file =head1 SYNOPSIS my $vjournal = Data::ICal::Entry::Journal->new(); $vjournal->add_properties( summary => "Minutes of my party", description => "I cried because I wanted to.", # Dat*e*::ICal is not a typo here dtstart => Date::ICal->new( epoch => time )->ical, ); $calendar->add_entry($vjournal); =head1 DESCRIPTION A L object represents a single journal entry in an iCalendar file. (Note that the iCalendar RFC refers to entries as "components".) It is a subclass of L and accepts all of its methods. =head1 METHODS =cut =head2 ical_entry_type Returns C, its iCalendar entry name. =cut sub ical_entry_type {'VJOURNAL'} =head2 optional_unique_properties According to the iCalendar standard, the following properties may be specified at most one time for a journal entry: class created description dtstart dtstamp last-modified organizer recurrence-id sequence status summary uid url =cut sub optional_unique_properties { qw( class created description dtstart dtstamp last-modified organizer recurrence-id sequence status summary uid url ); } =head2 optional_repeatable_properties According to the iCalendar standard, the following properties may be specified any number of times for a journal entry: attach attendee categories comment contact exdate exrule related-to rdate rrule request-status =cut sub optional_repeatable_properties { qw( attach attendee categories comment contact exdate exrule related-to rdate rrule request-status ); } =head1 AUTHOR Jesse Vincent C<< >> with David Glasser, Simon Wistow, and Alex Vandiver =head1 LICENCE AND COPYRIGHT Copyright (c) 2005 - 2009, Best Practical Solutions, LLC. All rights reserved. This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See L. =head1 DISCLAIMER OF WARRANTY BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR, OR CORRECTION. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENCE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. =cut 1; libdata-ical-perl-0.21+dfsg.orig/lib/Data/ICal/Entry/Todo.pm0000644000175000017500000001113612165123102021150 0ustar fsfsuse warnings; use strict; package Data::ICal::Entry::Todo; use base qw/Data::ICal::Entry/; =head1 NAME Data::ICal::Entry::Todo - Represents a to-do entry in an iCalendar file =head1 SYNOPSIS my $vtodo = Data::ICal::Entry::Todo->new(); $vtodo->add_properties( summary => "go to sleep", status => 'INCOMPLETE', # Dat*e*::ICal is not a typo here dtstart => Date::ICal->new( epoch => time )->ical, ); $calendar->add_entry($vtodo); $vtodo->add_entry($alarm); =head1 DESCRIPTION A L object represents a single to-do entry in an iCalendar file. (Note that the iCalendar RFC refers to entries as "components".) It is a subclass of L and accepts all of its methods. =head1 METHODS =cut =head2 ical_entry_type Returns C, its iCalendar entry name. =cut sub ical_entry_type {'VTODO'} =head2 optional_unique_properties According to the iCalendar standard, the following properties may be specified at most one time for a to-do item: class completed created description dtstamp dtstart geo last-modified location organizer percent-complete priority recurrence-id sequence status summary uid url In addition, C and C may be specified at most once each, but not both in the same entry (though this restriction is not enforced). Or if C<< vcal10 => 1 >>: class dcreated completed description dtstart due last-modified location rnum priority sequence status summary transp url uid =cut sub optional_unique_properties { my $self = shift; if (not $self->vcal10) { qw( class completed created description dtstamp dtstart geo last-modified location organizer percent-complete priority recurrence-id sequence status summary uid url due duration ); } else { qw( class dcreated completed description dtstart due last-modified location rnum priority sequence status summary transp url uid ); } } =head2 optional_repeatable_properties According to the iCalendar standard, the following properties may be specified any number of times for a to-do item: attach attendee categories comment contact exdate exrule request-status related-to resources rdate rrule Or if C<< vcal10 => 1 >>: aalarm attach attendee categories dalarm exdate exrule malarm palarm related-to resources rdate rrule =cut sub optional_repeatable_properties { my $self = shift; if (not $self->vcal10) { qw( attach attendee categories comment contact exdate exrule request-status related-to resources rdate rrule ); } else { qw( aalarm attach attendee categories dalarm exdate exrule malarm palarm related-to resources rdate rrule ); } } =head1 AUTHOR Jesse Vincent C<< >> with David Glasser, Simon Wistow, and Alex Vandiver =head1 LICENCE AND COPYRIGHT Copyright (c) 2005 - 2009, Best Practical Solutions, LLC. All rights reserved. This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See L. =head1 DISCLAIMER OF WARRANTY BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR, OR CORRECTION. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENCE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. =cut 1; libdata-ical-perl-0.21+dfsg.orig/lib/Data/ICal/Entry/Event.pm0000644000175000017500000001147112165123102021326 0ustar fsfsuse warnings; use strict; package Data::ICal::Entry::Event; use base qw/Data::ICal::Entry/; =head1 NAME Data::ICal::Entry::Event - Represents an event in an iCalendar file =head1 SYNOPSIS my $vevent = Data::ICal::Entry::Event->new(); $vevent->add_properties( summary => "my party", description => "I'll cry if I want to", # Dat*e*::ICal is not a typo here dtstart => Date::ICal->new( epoch => time )->ical, ); $calendar->add_entry($vevent); $vevent->add_entry($alarm); =head1 DESCRIPTION A L object represents a single event in an iCalendar file. (Note that the iCalendar RFC refers to entries as "components".) It is a subclass of L and accepts all of its methods. =head1 METHODS =cut =head2 ical_entry_type Returns C, its iCalendar entry name. =cut sub ical_entry_type {'VEVENT'} =head2 optional_unique_properties According to the iCalendar standard, the following properties may be specified at most one time for an event: class created description dtstart geo last-modified location organizer priority dtstamp sequence status summary transp uid url recurrence-id In addition, C and C may be specified at most once each, but not both in the same entry (though this restriction is not enforced). Or if C<< vcal10 => 1 >>: class dcreated completed description dtstart dtend last-modified location rnum priority sequence status summary transp url uid =cut sub optional_unique_properties { my $self = shift; if (not $self->vcal10) { qw( class created description dtstart geo last-modified location organizer priority dtstamp sequence status summary transp uid url recurrence-id dtend duration ); } else { qw( class dcreated completed description dtstart dtend last-modified location rnum priority sequence status summary transp url uid ); } } =head2 optional_repeatable_properties According to the iCalendar standard, the following properties may be specified any number of times for an event: attach attendee categories comment contact exdate exrule request-status related-to resources rdate rrule Or if C<< vcal10 => 1 >>: aalarm attach attendee categories dalarm exdate exrule malarm palarm related-to resources rdate rrule =cut sub optional_repeatable_properties { my $self = shift; if (not $self->vcal10) { qw( attach attendee categories comment contact exdate exrule request-status related-to resources rdate rrule ); } else { qw( aalarm attach attendee categories dalarm exdate exrule malarm palarm related-to resources rdate rrule ); } } =head1 SEE ALSO =over 4 =item L For date parsing and formatting, including denoting "all day" events, considering using this module. Because it's a "mix in", you can still use all the methods here as well as the new date handling methods it defines. =back =head1 AUTHOR Jesse Vincent C<< >> with David Glasser, Simon Wistow, and Alex Vandiver =head1 LICENCE AND COPYRIGHT Copyright (c) 2005 - 2009, Best Practical Solutions, LLC. All rights reserved. This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See L. =head1 DISCLAIMER OF WARRANTY BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR, OR CORRECTION. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENCE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. =cut 1; libdata-ical-perl-0.21+dfsg.orig/lib/Data/ICal/Entry/TimeZone.pm0000644000175000017500000000627411225535471022020 0ustar fsfsuse warnings; use strict; package Data::ICal::Entry::TimeZone; use base qw/Data::ICal::Entry/; =head1 NAME Data::ICal::Entry::TimeZone - Represents a time zone definition in an iCalendar file =head1 SYNOPSIS my $vtimezone = Data::ICal::Entry::TimeZone->new(); $vtimezone->add_properties( tzid => "US-Eastern", tzurl => "http://zones.stds_r_us.net/tz/US-Eastern" ); $vtimezone->add_entry($daylight); # daylight/ standard not yet implemented $vtimezone->add_entry($standard); # :-( $calendar->add_entry($vtimezone); =head1 DESCRIPTION A L object represents the declaration of a time zone in an iCalendar file. (Note that the iCalendar RFC refers to entries as "components".) It is a subclass of L and accepts all of its methods. This module is not yet useful, because every time zone declaration needs to contain at least one C or C component, and these have not yet been implemented. =head1 METHODS =cut =head2 ical_entry_type Returns C, its iCalendar entry name. =cut sub ical_entry_type {'VTIMEZONE'} =head2 optional_unique_properties According to the iCalendar standard, the following properties may be specified at most one time for a time zone declaration: last-modified tzurl =cut sub optional_unique_properties { qw( last-modified tzurl ); } =head2 mandatory_unique_properties According to the iCalendar standard, the C property must be specified exactly one time in a time zone declaration. =cut sub mandatory_unique_properties { qw( tzid ); } =head1 AUTHOR Jesse Vincent C<< >> with David Glasser, Simon Wistow, and Alex Vandiver =head1 LICENCE AND COPYRIGHT Copyright (c) 2005 - 2009, Best Practical Solutions, LLC. All rights reserved. This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See L. =head1 DISCLAIMER OF WARRANTY BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR, OR CORRECTION. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENCE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. =cut 1; libdata-ical-perl-0.21+dfsg.orig/lib/Data/ICal/Entry/Alarm/0000755000175000017500000000000012165124375020754 5ustar fsfslibdata-ical-perl-0.21+dfsg.orig/lib/Data/ICal/Entry/Alarm/Audio.pm0000644000175000017500000000704011225535464022355 0ustar fsfsuse warnings; use strict; package Data::ICal::Entry::Alarm::Audio; use base qw/Data::ICal::Entry/; =head1 NAME Data::ICal::Entry::Alarm::Audio - Represents an audio alarm in an iCalendar file =head1 SYNOPSIS my $valarm = Data::ICal::Entry::Alarm::Audio->new(); $valarm->add_properties( attach => [ "ftp://host.com/pub/sounds/bell-01.aud", { fmttype => "audio/basic" } ], # Dat*e*::ICal is not a typo here trigger => [ Date::ICal->new( epoch => ... )->ical, { value => 'DATE-TIME' } ], ); $vevent->add_entry($valarm); =head1 DESCRIPTION A L object represents an audio alarm attached to a todo item or event in an iCalendar file. (Note that the iCalendar RFC refers to entries as "components".) It is a subclass of L and accepts all of its methods. =head1 METHODS =cut =head2 new Creates a new L object; sets its C property to C