line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
#================================= Page.pm =================================== |
2
|
|
|
|
|
|
|
# Filename: Page.pm |
3
|
|
|
|
|
|
|
# Description: Physical Page Class for Scanners. |
4
|
|
|
|
|
|
|
# Original Author: Dale M. Amon |
5
|
|
|
|
|
|
|
# Revised by: $Author: amon $ |
6
|
|
|
|
|
|
|
# Date: $Date: 2008-08-28 23:31:44 $ |
7
|
|
|
|
|
|
|
# Version: $Revision: 1.3 $ |
8
|
|
|
|
|
|
|
# License: LGPL 2.1, Perl Artistic or BSD |
9
|
|
|
|
|
|
|
# |
10
|
|
|
|
|
|
|
#============================================================================= |
11
|
1
|
|
|
1
|
|
526
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
34
|
|
12
|
1
|
|
|
1
|
|
5
|
use Scanner::Format; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
30
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
package Scanner::Page; |
15
|
1
|
|
|
1
|
|
5
|
use vars qw{@ISA}; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
895
|
|
16
|
|
|
|
|
|
|
@ISA = qw( UNIVERSAL ); |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
#============================================================================= |
19
|
|
|
|
|
|
|
# CLASS METHODS |
20
|
|
|
|
|
|
|
#============================================================================= |
21
|
|
|
|
|
|
|
$Scanner::Page::DEFAULT_NAME_VERIFIER = undef; |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub defaultNameVerifierIs { |
24
|
0
|
|
|
0
|
1
|
|
my ($class, $obj) = @_; |
25
|
0
|
0
|
|
|
|
|
if (!defined $obj) { |
26
|
0
|
|
|
|
|
|
$Scanner::Page::DEFAULT_NAME_VERIFIER = undef; |
27
|
0
|
|
|
|
|
|
return 1; |
28
|
|
|
|
|
|
|
} |
29
|
0
|
0
|
|
|
|
|
ref ($obj) || (return 0); |
30
|
0
|
|
|
|
|
|
$Scanner::Page::DEFAULT_NAME_VERIFIER = $obj; |
31
|
0
|
|
|
|
|
|
return 1; |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
#----------------------------------------------------------------------------- |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
sub new { |
37
|
0
|
|
|
0
|
1
|
|
my $class = shift; |
38
|
0
|
|
|
|
|
|
my %params = @_; |
39
|
0
|
|
|
|
|
|
my $self = bless {}, $class; |
40
|
|
|
|
|
|
|
|
41
|
0
|
0
|
|
|
|
|
$self->_setFormat (\%params) || return undef; |
42
|
0
|
0
|
|
|
|
|
$self->_setPageName (\%params) || return undef; |
43
|
|
|
|
|
|
|
|
44
|
0
|
|
|
|
|
|
return $self; |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
#============================================================================= |
48
|
|
|
|
|
|
|
# INSTANCE METHODS |
49
|
|
|
|
|
|
|
#============================================================================= |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
sub pagetitle { |
52
|
0
|
|
|
0
|
1
|
|
my $s = shift; |
53
|
0
|
|
|
|
|
|
my @list; |
54
|
|
|
|
|
|
|
|
55
|
0
|
|
|
|
|
|
my ($date, $title, $pageid, $subtitle) = |
56
|
|
|
|
|
|
|
@$s{'date','title','pageid','subtitle'}; |
57
|
0
|
0
|
|
|
|
|
($pageid = "p" . $pageid) if ($pageid); |
58
|
|
|
|
|
|
|
|
59
|
0
|
0
|
|
|
|
|
foreach ( $date, $title, $pageid, $subtitle) {$_ && push @list, $_; } |
|
0
|
|
|
|
|
|
|
60
|
0
|
0
|
|
|
|
|
return undef if ($#list == -1); |
61
|
|
|
|
|
|
|
|
62
|
0
|
|
|
|
|
|
my $t = $list[0]; |
63
|
0
|
|
|
|
|
|
for (my $i=1; $i < $#list+1; $i++) {$t .= "-" . $list[$i]; } |
|
0
|
|
|
|
|
|
|
64
|
0
|
|
|
|
|
|
return $t; |
65
|
|
|
|
|
|
|
} |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
#----------------------------------------------------------------------------- |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
sub info ($) { |
70
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
71
|
0
|
|
|
|
|
|
printf "[Page]\n" . |
72
|
|
|
|
|
|
|
"Page Title: %s\n" . |
73
|
|
|
|
|
|
|
"Date: %s\n" . |
74
|
|
|
|
|
|
|
"Title: %s\n" . |
75
|
|
|
|
|
|
|
"PageId: %s\n" . |
76
|
|
|
|
|
|
|
"Subtitle: %s\n", |
77
|
|
|
|
|
|
|
$self->pagetitle, |
78
|
|
|
|
|
|
|
$self->{'date'}, |
79
|
|
|
|
|
|
|
$self->{'title'}, |
80
|
|
|
|
|
|
|
$self->{'pageid'}, |
81
|
|
|
|
|
|
|
$self->{'subtitle'}; |
82
|
0
|
|
|
|
|
|
print "\n"; |
83
|
0
|
|
|
|
|
|
$self->{'format'}->info ("Scan"); |
84
|
0
|
|
|
|
|
|
return $self; |
85
|
|
|
|
|
|
|
} |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
#----------------------------------------------------------------------------- |
88
|
|
|
|
|
|
|
|
89
|
0
|
|
|
0
|
1
|
|
sub landscape { shift->{'format'}->landscape; } |
90
|
0
|
|
|
0
|
1
|
|
sub portrait { shift->{'format'}->portrait; } |
91
|
0
|
|
|
0
|
0
|
|
sub ScanDimensions {(shift->{'format'}->ScanDimensions);} |
92
|
0
|
|
|
0
|
1
|
|
sub date { shift->{'date'}; } |
93
|
0
|
|
|
0
|
1
|
|
sub title { shift->{'title'}; } |
94
|
0
|
|
|
0
|
1
|
|
sub pageid { shift->{'pageid'}; } |
95
|
0
|
|
|
0
|
1
|
|
sub subtitle { shift->{'subtitle'}; } |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
#============================================================================= |
98
|
|
|
|
|
|
|
# INTERNAL CLASS METHODS |
99
|
|
|
|
|
|
|
#============================================================================= |
100
|
|
|
|
|
|
|
# Verify that the list of elements can be used to create a page title. |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
sub _validateName { |
103
|
0
|
|
|
0
|
|
|
my ($self,$date,$title,$pageid,$subtitle) = @_; |
104
|
|
|
|
|
|
|
|
105
|
0
|
0
|
|
|
|
|
((length($date) + length($title) + length($pageid) + length ($subtitle)) > 0) |
106
|
|
|
|
|
|
|
|| return 0; |
107
|
|
|
|
|
|
|
|
108
|
0
|
0
|
|
|
|
|
if ($Scanner::Page::DEFAULT_NAME_VERIFIER) { |
109
|
0
|
0
|
|
|
|
|
$Scanner::Page::DEFAULT_NAME_VERIFIER->validateName |
110
|
|
|
|
|
|
|
( @$self{'date','title','pageid','subtitle'} ) || (return 0); |
111
|
|
|
|
|
|
|
} |
112
|
0
|
|
|
|
|
|
return 1; |
113
|
|
|
|
|
|
|
} |
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
#============================================================================= |
116
|
|
|
|
|
|
|
# INTERNAL OBJECT METHODS |
117
|
|
|
|
|
|
|
#============================================================================= |
118
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
sub _setPageName { |
120
|
0
|
|
|
0
|
|
|
my ($self, $params) = @_; |
121
|
|
|
|
|
|
|
|
122
|
0
|
|
|
|
|
|
@$self{'date','title', 'pageid','subtitle'} = ("", "", "", "" ); |
123
|
0
|
0
|
|
|
|
|
($self->{'date'} = $params->{'date'}) if defined $params->{'date'}; |
124
|
0
|
0
|
|
|
|
|
($self->{'title'} = $params->{'title'}) if defined $params->{'title'}; |
125
|
0
|
0
|
|
|
|
|
($self->{'pageid'} = $params->{'pageid'}) if defined $params->{'pageid'}; |
126
|
0
|
0
|
|
|
|
|
($self->{'subtitle'}= $params->{'subtitle'}) if defined $params->{'subtitle'}; |
127
|
|
|
|
|
|
|
|
128
|
0
|
0
|
|
|
|
|
Scanner::Page->_validateName ( @$self{'date','title','pageid','subtitle'} ) |
129
|
|
|
|
|
|
|
|| (return 0); |
130
|
0
|
|
|
|
|
|
return 1; |
131
|
|
|
|
|
|
|
} |
132
|
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
#----------------------------------------------------------------------------- |
134
|
|
|
|
|
|
|
|
135
|
|
|
|
|
|
|
sub _setFormat { |
136
|
0
|
|
|
0
|
|
|
my ($self, $params) = @_; |
137
|
0
|
0
|
|
|
|
|
defined $params->{'format'} or return 0; |
138
|
|
|
|
|
|
|
|
139
|
0
|
|
|
|
|
|
$self->{'format'} = $params->{'format'}; |
140
|
0
|
|
|
|
|
|
return 1; |
141
|
|
|
|
|
|
|
} |
142
|
|
|
|
|
|
|
|
143
|
|
|
|
|
|
|
#============================================================================= |
144
|
|
|
|
|
|
|
# POD DOCUMENTATION |
145
|
|
|
|
|
|
|
#============================================================================= |
146
|
|
|
|
|
|
|
# You may extract and format the documention section with the 'perldoc' cmd. |
147
|
|
|
|
|
|
|
|
148
|
|
|
|
|
|
|
=head1 NAME |
149
|
|
|
|
|
|
|
|
150
|
|
|
|
|
|
|
Scanner::Page - Representation of a Page to be passed to a Scanner. |
151
|
|
|
|
|
|
|
|
152
|
|
|
|
|
|
|
=head1 SYNOPSIS |
153
|
|
|
|
|
|
|
|
154
|
|
|
|
|
|
|
use Scanner::Page; |
155
|
|
|
|
|
|
|
|
156
|
|
|
|
|
|
|
$obj = Scanner::Page->new ( list of named arguments ); |
157
|
|
|
|
|
|
|
$bool = Scanner::Page->defaultNameVerifierIs ( $myverifierobj ); |
158
|
|
|
|
|
|
|
|
159
|
|
|
|
|
|
|
$pagetitle = $obj->pagetitle; |
160
|
|
|
|
|
|
|
$date = $obj->date; |
161
|
|
|
|
|
|
|
$title = $obj->title; |
162
|
|
|
|
|
|
|
$pageid = $obj->pageid; |
163
|
|
|
|
|
|
|
$subtitle = $obj->subtitle; |
164
|
|
|
|
|
|
|
($width, $height) = $obj->ScanDimensions; |
165
|
|
|
|
|
|
|
$flg = $obj->landscape; |
166
|
|
|
|
|
|
|
$flg = $obj->portrait; |
167
|
|
|
|
|
|
|
$obj = $obj->info; |
168
|
|
|
|
|
|
|
|
169
|
|
|
|
|
|
|
=head1 Inheritance |
170
|
|
|
|
|
|
|
|
171
|
|
|
|
|
|
|
UNIVERSAL |
172
|
|
|
|
|
|
|
|
173
|
|
|
|
|
|
|
=head1 Description |
174
|
|
|
|
|
|
|
|
175
|
|
|
|
|
|
|
Pages are transient objects used to pass information to Scanner::Device and |
176
|
|
|
|
|
|
|
Document::Directory objects. |
177
|
|
|
|
|
|
|
|
178
|
|
|
|
|
|
|
=head1 Examples |
179
|
|
|
|
|
|
|
|
180
|
|
|
|
|
|
|
use File::Spec::Scanner::Page; |
181
|
|
|
|
|
|
|
|
182
|
|
|
|
|
|
|
my $flg = Scanner::Page->defaultNameVerifierIs ( $myvfyobj ); |
183
|
|
|
|
|
|
|
|
184
|
|
|
|
|
|
|
my $pg = Scanner::Page->new ( 'format' => $fmt, |
185
|
|
|
|
|
|
|
'date' => "20080818", |
186
|
|
|
|
|
|
|
'title' => "DailyBoggle", |
187
|
|
|
|
|
|
|
'pageid' => "001", |
188
|
|
|
|
|
|
|
); |
189
|
|
|
|
|
|
|
|
190
|
|
|
|
|
|
|
if ($pg->landscape) {print "It is a landscape page.\n";} |
191
|
|
|
|
|
|
|
if ($pg->portrait ) {print "It is a portrait page.\n";} |
192
|
|
|
|
|
|
|
|
193
|
|
|
|
|
|
|
my ($x,$y) = $pg->ScanDimensions; |
194
|
|
|
|
|
|
|
my $pt = $obj->pagetitle; |
195
|
|
|
|
|
|
|
my $date = $obj->date; |
196
|
|
|
|
|
|
|
my $title = $obj->title; |
197
|
|
|
|
|
|
|
my $pgnum = $obj->pageid; |
198
|
|
|
|
|
|
|
my $stitle = $obj->subtitle; |
199
|
|
|
|
|
|
|
|
200
|
|
|
|
|
|
|
=head1 Class Variables |
201
|
|
|
|
|
|
|
|
202
|
|
|
|
|
|
|
DEFAULT_NAME_VERIFIER Class used for verifying a page name |
203
|
|
|
|
|
|
|
consisting of the a set or subset of |
204
|
|
|
|
|
|
|
date-title-pageid-subtitle. Default is undef. |
205
|
|
|
|
|
|
|
|
206
|
|
|
|
|
|
|
=head1 Instance Variables |
207
|
|
|
|
|
|
|
|
208
|
|
|
|
|
|
|
format A Scanner::Format object. |
209
|
|
|
|
|
|
|
date The date part of the page name, eg 19941224. |
210
|
|
|
|
|
|
|
title The document title portion of the name. |
211
|
|
|
|
|
|
|
pageid The pageid, usually a simple page number: 104. |
212
|
|
|
|
|
|
|
subtitle The page title portion of the name. |
213
|
|
|
|
|
|
|
|
214
|
|
|
|
|
|
|
=head1 Class Methods |
215
|
|
|
|
|
|
|
|
216
|
|
|
|
|
|
|
=over 4 |
217
|
|
|
|
|
|
|
|
218
|
|
|
|
|
|
|
=item B<$bool = Scanner::Page-EdefaultNameVerifierIs ( $obj )> |
219
|
|
|
|
|
|
|
|
220
|
|
|
|
|
|
|
Sets the default verifier object. Returns true if it succeeded. A false return |
221
|
|
|
|
|
|
|
could indicate $obj is not a ref. undef is a valid value and will restore the |
222
|
|
|
|
|
|
|
default behavior of the class, ie to do not much of anything about checking |
223
|
|
|
|
|
|
|
the name related fields. |
224
|
|
|
|
|
|
|
|
225
|
|
|
|
|
|
|
A Scanner::Page has several fields for the input of strings used in |
226
|
|
|
|
|
|
|
constructing a full page name. The actual format of these is not directly |
227
|
|
|
|
|
|
|
enforced by this object other than a requirement that the concatenation of |
228
|
|
|
|
|
|
|
them all generate a nonzero string length. |
229
|
|
|
|
|
|
|
|
230
|
|
|
|
|
|
|
In practice it is desirable to check that these fields have strings which will |
231
|
|
|
|
|
|
|
create valid file names when put together in the form: |
232
|
|
|
|
|
|
|
|
233
|
|
|
|
|
|
|
date-title-pageid-subtitle |
234
|
|
|
|
|
|
|
|
235
|
|
|
|
|
|
|
and from which the scanner will eventually create: |
236
|
|
|
|
|
|
|
|
237
|
|
|
|
|
|
|
date-title-pageid-subtitle.jpeg |
238
|
|
|
|
|
|
|
|
239
|
|
|
|
|
|
|
If you wish each new object to check these fields rather than blindly use them |
240
|
|
|
|
|
|
|
as it does by default, you may load a default object with this Class method. |
241
|
|
|
|
|
|
|
Your object must have a method like this: |
242
|
|
|
|
|
|
|
|
243
|
|
|
|
|
|
|
$bool = $myobj->validateName ( $date, $title, $pageid, $subtitle ) |
244
|
|
|
|
|
|
|
|
245
|
|
|
|
|
|
|
If you do nothing, only the simplest of checks, as noted earlier, are done. |
246
|
|
|
|
|
|
|
This may be adequate for many applications which only wish to use the 'title' |
247
|
|
|
|
|
|
|
field and nothing else. |
248
|
|
|
|
|
|
|
|
249
|
|
|
|
|
|
|
=item B<$obj = Scanner::Page-Enew ( named argument list )> |
250
|
|
|
|
|
|
|
|
251
|
|
|
|
|
|
|
This is the Class method for creating new Scanner::Page objects. It may have |
252
|
|
|
|
|
|
|
many different arguments. They are in short: |
253
|
|
|
|
|
|
|
|
254
|
|
|
|
|
|
|
format -> $fmtobj [REQUIRED] |
255
|
|
|
|
|
|
|
date -> date string [OPT: default is ""] |
256
|
|
|
|
|
|
|
title -> title string [OPT: default is ""] |
257
|
|
|
|
|
|
|
pageid -> pageid string [OPT: default is ""] |
258
|
|
|
|
|
|
|
subtitle -> subtitle string [OPT: default is ""] |
259
|
|
|
|
|
|
|
|
260
|
|
|
|
|
|
|
'format' => |
261
|
|
|
|
|
|
|
|
262
|
|
|
|
|
|
|
A format object that defines the orientation and size of the page. |
263
|
|
|
|
|
|
|
|
264
|
|
|
|
|
|
|
'date' => |
265
|
|
|
|
|
|
|
|
266
|
|
|
|
|
|
|
A date to be included as the first part of the page name, where a single date |
267
|
|
|
|
|
|
|
is represented as: |
268
|
|
|
|
|
|
|
|
269
|
|
|
|
|
|
|
yyyymmdd |
270
|
|
|
|
|
|
|
yyyymmddhhmmss |
271
|
|
|
|
|
|
|
|
272
|
|
|
|
|
|
|
and mm and dd may be 00 to represent 'the whole month' or the 'whole year' as |
273
|
|
|
|
|
|
|
in a monthly magazine or a yearly report, or to represent uncertainty, 'it |
274
|
|
|
|
|
|
|
was from sometime in that year'. there may optionally be two dates, so as to |
275
|
|
|
|
|
|
|
represent a period of time associated with the page: |
276
|
|
|
|
|
|
|
|
277
|
|
|
|
|
|
|
date1-date2 |
278
|
|
|
|
|
|
|
|
279
|
|
|
|
|
|
|
The default is the null string: "". |
280
|
|
|
|
|
|
|
|
281
|
|
|
|
|
|
|
'title' => |
282
|
|
|
|
|
|
|
|
283
|
|
|
|
|
|
|
The title associated with the document of which this page is a part or whole |
284
|
|
|
|
|
|
|
if there is only one page. eg |
285
|
|
|
|
|
|
|
|
286
|
|
|
|
|
|
|
ModernQuantumTheory |
287
|
|
|
|
|
|
|
|
288
|
|
|
|
|
|
|
The default is the null string: "". |
289
|
|
|
|
|
|
|
|
290
|
|
|
|
|
|
|
'pageid' => |
291
|
|
|
|
|
|
|
|
292
|
|
|
|
|
|
|
If the document is part of a multi-page document, a representation of the page |
293
|
|
|
|
|
|
|
number is needed. There may be two adjacent pages if the current page is an |
294
|
|
|
|
|
|
|
opened booklet on the scanner. Pageid's may look like the following: |
295
|
|
|
|
|
|
|
|
296
|
|
|
|
|
|
|
000a |
297
|
|
|
|
|
|
|
001 |
298
|
|
|
|
|
|
|
043.01 |
299
|
|
|
|
|
|
|
001-002 |
300
|
|
|
|
|
|
|
|
301
|
|
|
|
|
|
|
The default is the null string: "". |
302
|
|
|
|
|
|
|
|
303
|
|
|
|
|
|
|
'subtitle' => |
304
|
|
|
|
|
|
|
|
305
|
|
|
|
|
|
|
An individual title for the page, the name of an article within a magazine, a |
306
|
|
|
|
|
|
|
comment about the contents of the page... |
307
|
|
|
|
|
|
|
|
308
|
|
|
|
|
|
|
TheCatDied-SmithAndWesson-itsNotDeadYet |
309
|
|
|
|
|
|
|
|
310
|
|
|
|
|
|
|
The default is the null string: "". |
311
|
|
|
|
|
|
|
|
312
|
|
|
|
|
|
|
It returns either a pointer to the newly created and initialized object or |
313
|
|
|
|
|
|
|
undef if the object could not be created. |
314
|
|
|
|
|
|
|
|
315
|
|
|
|
|
|
|
=back 4 |
316
|
|
|
|
|
|
|
|
317
|
|
|
|
|
|
|
=head1 Instance Methods |
318
|
|
|
|
|
|
|
|
319
|
|
|
|
|
|
|
=over 4 |
320
|
|
|
|
|
|
|
|
321
|
|
|
|
|
|
|
=item B<$date = $obj-Edate> |
322
|
|
|
|
|
|
|
|
323
|
|
|
|
|
|
|
Return the date string. |
324
|
|
|
|
|
|
|
|
325
|
|
|
|
|
|
|
=item B<($width, $height) = $obj-E>gt>ScanDimensions> |
326
|
|
|
|
|
|
|
|
327
|
|
|
|
|
|
|
Retrieve the page dimensions to be used for scanning. The height may include |
328
|
|
|
|
|
|
|
extra space for calibration devices as earlier discussed in the |
329
|
|
|
|
|
|
|
Scanner::Page->setDefaultCalibratorFlag section: |
330
|
|
|
|
|
|
|
|
331
|
|
|
|
|
|
|
(width, height+calibratorheight) |
332
|
|
|
|
|
|
|
|
333
|
|
|
|
|
|
|
The scanner might of course have something to say about the height or width we |
334
|
|
|
|
|
|
|
have selected! That, however, is not the Page's problem. It is what it is and |
335
|
|
|
|
|
|
|
it might be too large for the scanner you have. |
336
|
|
|
|
|
|
|
|
337
|
|
|
|
|
|
|
=item B<$obj = $obj-Einfo> |
338
|
|
|
|
|
|
|
|
339
|
|
|
|
|
|
|
Print info on the Scanner::Page to stdout. |
340
|
|
|
|
|
|
|
|
341
|
|
|
|
|
|
|
=item B<$flg = $obj-Elandscape> |
342
|
|
|
|
|
|
|
|
343
|
|
|
|
|
|
|
Return true if it uses a landscape page format. |
344
|
|
|
|
|
|
|
|
345
|
|
|
|
|
|
|
=item B<$pageid = $obj-Epageid> |
346
|
|
|
|
|
|
|
|
347
|
|
|
|
|
|
|
Return the pageid string. |
348
|
|
|
|
|
|
|
|
349
|
|
|
|
|
|
|
=item $pagetitle = $obj->pagetitle |
350
|
|
|
|
|
|
|
|
351
|
|
|
|
|
|
|
Generate the full page title. There are four possible elements, any of which |
352
|
|
|
|
|
|
|
might be null. The page title is built from whichever of date, title, pageid |
353
|
|
|
|
|
|
|
and subtitle are non-null. The title is built up in the order: |
354
|
|
|
|
|
|
|
|
355
|
|
|
|
|
|
|
--p- |
356
|
|
|
|
|
|
|
|
357
|
|
|
|
|
|
|
Possible pagetitles are: |
358
|
|
|
|
|
|
|
|
359
|
|
|
|
|
|
|
20040819 |
360
|
|
|
|
|
|
|
20040819-QuantumTheory |
361
|
|
|
|
|
|
|
20040819-p001 |
362
|
|
|
|
|
|
|
20040819-20100918-QuantumTheoryAdvances-p005-010-ForwardByMartians |
363
|
|
|
|
|
|
|
|
364
|
|
|
|
|
|
|
If somehow all four are null, undef is returned instead of a string. |
365
|
|
|
|
|
|
|
|
366
|
|
|
|
|
|
|
[Internal code question: how should I handle the 'p' that goes before a |
367
|
|
|
|
|
|
|
pageid?] |
368
|
|
|
|
|
|
|
|
369
|
|
|
|
|
|
|
=item B<$flg = $obj-Eportrait> |
370
|
|
|
|
|
|
|
|
371
|
|
|
|
|
|
|
Return true if it uses a portrait page format. |
372
|
|
|
|
|
|
|
|
373
|
|
|
|
|
|
|
=item B<$subtitle = $obj-Esubtitle> |
374
|
|
|
|
|
|
|
|
375
|
|
|
|
|
|
|
Return the subtitle string. |
376
|
|
|
|
|
|
|
|
377
|
|
|
|
|
|
|
=item B<$title = $obj-Etitle> |
378
|
|
|
|
|
|
|
|
379
|
|
|
|
|
|
|
Return the title string. |
380
|
|
|
|
|
|
|
|
381
|
|
|
|
|
|
|
=back 4 |
382
|
|
|
|
|
|
|
|
383
|
|
|
|
|
|
|
=head1 Private Class Methods |
384
|
|
|
|
|
|
|
|
385
|
|
|
|
|
|
|
None. |
386
|
|
|
|
|
|
|
|
387
|
|
|
|
|
|
|
=head1 Private Instance Methods |
388
|
|
|
|
|
|
|
|
389
|
|
|
|
|
|
|
None. |
390
|
|
|
|
|
|
|
|
391
|
|
|
|
|
|
|
=head1 Errors and Warnings |
392
|
|
|
|
|
|
|
|
393
|
|
|
|
|
|
|
None. |
394
|
|
|
|
|
|
|
|
395
|
|
|
|
|
|
|
=head1 KNOWN BUGS |
396
|
|
|
|
|
|
|
|
397
|
|
|
|
|
|
|
See TODO. |
398
|
|
|
|
|
|
|
|
399
|
|
|
|
|
|
|
=head1 SEE ALSO |
400
|
|
|
|
|
|
|
|
401
|
|
|
|
|
|
|
None. |
402
|
|
|
|
|
|
|
|
403
|
|
|
|
|
|
|
=head1 AUTHOR |
404
|
|
|
|
|
|
|
|
405
|
|
|
|
|
|
|
Dale Amon |
406
|
|
|
|
|
|
|
|
407
|
|
|
|
|
|
|
=cut |
408
|
|
|
|
|
|
|
|
409
|
|
|
|
|
|
|
#============================================================================= |
410
|
|
|
|
|
|
|
# CVS HISTORY |
411
|
|
|
|
|
|
|
#============================================================================= |
412
|
|
|
|
|
|
|
# $Log: Page.pm,v $ |
413
|
|
|
|
|
|
|
# Revision 1.3 2008-08-28 23:31:44 amon |
414
|
|
|
|
|
|
|
# Major rewrite. Shuffled code between classes and add lots of features. |
415
|
|
|
|
|
|
|
# |
416
|
|
|
|
|
|
|
# Revision 1.2 2008-08-07 19:52:48 amon |
417
|
|
|
|
|
|
|
# Upgrade source format to current standard. |
418
|
|
|
|
|
|
|
# |
419
|
|
|
|
|
|
|
# Revision 1.1.1.1 2006-06-15 22:06:59 amon |
420
|
|
|
|
|
|
|
# Classes for scanner use abstractions. |
421
|
|
|
|
|
|
|
# |
422
|
|
|
|
|
|
|
# 20060615 Dale Amon |
423
|
|
|
|
|
|
|
# Added check for an attempt to set a zero hieght or width. |
424
|
|
|
|
|
|
|
# 20040818 Dale Amon |
425
|
|
|
|
|
|
|
# Created. |
426
|
|
|
|
|
|
|
1; |