
=head1 NAME

OODoc::Text::Structure - set of paragraphs with examples and subroutines


=head1 INHERITANCE

 OODoc::Text::Structure
   is a OODoc::Text
   is a OODoc::Object

 OODoc::Text::Structure is extended by
   OODoc::Text::Chapter
   OODoc::Text::Section
   OODoc::Text::SubSection


=head1 SYNOPSIS

 # Cannot be instantiated itself


=head1 DESCRIPTION

The OODoc::Text::Structure class is used as base class for
the L<OODoc::Text::Chapter|OODoc::Text::Chapter>, L<OODoc::Text::Section|OODoc::Text::Section>, and
L<OODoc::Text::SubSection|OODoc::Text::SubSection> classes.  Each of these classes group some
paragraphs of text, probably some examples and some subroutines: they
provide a structure to the document.


=head1 OVERLOADED


overload: B<'""' (stringification)>

=over 4

See L<OODoc::Text/"OVERLOADED">

=back

overload: B<'==' and '!='>

=over 4

See L<OODoc::Text/"OVERLOADED">

=back

overload: B<'cmp' (string comparison)>

=over 4

See L<OODoc::Text/"OVERLOADED">

=back


=head1 METHODS


=head2 Constructors


$obj-E<gt>B<emptyExtension>(CONTAINER)

=over 4

Create an I<empty> copy of a structured text element, which is used
at a higher level of inheritance to collect related subroutines and
such.

=back

OODoc::Text::Structure-E<gt>B<new>(OPTIONS)

=over 4

 Option       Defined in       Default   
 container    L<OODoc::Text>   <required>
 description  L<OODoc::Text>   C<''>     
 level                         <required>
 linenr       L<OODoc::Text>   <required>
 name         L<OODoc::Text>   undef     
 type         L<OODoc::Text>   <required>

. container OBJECT

. description STRING

. level INTEGER

=over 4

Header level of the text structure.  A chapter will be 1, section 2, and
subsection 3.

=back

. linenr INTEGER

. name STRING

. type STRING

=back

=head2 Inheritance knowledge


$obj-E<gt>B<extends>([OBJECT])

=over 4

See L<OODoc::Object/"Inheritance knowledge">

=back

=head2 Attributes


$obj-E<gt>B<container>([OBJECT])

=over 4

See L<OODoc::Text/"Attributes">

=back

$obj-E<gt>B<description>

=over 4

See L<OODoc::Text/"Attributes">

=back

$obj-E<gt>B<level>

=over 4

Returns the level of the text structure.  Like in pod and html, a chapter
will be 1, section 2, and subsection 3.

=back

$obj-E<gt>B<name>

=over 4

See L<OODoc::Text/"Attributes">

=back

$obj-E<gt>B<niceName>

=over 4

Returns the name of this chapter, section or sub-section beautified to
normal caps.  If the name does not contain lower-case characters, then
the whole string is lower-cased, and then the first upper-cased.

=back

$obj-E<gt>B<type>

=over 4

See L<OODoc::Text/"Attributes">

=back

=head2 Location


$obj-E<gt>B<findEntry>(NAME)

=over 4

Find the chapter, section or subsection with this NAME.  The object found
is returned.

=back

$obj-E<gt>B<manual>([NAME])

=over 4

See L<OODoc::Text/"Location">

=back

$obj-E<gt>B<path>

=over 4

Represent the location of this chapter, section, or subsection as
one string, separated by slashes.

I<Example:> 

 print $subsect->path; 
    # may print:  METHODS/Container/Search

=back

$obj-E<gt>B<unique>

=over 4

See L<OODoc::Text/"Location">

=back

$obj-E<gt>B<where>

=over 4

See L<OODoc::Text/"Location">

=back

=head2 Collected


$obj-E<gt>B<all>(METHOD, PARAMETERS)

=over 4

Call the METHOD recursively on this object and all its sub-structures.
For instance, when C<all> is called on a chapter, it first will call
the METHOD on that chapter, than on all its sections and subsections.
The PARAMETERS are passed with each call.  The results of all calls is
returned as list.

=back

$obj-E<gt>B<example>(OBJECT)

=over 4

See L<OODoc::Text/"Collected">

=back

$obj-E<gt>B<examples>

=over 4

See L<OODoc::Text/"Collected">

=back

$obj-E<gt>B<findDescriptionObject>

=over 4

See L<OODoc::Text/"Collected">

=back

$obj-E<gt>B<isEmpty>

=over 4

Return true if this text structure is only a place holder for something
found in a super class.  Structured elements are created with
L<emptyExtension()|OODoc::Text::Structure/"Constructors"> on each sub-class pass the idea of order and to
collect subroutines to be listed.  However, in some cases, nothing
is to be listed after all, and in that case, this method returns C<true>.

I<Example:> 

 unless($chapter->isEmpty) ...

=back

$obj-E<gt>B<openDescription>

=over 4

See L<OODoc::Text/"Collected">

=back

=head2 Subroutines

Each manual page structure element (chapter, section, and subsection)
can contain a list of subroutine descriptions.

$obj-E<gt>B<addSubroutine>(OBJECTS)

=over 4

A subroutine (OODoc::Text::Subroutine object) is added to the chapter,
section or subsection.

=back

$obj-E<gt>B<setSubroutines>(ARRAY)

=over 4

Sets the subroutines which are related to this text structure, replacing
the preivous set.  This is used when the manual pages are expanded into
each-other to simplify working with the inheritance relations.

=back

$obj-E<gt>B<subroutine>(NAME)

=over 4

Returns the subroutine with the specific name.

=back

$obj-E<gt>B<subroutines>

=over 4

Returns the list of subroutines which are related to this text object.

=back

=head2 Commonly used functions


$obj-E<gt>B<filenameToPackage>(FILENAME)

OODoc::Text::Structure-E<gt>B<filenameToPackage>(FILENAME)

=over 4

See L<OODoc::Object/"Commonly used functions">

=back

$obj-E<gt>B<mkdirhier>(DIRECTORY)

OODoc::Text::Structure-E<gt>B<mkdirhier>(DIRECTORY)

=over 4

See L<OODoc::Object/"Commonly used functions">

=back

=head2 Manual Repository


$obj-E<gt>B<addManual>(MANUAL)

=over 4

See L<OODoc::Object/"Manual Repository">

=back

$obj-E<gt>B<mainManual>(NAME)

=over 4

See L<OODoc::Object/"Manual Repository">

=back

$obj-E<gt>B<manuals>

=over 4

See L<OODoc::Object/"Manual Repository">

=back

$obj-E<gt>B<manualsForPackage>(NAME)

=over 4

See L<OODoc::Object/"Manual Repository">

=back

$obj-E<gt>B<packageNames>

=over 4

See L<OODoc::Object/"Manual Repository">

=back



=head1 DIAGNOSTICS

I<Error:> manual definition requires manual object

A call to L<addManual()|OODoc::Object/"Manual Repository"> expects a new manual object (a L<OODoc::Manual|OODoc::Manual>),
however an incompatible thing was passed.  Usually, intended was a call
to L<manualsForPackage()|OODoc::Object/"Manual Repository"> or L<mainManual()|OODoc::Object/"Manual Repository">.

I<Error:> no level defined for structural component







=head1 REFERENCES

See the OODoc website at L<http://perl.overmeer.net/oodoc/> for more details.

=head1 COPYRIGHTS

Module version 0.09.
Written by Mark Overmeer (mark@overmeer.net).  See the ChangeLog for
other contributors.

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


