| Net-ICal documentation | Contained in the Net-ICal distribution. |
Net::ICal::Event -- Event class
use Net::ICal::Event;
my $e = new Net::ICal::Event (
organizer => new Net::ICal::Attendee('alice'),
uid => 'fooid',
alarms => [Net::ICal::Event objects],
dtstart => new Net::ICal::Time("20010207T160000Z"),
summary => 'tea with the white rabbit',
);
Net::ICal::Event represents iCalendar events.
Construct a new Event. Parameters are in a hash. Meaningful parameters are:
More documentation pointers can be found in Net::ICal.
| Net-ICal documentation | Contained in the Net-ICal distribution. |
#!/usr/bin/perl -w # vi:sts=4:shiftwidth=4 # -*- Mode: perl -*- #====================================================================== # # This package is free software and is provided "as is" without # express or implied warranty. It may be used, redistributed and/or # modified under the same terms as perl itself. ( Either the Artistic # License or the GPL. ) # # $Id: Event.pm,v 1.20 2001/08/04 04:59:36 srl Exp $ # # (C) COPYRIGHT 2000-2001, Reefknot developers. # # See the AUTHORS file included in the distribution for a full list. #======================================================================
package Net::ICal::Event; use strict; use Net::ICal::Util qw(:all); use base qw(Net::ICal::ETJ);
sub new { my ($class, %args) = @_; #TODO: check for args that are specifically required in Events. #BUG: 424137 my $self = &_create ($class, %args); $self->_init; return undef unless ($self and $self->validate); return $self; } sub validate { my ($self) = @_; unless (defined $self->dtstart) { add_validation_error ($self, "You must have a dtstart in an Event"); } if (defined $self->dtend and $self->duration) { add_validation_error ($self, "Can't have both dtend and duration in one Event"); } return $self->SUPER::validate; } sub _create { my ($class, %args) = @_; my $self = $class->SUPER::_create ('VEVENT'); #TODO: modify the map to include map values that are specific # to Events, if any. #BUG: 424139 my $map = { dtend => { # 4.8.2.2 type => 'parameter', doc => 'when this event ends', domain => 'ref', options => 'Net::ICal::Time', value => undef, }, transp => { # 4.8.2.7 type => 'parameter', doc => 'does this event block out time', domain => 'enum', options => [qw(OPAQUE TRANSPARENT)], value => undef, }, }; $self->set_map (%$map); $self->set (%args); return $self; } 1;