
=head1 NAME

Mail::Message::Head::Subset - subset of header information of a message

=head1 CLASS INHERITANCE

 Mail::Message::Head::Subset realizes a Mail::Message::Head::Complete

 Mail::Message::Head::Subset
   is a Mail::Message::Head
   is a Mail::Reporter

=head1 SYNOPSIS

 my Mail::Message::Head::Subset $subset = ...;
 $subset->isa('Mail::Message::Head')  # true
 $subset->guessBodySize               # integer or undef
 $subset->isDelayed                   # true

=head1 DESCRIPTION

Some types of folders contain an index file which lists a few lines of
information per messages.  Especially when it is costly to read header lines,
the index speeds-up access considerably.  For instance, the subjects of
all messages are often wanted, but waiting for a thousand messages of the
folder to be read may imply a thousand network reads (IMAP) or file
openings (MH)

When you access header fields which are not in the header subset, the whole
header has to be parsed (which may consume considerable time, depending on
the type of folder).

=head1 METHODS

=head2 Initiation

=over 4

=item B<build> FIELDS

See Mail::Message::Head::build()

=item B<new> OPTIONS

(Class method)

 OPTION               DEFAULT
 field_type           'Mail::Message::Field::Fast'
 log                  'WARNINGS'
 message              undef
 modified             <false>
 trace                'WARNINGS'

=over 4

=item B<field_type> =E<gt> CLASS

See Mail::Message::Head::new(field_type)

=item B<log> =E<gt> LEVEL

See Mail::Reporter::new(log)

=item B<message> =E<gt> MESSAGE

See Mail::Message::Head::new(message)

=item B<modified> =E<gt> BOOLEAN

See Mail::Message::Head::new(modified)

=item B<trace> =E<gt> LEVEL

See Mail::Reporter::new(trace)

=back

=back

=head2 The Header

=over 4

=item B<clone> [FIELDS]

See Mail::Message::Head::Complete::clone()

=item B<isDelayed> 

See Mail::Message::Head::isDelayed()

=item B<isEmpty> 

See Mail::Message::Head::isEmpty()

=item B<isModified> 

See Mail::Message::Head::isModified()

=item B<isMultipart> 

See Mail::Message::Head::isMultipart()

=item B<message> [MESSAGE]

See Mail::Message::Head::message()

=item B<modified> [BOOLEAN]

See Mail::Message::Head::modified()

=back

=head2 Constructing a Header

=over 4

=item B<add> FIELD | LINE | (NAME,BODY[,ATTRS])

See Mail::Message::Head::Complete::add()

=item B<delete> NAME

See Mail::Message::Head::Complete::delete()

=item B<removeField> FIELD

See Mail::Message::Head::Complete::removeField()

=item B<reset> NAME, FIELDS

See Mail::Message::Head::Complete::reset()

=item B<set> FIELD | LINE | (NAME, BODY [,ATTRS])

See Mail::Message::Head::Complete::set()

=back

=head2 Access to the Header

=over 4

=item B<addResentGroup> RESENT-GROUP|DATA

See Mail::Message::Head::Complete::addResentGroup()

=item B<count> NAME

Count the number of fields with this NAME.  If the NAME cannot be found,
the full header get loaded.  In case we find any NAME field, it is
decided we know all of them, and loading is not needed.

=item B<get> NAME [,INDEX]

See Mail::Message::Head::get()

=item B<grepNames> [NAMES|ARRAY-OF-NAMES|REGEXS]

See Mail::Message::Head::Complete::grepNames()

=item B<guessBodySize> 

The body size is defined in the C<Content-Length> field.  However, this
field may not be known.  In that case, a guess is made based on the known
C<Lines> field.  When also that field is not known yet, C<undef> is returned.

=item B<guessTimeStamp> 

See Mail::Message::Head::Complete::guessTimeStamp()

=item B<knownNames> 

See Mail::Message::Head::knownNames()

=item B<names> 

See Mail::Message::Head::Complete::names()

=item B<nrLines> 

See Mail::Message::Head::Complete::nrLines()

=item B<print> [FILEHANDLE]

See Mail::Message::Head::Complete::print()

=item B<printUndisclosed> [FILEHANDLE]

See Mail::Message::Head::Complete::printUndisclosed()

=item B<resentGroups> 

See Mail::Message::Head::Complete::resentGroups()

=item B<size> 

See Mail::Message::Head::Complete::size()

=item B<string> 

See Mail::Message::Head::Complete::string()

=item B<timestamp> 

See Mail::Message::Head::Complete::timestamp()

=back

=head2 Reading and Writing [internals]

=over 4

=item B<addNoRealize> FIELD

See Mail::Message::Head::addNoRealize()

=item B<addOrderedFields> FIELDS

See Mail::Message::Head::addOrderedFields()

=item B<createFromLine> 

See Mail::Message::Head::Complete::createFromLine()

=item B<createMessageId> 

See Mail::Message::Head::Complete::createMessageId()

=item B<fileLocation> 

See Mail::Message::Head::fileLocation()

=item B<load> 

See Mail::Message::Head::load()

=item B<messagIdPrefix> [STRING]

See Mail::Message::Head::Complete::messagIdPrefix()

=item B<moveLocation> DISTANCE

See Mail::Message::Head::moveLocation()

=item B<orderedFields> 

See Mail::Message::Head::orderedFields()

=item B<read> PARSER

See Mail::Message::Head::read()

=item B<setNoRealize> FIELD

See Mail::Message::Head::setNoRealize()

=back

=head2 Logging and Tracing

=over 4

=item B<defaultTrace> [LEVEL, [LEVEL]

See Mail::Reporter::defaultTrace()

=item B<errors> 

See Mail::Reporter::errors()

=item B<log> [LEVEL [,STRINGS]]

See Mail::Reporter::log()

=item B<report> [LEVEL]

See Mail::Reporter::report()

=item B<reportAll> [LEVEL]

See Mail::Reporter::reportAll()

=item B<trace> [LEVEL]

See Mail::Reporter::trace()

=item B<warnings> 

See Mail::Reporter::warnings()

=back

=head2 Other Methods

=over 4

=item B<AUTOLOAD> 

See Mail::Reporter::AUTOLOAD()

=item B<DESTROY> 

See Mail::Reporter::DESTROY()

=item B<inGlobalDestruction> 

See Mail::Reporter::inGlobalDestruction()

=item B<logPriority> LEVEL

See Mail::Reporter::logPriority()

=item B<logSettings> 

See Mail::Reporter::logSettings()

=item B<notImplemented> 

See Mail::Reporter::notImplemented()

=back

=head1 SEE ALSO

A good start to read is Mail::Box-Overview.
More documentation and a mailinglist are available from the project's
website at L<http://perl.overmeer.net/mailbox/>.

=head1 AUTHOR

Written by Mark Overmeer (L<mark@overmeer.net|mailto:mark@overmeer.net>)
with the help of many.  See the ChangeLog for details.

=head1 VERSION

This code is beta, version 2.037.

Copyright (c) 2001-2003 by the authors. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.
