~ubuntu-branches/debian/sid/adabrowse/sid

« back to all changes in this revision

Viewing changes to ad-html.ads

  • Committer: Bazaar Package Importer
  • Author(s): Ludovic Brenta
  • Date: 2004-02-14 13:22:40 UTC
  • Revision ID: james.westby@ubuntu.com-20040214132240-cqumhiq1677pkvzo
Tags: upstream-4.0.2
ImportĀ upstreamĀ versionĀ 4.0.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
-------------------------------------------------------------------------------
 
2
--
 
3
--  This file is part of AdaBrowse.
 
4
--
 
5
-- <STRONG>Copyright (c) 2002 by Thomas Wolf.</STRONG>
 
6
-- <BLOCKQUOTE>
 
7
--    AdaBrowse is free software; you can redistribute it and/or modify it
 
8
--    under the terms of the  GNU General Public License as published by the
 
9
--    Free Software  Foundation; either version 2, or (at your option) any
 
10
--    later version. AdaBrowse is distributed in the hope that it will be
 
11
--    useful, but <EM>without any warranty</EM>; without even the implied
 
12
--    warranty of <EM>merchantability or fitness for a particular purpose.</EM>
 
13
--    See the GNU General Public License for  more details. You should have
 
14
--    received a copy of the GNU General Public License with this distribution,
 
15
--    see file "<A HREF="GPL.txt">GPL.txt</A>". If not, write to the Free
 
16
--    Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 
17
--    USA.
 
18
-- </BLOCKQUOTE>
 
19
--
 
20
-- <DL><DT><STRONG>
 
21
-- Author:</STRONG><DD>
 
22
--   Thomas Wolf  (TW)
 
23
--   <ADDRESS><A HREF="mailto:twolf@acm.org">twolf@acm.org</A></ADDRESS></DL>
 
24
--
 
25
-- <DL><DT><STRONG>
 
26
-- Purpose:</STRONG><DD>
 
27
--   HTML output helper routines.</DL>
 
28
--
 
29
-- <!--
 
30
-- Revision History
 
31
--
 
32
--   02-FEB-2002   TW  First release.
 
33
--   04-FEB-2002   TW  Added 'Get_Compile_Command' for V1.01.
 
34
--   05-FEB-2002   TW  Moved any configuration file thing to AD.Config.
 
35
--   13-MAR-2002   TW  Added 'Header' and 'Footer' with file parameter.
 
36
--                     Also added key 'Index_XRef'.
 
37
--   14-MAR-2002   TW  Added key 'Index_Title'.
 
38
--   03-APR-2002   TW  Moved all items for indices to package AD.Indices.
 
39
--   18-JUN-2002   TW  Removed a bunch of unused operations.
 
40
--   28-JUN-2002   TW  Added function 'Attributes'.
 
41
-- -->
 
42
-------------------------------------------------------------------------------
 
43
 
 
44
pragma License (GPL);
 
45
 
 
46
with Ada.Text_IO;
 
47
 
 
48
package AD.HTML is
 
49
 
 
50
   pragma Elaborate_Body;
 
51
 
 
52
   procedure Header
 
53
     (File  : in Ada.Text_IO.File_Type;
 
54
      Title : in String);
 
55
 
 
56
   procedure Footer
 
57
     (File : in Ada.Text_IO.File_Type);
 
58
 
 
59
   procedure Subtitle
 
60
     (File : in Ada.Text_IO.File_Type;
 
61
      Text : in String);
 
62
 
 
63
   function HTMLize
 
64
     (S             : in String;
 
65
      Keep_Entities : in Boolean := True)
 
66
     return String;
 
67
 
 
68
   function Find_Tag_End
 
69
     (S      : in String;
 
70
      Is_End : in Boolean := False)
 
71
     return Natural;
 
72
   --  Assuming that S starts with a legal HTML tag, finds the closing ">" of
 
73
   --  the tag. Do not use for comments! If no closing ">" can be found,
 
74
   --  returns zero.
 
75
 
 
76
   function Attributes
 
77
     (Source : in String)
 
78
     return String;
 
79
   --  Strips leading and trailing white space and replaces all other white
 
80
   --  space by ' '.
 
81
 
 
82
   function Character_Set
 
83
     return String;
 
84
 
 
85
   ----------------------------------------------------------------------------
 
86
 
 
87
   type HTML_Tag_Kind is (Before, After);
 
88
 
 
89
   function Get_Keyword
 
90
     (What : in HTML_Tag_Kind)
 
91
     return String;
 
92
 
 
93
   function Get_Attribute
 
94
     (What : in HTML_Tag_Kind)
 
95
     return String;
 
96
 
 
97
   function Get_Definition
 
98
     (What : in HTML_Tag_Kind)
 
99
     return String;
 
100
 
 
101
   function Get_Comment
 
102
     (What : in HTML_Tag_Kind)
 
103
     return String;
 
104
 
 
105
   function Get_Literal
 
106
     (What : in HTML_Tag_Kind)
 
107
     return String;
 
108
 
 
109
   ----------------------------------------------------------------------------
 
110
 
 
111
   procedure Set_Char_Set
 
112
     (Id : in String);
 
113
 
 
114
   procedure Set_Style_Sheet
 
115
     (URL : in String);
 
116
 
 
117
   procedure Set_Body
 
118
     (S : in String);
 
119
 
 
120
   procedure Set_Title
 
121
     (What : in HTML_Tag_Kind;
 
122
      S    : in String);
 
123
 
 
124
   procedure Set_Subtitle
 
125
     (What : in HTML_Tag_Kind;
 
126
      S    : in String);
 
127
 
 
128
   procedure Set_Keyword
 
129
     (What : in HTML_Tag_Kind;
 
130
      S    : in String);
 
131
 
 
132
   procedure Set_Attribute
 
133
     (What : in HTML_Tag_Kind;
 
134
      S    : in String);
 
135
 
 
136
   procedure Set_Definition
 
137
     (What : in HTML_Tag_Kind;
 
138
      S    : in String);
 
139
 
 
140
   procedure Set_Comment
 
141
     (What : in HTML_Tag_Kind;
 
142
      S    : in String);
 
143
 
 
144
   procedure Set_Literal
 
145
     (What : in HTML_Tag_Kind;
 
146
      S    : in String);
 
147
 
 
148
end AD.HTML;
 
149
 
 
150