Missing descriptions from POD NAME sections. #75994
[p5sagit/Excel-Template.git] / lib / Excel / Template / Container.pm
CommitLineData
d0eafc11 1package Excel::Template::Container;
2
3use strict;
4
5BEGIN {
6 use vars qw(@ISA);
7 @ISA = qw(Excel::Template::Base);
8
9 use Excel::Template::Base;
10}
11
12# Containers are objects that can contain arbitrary elements, such as
13# PageDefs or Loops.
14
15sub new
16{
17 my $class = shift;
18 my $self = $class->SUPER::new(@_);
19
c11fa570 20 $self->{ELEMENTS} = []
21 unless exists $self->{ELEMENTS} &&
d01e4722 22 ref $self->{ELEMENTS} eq 'ARRAY';
d0eafc11 23
24 return $self;
25}
26
d01e4722 27# Removed as unused code
28#sub _do_page
29#{
30# my $self = shift;
31# my ($method, $context) = @_;
32#
33# for my $e (@{$self->{ELEMENTS}})
34# {
35# $e->enter_scope($context);
36# $e->$method($context);
37# $e->exit_scope($context, 1);
38# }
39#
40# return 1;
41#}
42#
43#sub begin_page { _do_page 'begin_page', @_ }
44#sub end_page { _do_page 'end_page', @_ }
d0eafc11 45
46sub iterate_over_children
47{
48 my $self = shift;
49 my ($context) = @_;
50
51 my $continue = 1;
52
53 for my $e (
54 @{$self->{ELEMENTS}})
55 {
56 $e->enter_scope($context);
57
58 my $rc = $e->render($context);
59 $continue = $rc if $continue;
60
61 $e->exit_scope($context);
62 }
63
64 return $continue;
65}
66
67sub render { $_[0]->iterate_over_children($_[1]) }
68#{
69# my $self = shift;
70# my ($context) = @_;
71#
72# return $self->iterate_over_children($context);
73#}
74
d01e4722 75# Removed as unused code
e976988f 76#sub max_of
77#{
78# my $self = shift;
79# my ($context, $attr) = @_;
80#
81# my $max = $context->get($self, $attr);
82#
83# ELEMENT:
84# foreach my $e (@{$self->{ELEMENTS}})
85# {
86# $e->enter_scope($context);
87#
88# my $v = $e->isa('CONTAINER')
89# ? $e->max_of($context, $attr)
90# : $e->calculate($context, $attr);
91#
92# $max = $v if $max < $v;
93#
94# $e->exit_scope($context, 1);
95# }
96#
97# return $max;
98#}
99#
100#sub total_of
101#{
102# my $self = shift;
103# my ($context, $attr) = @_;
104#
105# my $total = 0;
106#
107# ELEMENT:
108# foreach my $e (@{$self->{ELEMENTS}})
109# {
110# $e->enter_scope($context);
111#
112# $total += $e->isa('CONTAINER')
113# ? $e->total_of($context, $attr)
114# : $e->calculate($context, $attr);
115#
116# $e->exit_scope($context, 1);
117# }
118#
119# return $total;
120#}
d0eafc11 121
1221;
123__END__
124
125=head1 NAME
126
87f4c76d 127Excel::Template::Container - Excel::Template::Container
d0eafc11 128
129=head1 PURPOSE
130
131=head1 NODE NAME
132
133=head1 INHERITANCE
134
135=head1 ATTRIBUTES
136
137=head1 CHILDREN
138
139=head1 AFFECTS
140
141=head1 DEPENDENCIES
142
143=head1 USAGE
144
145=head1 AUTHOR
146
c09684ff 147Rob Kinyon (rob.kinyon@gmail.com)
d0eafc11 148
149=head1 SEE ALSO
150
151=cut