Fixed email address to gmail address
[p5sagit/Excel-Template.git] / lib / Excel / Template / Container / Format.pm
CommitLineData
d0eafc11 1package Excel::Template::Container::Format;
2
3use strict;
4
5BEGIN {
6 use vars qw(@ISA);
7 @ISA = qw( Excel::Template::Container );
8
9 use Excel::Template::Container;
10}
11
12use Excel::Template::Format;
13
14sub render
15{
16 my $self = shift;
17 my ($context) = @_;
18
19 my $old_format = $context->active_format;
20 my $format = Excel::Template::Format->copy(
21 $context, $old_format,
22
23 %{$self},
24 );
25 $context->active_format($format);
26
27 my $child_success = $self->iterate_over_children($context);
28
29 $context->active_format($old_format);
c09684ff 30
31 return $child_success;
d0eafc11 32}
33
341;
35__END__
36
37=head1 NAME
38
39Excel::Template::Container::Format - Excel::Template::Container::Format
40
41=head1 PURPOSE
42
43To format all children according to the parameters
44
45=head1 NODE NAME
46
47FORMAT
48
49=head1 INHERITANCE
50
51Excel::Template::Container
52
53=head1 ATTRIBUTES
54
55=over 4
56
c09684ff 57Boolean attributes should be set to 1, 0, true, or false.
58
59Color values can be the color name or the color index. See http://search.cpan.org/~jmcnamara/Spreadsheet-WriteExcel-2.11/lib/Spreadsheet/WriteExcel.pm#COLOURS_IN_EXCEL
60
61
62=item * align
63
64Set to either left, center, right, fill, or justify. Default is left. See also valign.
65
66=item * bg_color
67
68Set to a color value. Default is none.
69
d0eafc11 70=item * bold
71
72This will set bold to on or off, depending on the boolean value.
73
c09684ff 74=item * border
d0eafc11 75
c09684ff 76Set the border for all for edges of a cell. Also see bottom, top, left, and right.
77Valid values are 0 - 7.
d0eafc11 78
c09684ff 79http://search.cpan.org/~jmcnamara/Spreadsheet-WriteExcel-2.11/lib/Spreadsheet/WriteExcel.pm#set_border()
d0eafc11 80
c09684ff 81=item * border_color
82
83Sets the color value for the border. See also border, top_color, bottom_color, left_color
84and right_color.
85
86=item * bottom
87
88See border.
89
90=item * bottom_color
91
92See border_color
93
94=item * color
95
96This will set the color of the text, depending on color value. Default is black.
97
98=item * fg_color
99
100Set to a color value. This color will be used in foreground of some patterns. See color
101to change the color of text. Also see bg_color and pattern.
102
103=item * font
104
105This will sent the font face. Default is Arial.
d0eafc11 106
107=item * font_outline
108
109This will set font_outline to on or off, depending on the boolean value. (q.v.
110OUTLINE tag)
111
112=item * font_shadow
113
114This will set font_shadow to on or off, depending on the boolean value. (q.v.
c09684ff 115SHADOW tag). This only applies to Excel for Macintosh.
d0eafc11 116
117=item * font_strikeout
118
119This will set font_strikeout to on or off, depending on the boolean value. (q.v.
120STRIKEOUT tag)
121
c09684ff 122=item * hidden
123
124This will set whether the cell is hidden to on or off, depending on the boolean
125value.
126
127=item * indent
128
129Set the indentation level for a cell. Positive integers are allowed.
130
131=item * italic
132
133This will set italic to on or off, depending on the boolean value. (q.v. ITALIC
134tag)
135
136=item * left
137
138See border.
139
140=item * left_color
141
142See border_color.
143
144=item * num_format
145
146Set to the index of one of Excel's built-in number formats. See http://search.cpan.org/~jmcnamara/Spreadsheet-WriteExcel-2.11/lib/Spreadsheet/WriteExcel.pm#set_num_format()
147
148=item * pattern
149
150Set to an integer, 0 - 18. Sets the background fill pattern of a ell. Default is 1, solid.
151
152=item * right
153
154See border.
155
156=item * right_color
157
158See border color.
159
160=item * rotation
161
162Set the rotation of the text in a cell. The rotation can be any angle in the range -90 to 90 degrees.
163The angle 270 is also supported. This indicates text where the letters run from top to bottom.
164
165=item * shrink
166
167A boolean value. If true, text will shrink to fit a cell.
168
169=item * size
170
171This will set the size of the font. Default is 10. Unless a row height is
172specifically set, the row will grow taller as necessary.
173
174=item * text_justlast
175
176A boolean value to justify the last line. Only applies to Far Eastern versions of Excel.
177
178=item * text_wrap
179
180A boolean value. When set to true, text will wrap in a cell instead of crossing over
181into empty cells. If the row height is not set, the row will grow taller to accomodate
182the wrapping text.
183
184=item * top
185
186See border.
187
188=item * top_color
189
190See border_color
191
192=item * valign
193
194Set to top, vcenter, bottom, or vjustify. Default is vcenter. See also align.
195
d0eafc11 196=back 4
197
198=head1 CHILDREN
199
200None
201
202=head1 EFFECTS
203
204None
205
206=head1 DEPENDENCIES
207
208None
209
210=head1 USAGE
211
212 <format bold="1">
213 ... Children here
214 </format>
215
216In the above example, the children will be displayed (if they are displaying
217elements) in a bold format. All other formatting will remain the same and the
218"bold"-ness will end at the end tag.
219
220=head1 AUTHOR
221
c09684ff 222Rob Kinyon (rob.kinyon@gmail.com)
d0eafc11 223
224=head1 SEE ALSO
225
226BOLD, HIDDEN, ITALIC, OUTLINE, SHADOW, STRIKEOUT
227
228=cut