Intermediate commit
[p5sagit/Excel-Template.git] / lib / Excel / Template / Container / Worksheet.pm
CommitLineData
d0eafc11 1package Excel::Template::Container::Worksheet;
2
3use strict;
4
5BEGIN {
6 use vars qw(@ISA);
7 @ISA = qw(Excel::Template::Container);
8
9 use Excel::Template::Container;
10}
11
12sub render
13{
14 my $self = shift;
15 my ($context) = @_;
16
37513eae 17 $context->new_worksheet( $self );
d0eafc11 18
dba6a68e 19 my $password = $context->get( $self, 'PROTECT' );
20 if (defined $password)
21 {
22 $context->active_worksheet->protect( $password );
23 }
24
d0eafc11 25 return $self->SUPER::render($context);
26}
27
281;
29__END__
30
31=head1 NAME
32
33Excel::Template::Container::Worksheet - Excel::Template::Container::Worksheet
34
35=head1 PURPOSE
36
37To provide a new worksheet.
38
39=head1 NODE NAME
40
41WORKSHEET
42
43=head1 INHERITANCE
44
45Excel::Template::Container
46
47=head1 ATTRIBUTES
48
49=over 4
50
51=item * NAME
52
53This is the name of the worksheet to be added.
54
dba6a68e 55=item * PROTECT
56
57If the attribute exists, it will mark the worksheet as being protected. Whatever
58value is set will be used as the password.
59
60This activates the HIDDEN and LOCKED nodes.
61
d0eafc11 62=back 4
63
64=head1 CHILDREN
65
66None
67
68=head1 EFFECTS
69
70None
71
72=head1 DEPENDENCIES
73
74None
75
76=head1 USAGE
77
78 <worksheet name="My Taxes">
79 ... Children here
80 </worksheet>
81
82In the above example, the children will be executed in the context of the
83"My Taxes" worksheet.
84
85=head1 AUTHOR
86
c09684ff 87Rob Kinyon (rob.kinyon@gmail.com)
d0eafc11 88
89=head1 SEE ALSO
90
91ROW, CELL, FORMULA
92
93=cut