.\" Automatically generated by Pod::Man 4.11 (Pod::Simple 3.35) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Data::ICal::Entry 3pm" .TH Data::ICal::Entry 3pm "2020-01-06" "perl v5.30.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Data::ICal::Entry \- Represents an entry in an iCalendar file .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 5 \& 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( \e%props, \e@entries ); .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" A Data::ICal::Entry object represents a single entry in an iCalendar file. (Note that the iCalendar \s-1RFC\s0 refers to entries as \&\*(L"components\*(R".) iCalendar defines several types of entries, such as events and to-do lists; each of these corresponds to a subclass of Data::ICal::Entry (though only to-do lists and events are currently implemented). Data::ICal::Entry should be treated as an abstract base class \*(-- all objects created should be of its subclasses. The entire calendar itself (the Data::ICal object) is also represented as a Data::ICal::Entry object. .PP Each entry has an entry type (such as \f(CW\*(C`VCALENDAR\*(C'\fR or \f(CW\*(C`VEVENT\*(C'\fR), a series of \*(L"properties\*(R", and possibly some sub-entries. (Only the root Data::ICal object can have sub-entries, except for alarm entries contained in events and to-dos (not yet implemented).) .SH "METHODS" .IX Header "METHODS" .SS "new" .IX Subsection "new" Creates a new entry object with no properties or sub-entries. .ie n .SS "as_string [ crlf => ""CRLF"" ]" .el .SS "as_string [ crlf => \f(CWCRLF\fP ]" .IX Subsection "as_string [ crlf => CRLF ]" Returns the entry as an appropriately formatted string (with trailing newline). .PP 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.) .PP If any mandatory property is missing, issues a warning. .PP The string to use as a newline can optionally be specified by giving the a \f(CW\*(C`crlf\*(C'\fR argument, which defaults to \f(CW\*(C`\ex0d\ex0a\*(C'\fR, per \s-1RFC 2445\s0 spec; this option is primarily for backwards compatibility with versions of this module before 0.16. .ie n .SS "add_entry $entry" .el .SS "add_entry \f(CW$entry\fP" .IX Subsection "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 (Data::ICal) with a to-do, event, journal, timezone, or free/busy entry.) .PP 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). .ie n .SS "add_entries $entry1, [$entry2, ...]" .el .SS "add_entries \f(CW$entry1\fP, [$entry2, ...]" .IX Subsection "add_entries $entry1, [$entry2, ...]" Convenience function to call \f(CW\*(C`add_entry\*(C'\fR several times with a list of entries. .SS "entries" .IX Subsection "entries" Returns a reference to the array of subentries of this entry. .SS "properties" .IX Subsection "properties" Returns a reference to the hash of properties of this entry. The keys are property names and the values are array references containing Data::ICal::Property objects. .SS "property" .IX Subsection "property" Given a property name returns a reference to the array of Data::ICal::Property objects. .ie n .SS "add_property $propname => $propval" .el .SS "add_property \f(CW$propname\fP => \f(CW$propval\fP" .IX Subsection "add_property $propname => $propval" Creates a new Data::ICal::Property object with name \f(CW$propname\fR and value \f(CW$propval\fR and adds it to the event. .PP If the property is not known to exist for that object type and does not begin with \f(CW\*(C`X\-\*(C'\fR, issues a warning. .PP If the property is known to be unique, replaces the original property. .PP To specify parameters for the property, let \f(CW$propval\fR 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. .PP Examples of setting parameters: .PP .Vb 2 \& # Add a property with a parameter of VALUE set to \*(AqDATE\*(Aq \& $event\->add_property( rdate => [ $date, { VALUE => \*(AqDATE\*(Aq } ] ); .Ve .ie n .SS "add_properties $propname1 => $propval1, [$propname2 => $propname2, ...]" .el .SS "add_properties \f(CW$propname1\fP => \f(CW$propval1\fP, [$propname2 => \f(CW$propname2\fP, ...]" .IX Subsection "add_properties $propname1 => $propval1, [$propname2 => $propname2, ...]" Convenience function to call \f(CW\*(C`add_property\*(C'\fR several times with a list of properties. .PP This method is guaranteed to call add \f(CW\*(C`add_property\*(C'\fR 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.) .PP Parameters for the properties are specified in the same way as in \&\f(CW\*(C`add_property\*(C'\fR. .SS "mandatory_unique_properties" .IX Subsection "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. .SS "mandatory_repeatable_properties" .IX Subsection "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. .SS "optional_unique_properties" .IX Subsection "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. .SS "optional_repeatable_properties" .IX Subsection "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. .ie n .SS "is_property $name" .el .SS "is_property \f(CW$name\fP" .IX Subsection "is_property $name" Returns a boolean value indicating whether or not the property \&\f(CW$name\fR is known to the class (that is, if it's listed in \&\f(CW\*(C`(mandatory/optional)_(unique/repeatable)_properties\*(C'\fR). .ie n .SS "is_mandatory $name" .el .SS "is_mandatory \f(CW$name\fP" .IX Subsection "is_mandatory $name" Returns a boolean value indicating whether or not the property \&\f(CW$name\fR is known to the class as mandatory (that is, if it's listed in \f(CW\*(C`mandatory_(unique/repeatable)_properties\*(C'\fR). .ie n .SS "is_optional $name" .el .SS "is_optional \f(CW$name\fP" .IX Subsection "is_optional $name" Returns a boolean value indicating whether or not the property \&\f(CW$name\fR is known to the class as optional (that is, if it's listed in \&\f(CW\*(C`optional_(unique/repeatable)_properties\*(C'\fR). .ie n .SS "is_unique $name" .el .SS "is_unique \f(CW$name\fP" .IX Subsection "is_unique $name" Returns a boolean value indicating whether or not the property \&\f(CW$name\fR is known to the class as unique (that is, if it's listed in \&\f(CW\*(C`(mandatory/optional)_unique_properties\*(C'\fR). .ie n .SS "is_repeatable $name" .el .SS "is_repeatable \f(CW$name\fP" .IX Subsection "is_repeatable $name" Returns a boolean value indicating whether or not the property \&\f(CW$name\fR is known to the class as repeatable (that is, if it's listed in \f(CW\*(C`(mandatory/optional)_repeatable_properties\*(C'\fR). .SS "ical_entry_type" .IX Subsection "ical_entry_type" Subclasses should override this method to provide the identifying type name of the entry (such as \f(CW\*(C`VCALENDAR\*(C'\fR or \f(CW\*(C`VTODO\*(C'\fR). .SS "vcal10 [$bool]" .IX Subsection "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 Data::ICal object when you construct it; \&\f(CW\*(C`add_entry\*(C'\fR automatically makes sure that sub-entries end up with the same value as their parents. .SS "rfc_strict [$bool]" .IX Subsection "rfc_strict [$bool]" Gets or sets a boolean saying whether this entry will complain about missing UIDs as per \s-1RFC2446.\s0 Defaults to false, for backwards compatibility. Generally, you can just set this on your main Data::ICal object when you construct it; \f(CW\*(C`add_entry\*(C'\fR automatically makes sure that sub-entries end up with the same value as their parents. .SS "auto_uid [$bool]" .IX Subsection "auto_uid [$bool]" Gets or sets a boolean saying whether this entry should automatically generate its own persistently unique UIDs. Defaults to false. Generally, you can just set this on your main Data::ICal object when you construct it; \f(CW\*(C`add_entry\*(C'\fR automatically makes sure that sub-entries end up with the same value as their parents. .SS "header" .IX Subsection "header" Returns the header line for the entry (including trailing newline). .SS "footer" .IX Subsection "footer" Returns the footer line for the entry (including trailing newline). .SS "parse_object" .IX Subsection "parse_object" Translate a Text::vFile::asData sub object into the appropriate Data::iCal::Event subtype. .SH "AUTHOR" .IX Header "AUTHOR" Best Practical Solutions, \s-1LLC\s0 .SH "LICENCE AND COPYRIGHT" .IX Header "LICENCE AND COPYRIGHT" Copyright (c) 2005 \- 2020, Best Practical Solutions, \s-1LLC.\s0 All rights reserved. .PP This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic.