File Coverage

blib/lib/LibWeb/HTML/Standard.pm
Criterion Covered Total %
statement 11 19 57.8
branch n/a
condition 1 3 33.3
subroutine 3 11 27.2
pod 0 8 0.0
total 15 41 36.5


line stmt bran cond sub pod time code
1             #==============================================================================
2             # LibWeb::HTML::Standard -- An interface defining HTML display for libweb
3             # applications.
4              
5             package LibWeb::HTML::Standard;
6              
7             # Copyright (C) 2000 Colin Kong
8             #
9             # This program is free software; you can redistribute it and/or
10             # modify it under the terms of the GNU General Public License
11             # as published by the Free Software Foundation; either version 2
12             # of the License, or (at your option) any later version.
13             #
14             # This program is distributed in the hope that it will be useful,
15             # but WITHOUT ANY WARRANTY; without even the implied warranty of
16             # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17             # GNU General Public License for more details.
18             #
19             # You should have received a copy of the GNU General Public License
20             # along with this program; if not, write to the Free Software
21             # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22             #=============================================================================
23              
24             # $Id: Standard.pm,v 1.2 2000/07/19 20:31:57 ckyc Exp $
25              
26             $VERSION = '0.02';
27              
28             #-##############################
29             # Use standard libraries.
30 1     1   10 use strict;
  1         3  
  1         65  
31 1     1   6 use vars qw($VERSION @ISA);
  1         144  
  1         1287  
32              
33             #-##############################
34             # Use custom libraries.
35             require LibWeb::Core;
36              
37             #-##############################
38             # Inheritance.
39             @ISA = qw(LibWeb::Core);
40              
41             #-##############################
42             # Methods.
43             sub new {
44             #
45             # Params: $class , $rc_file, $error_object
46             #
47             # - $class is the class/package name of this package, be it a string
48             # or a reference.
49             # - $rc_file is the absolute path to the rc file for LibWeb.
50             # - $error_object is a reference to a perl object for printing out
51             # error/help message to users when error occurs.
52             #
53             # Usage: No, you don't use or ISA this class directly. Use or ISA
54             # LibWeb::HTML::Default instead.
55             #
56 1     1 0 3 my ($class, $Class, $self);
57 1         2 $class = shift;
58 1   33     917 $Class = ref($class) || $class;
59              
60             # Inherit instance variables from the base class.
61 1         15 $self = $Class->SUPER::new( shift, shift );
62 1         6 bless($self, $Class);
63             }
64              
65 0     0     sub DESTROY {}
66              
67             sub display {
68             #
69             # This is an interface describing how to implement this method.
70             # Implementation is done at LibWeb::HTML::Default.
71             #
72             # Override base class method: LibWeb::Core::display().
73             # Params: -content=>, [ -sheader=>, -lpanel=>, -rpanel=>, -header=>, -footer=> ].
74             #
75             # -content, -sheader, -lpanel, -rpanel, -header and -footer must be an ARRAY
76             # ref. to elements which are scalar/SCALAR ref/ARRAY ref.
77             # If the the elements are ARRAY ref., then the elements in that ARRAY ref. must
78             # be scalar and NOT ref.
79             #
80             # -content default is lines read from $self->content().
81             # -sheader default is lines read from $self->sheader().
82             # -lpanel default is lines read from $self->lpanel().
83             # -rpanel default is lines read from $self->rpanel().
84             # -header default is lines read from $self->header().
85             # -footer default is lines read from $self->footer().
86             #
87             # Return a scalar ref. to a formatted page in HTML format for display
88             # to Web client.
89             #
90 0     0 0   return \("You should use or ISA LibWeb::HTML::Default instead.\n");
91             }
92              
93             #================================================================================
94             # Site's HTML constructs: header, sub header, left panel, right panel and footer.
95             # They are interfaces and therefore not implemented. LibWeb::HTML::Default
96             # implements these HTML constructs.
97              
98             sub header {
99 0     0 0   return [' '];
100             }
101              
102             sub sheader {
103 0     0 0   return [' '];
104             }
105              
106             sub content {
107 0     0 0   return [' '];
108             }
109              
110             sub lpanel {
111 0     0 0   return [' '];
112             }
113              
114             sub rpanel {
115 0     0 0   return [' '];
116             }
117              
118             sub footer {
119 0     0 0   return [' '];
120             }
121              
122             1;
123             __DATA__