Debian Codegraph @

progs/arm_out.ads

raw
1 with ARM_Contents;
2 package ARM_Output is
3
4 --
5 -- Ada reference manual formatter (ARM_Form).
6 --
7 -- This package defines the abstract definition of an output object.
8 -- Output objects are responsible for implementing the details of
9 -- a particular format.
10 --
11 -- We use dispatching calls to call the formatter, so the details of
12 -- formatting are insulated from the code that reads the source and
13 -- determines the details of the text.
14 --
15 -- ---------------------------------------
16 -- Copyright 2000, 2002, 2004, 2005, 2006, 2007, 2011, 2012
17 -- AXE Consultants. All rights reserved.
18 -- P.O. Box 1512, Madison WI 53701
19 -- E-Mail: [email protected]
20 --
21 -- ARM_Form is free software: you can redistribute it and/or modify
22 -- it under the terms of the GNU General Public License version 3
23 -- as published by the Free Software Foundation.
24 --
25 -- AXE CONSULTANTS MAKES THIS TOOL AND SOURCE CODE AVAILABLE ON AN "AS IS"
26 -- BASIS AND MAKES NO WARRANTY, EXPRESS OR IMPLIED, AS TO THE ACCURACY,
27 -- CAPABILITY, EFFICIENCY, MERCHANTABILITY, OR FUNCTIONING OF THIS TOOL.
28 -- IN NO EVENT WILL AXE CONSULTANTS BE LIABLE FOR ANY GENERAL,
29 -- CONSEQUENTIAL, INDIRECT, INCIDENTAL, EXEMPLARY, OR SPECIAL DAMAGES,
30 -- EVEN IF AXE CONSULTANTS HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
31 -- DAMAGES.
32 --
33 -- A copy of the GNU General Public License is available in the file
34 -- gpl-3-0.txt in the standard distribution of the ARM_Form tool.
35 -- Otherwise, see <http://www.gnu.org/licenses/>.
36 --
37 -- If the GPLv3 license is not satisfactory for your needs, a commercial
38 -- use license is available for this tool. Contact Randy at AXE Consultants
39 -- for more information.
40 --
41 -- ---------------------------------------
42 --
43 -- Edit History:
44 --
45 -- 4/14/00 - RLB - Created base package.
46 -- 4/18/00 - RLB - Added index and contents marker routines.
47 -- 4/21/00 - RLB - Added line break and hard space routines.
48 -- 4/24/00 - RLB - Added DR references and Insert/Delete text formats.
49 -- 4/25/00 - RLB - Added size to format.
50 -- 4/29/00 - RLB - Added Indented and Bulleted formats.
51 -- 5/10/00 - RLB - Added Syntax and Hanging formats.
52 -- - RLB - Added End_Hang_Item.
53 -- 5/12/00 - RLB - Added No_Prefix to Start_Paragraph.
54 -- 5/13/00 - RLB - Added Special_Character.
55 -- 5/16/00 - RLB - Added more special characters.
56 -- 5/17/00 - RLB - Added New_Page.
57 -- 5/22/00 - RLB - Added Includes_Changes to Create.
58 -- 5/23/00 - RLB - Added Set_Column and New_Column.
59 -- - Added Tab_Info and Tab_Stops.
60 -- 5/24/00 - RLB - Added Location to Text_Format.
61 -- - RLB - Added No_Breaks and Keep_with_Next to Start_Paragraph.
62 -- 5/25/00 - RLB - Added Big_Files to Create. Added Justification.
63 -- - RLB - Added Separator_Lines and TOC routines.
64 -- 5/26/00 - RLB - Added table operations.
65 -- 6/ 2/00 - RLB - Added Soft_Line_Break.
66 -- 8/ 2/00 - RLB - Added Soft_Hyphen_Break and left and right quote
67 -- characters.
68 -- - RLB - Added new styles.
69 -- 8/ 7/00 - RLB - Added Leading flag to Start_Paragraph, removed "Leading"
70 -- styles.
71 -- 8/11/00 - RLB - Added Hanging_in_Bulleted styles.
72 -- 8/16/00 - RLB - Added Code_Indented_Nested_Bulleted.
73 -- 8/17/00 - RLB - Replaced "Leading" by "Space_After".
74 -- - RLB - Added Nested_Enumerated.
75 -- 8/22/00 - RLB - Added Revised_Clause_Header.
76 -- 9/26/00 - RLB - Added Syntax_Summary style.
77 -- 7/18/02 - RLB - Removed Document parameter from Create, replaced by
78 -- three strings and For_ISO boolean.
79 -- - RLB - Added AI_Reference.
80 -- - RLB - Added Change_Version_Type and uses.
81 -- 9/10/04 - RLB - Added "Both" to possible changes to handle
82 -- replacement of changed text.
83 -- 9/14/04 - RLB - Moved Change_Version_Type to ARM_Contents to
84 -- avoid circularities.
85 -- 11/03/04 - RLB - Added Nested_X2_Bulleted.
86 -- 11/15/04 - RLB - Added Indented_Nested_Bulleted.
87 -- 1/24/05 - RLB - Added Inner_Indented.
88 -- 2/ 1/05 - RLB - Added Turkish chars to allow an AARM note.
89 -- 5/27/05 - RLB - Added arbitrary Unicode characters.
90 -- 1/11/06 - RLB - Eliminated dispatching Create in favor of tailored
91 -- versions.
92 -- 1/13/06 - RLB - Added new Link operations.
93 -- 2/ 8/06 - RLB - Added additional parameters to the table command.
94 -- 2/10/06 - RLB - Added even more additional parameters to the
95 -- table command.
96 -- - RLB - Added picture command.
97 -- 3/28/06 - RLB - Updated the comments on the picture command.
98 -- 9/25/06 - RLB - Added Last_Column_Width to Start_Table.
99 -- 10/13/06 - RLB - Added Local_Link_Start and Local_Link_End to allow
100 -- formatting in the linked text.
101 -- 2/ 9/07 - RLB - Changed comments on AI_Reference.
102 -- 2/13/07 - RLB - Revised to separate style and indent information
103 -- for paragraphs.
104 -- 2/19/07 - RLB - Added Title style to eliminate issues with title
105 -- pages.
106 -- 12/19/07 - RLB - Added limited colors to Text_Format.
107 -- 10/18/11 - RLB - Changed to GPLv3 license.
108 -- 10/25/11 - RLB - Added old insertion version to Revised_Clause_Header.
109 -- 10/18/12 - RLB - Added additional hanging styles to reflect additional
110 -- hang amounts.
111 -- 11/26/12 - RLB - Added subdivision names to Clause_Header and
112 -- Revised_Clause_Header.
113
114 type Output_Type is abstract tagged limited null record;
115
116 Not_Valid_Error : exception; -- Raised when an operation is invalid.
117
118 -- Creation is handled by the individual output types.
119
120 type Top_Level_Subdivision_Name_Kind is (Chapter, Section, Clause);
121
122
123 procedure Close (Output_Object : in out Output_Type) is abstract;
124 -- Close an Output_Object. No further output to the object is
125 -- allowed after this call.
126
127
128 procedure Section (Output_Object : in out Output_Type;
129 Section_Title : in String;
130 Section_Name : in String) is abstract;
131 -- Start a new section. The title is Section_Title (this is
132 -- intended for humans). The name is Section_Name (this is
133 -- intended to be suitable to be a portion of a file name).
134
135 subtype Column_Count is Natural range 1 .. 8;
136 procedure Set_Columns (Output_Object : in out Output_Type;
137 Number_of_Columns : in ARM_Output.Column_Count) is abstract;
138 -- Set the number of columns.
139 -- Raises Not_Valid_Error if in a paragraph.
140
141 type Paragraph_Indent_Type is range 0 .. 7;
142 -- The number of units that the text is indented.
143 -- The indentation of paragraphs is described in "units", a mostly
144 -- fixed amount from the left margin.
145
146 type Paragraph_Style_Type is (
147 -- Styles without prefixes:
148 Normal, -- Normal paragraphs have the style of the body text
149 -- for the Reference Manual.
150 Wide_Above, -- Same as Normal, except that there is additional space
151 -- before the paragraph.
152 Small, -- Like Normal, except for a smaller font. (Use for
153 -- notes and annotations, for instance.)
154 Small_Wide_Above, -- Like Small, except that there is additional space
155 -- before the paragraph.
156 Header, -- Like Normal, but with no empty space following.
157 Small_Header, -- Like Small, but with no empty space following. (Use
158 -- for the header to Notes, for instance).
159 Syntax_Summary, -- The text is in a smaller font, and there is less
160 -- space than normal between lines.
161 Index, -- The text is in a smaller font, and if possible,
162 -- lines that wrap are indented one (additional) unit.
163 Title, -- The text is in a much larger font (+3 in terms
164 -- of size units, nearly double the normal size),
165 -- and with additional space before as in Wide_Above.
166 Examples, -- The text is in a fixed font.
167 Small_Examples, -- The text is in a smaller fixed font.
168 Swiss_Examples, -- The text is in a swiss (sans-serif) font.
169 Small_Swiss_Examples, -- The text is in a smaller swiss (sans-serif) font.
170 -- Styles with prefixes:
171 Bulleted, -- The text is normal other than that it has a right
172 -- indent of one unit, and each paragraph is preceeded
173 -- by a bullet (a solid circle). Indent must be at least
174 -- one.
175 Small_Bulleted, -- Same as Bulleted, except that a smaller font (same as
176 -- for Small) is used.
177 Nested_Bulleted,-- Same as Bulleted, except that a small bullet is used.
178 Small_Nested_Bulleted, -- Same as Small_Bulleted, except that a small
179 -- bullet is used.
180 -- Styles with text prefixes:
181 Enumerated, -- The text is normal other than it has a right indent
182 -- of one unit, but the first part of each paragraph (up
183 -- to the call of End_Hang_Item) hangs out as would a
184 -- bullet. Indent must be at least one.
185 Small_Enumerated, -- Same as Enumerated, except that a smaller font
186 -- (same as for Small) is used.
187 Giant_Hanging, -- The text is normal, but the first part of each
188 -- paragraph (up to the call of End_Hang_Item) hangs
189 -- out four units. Indent must be at least four.
190 Small_Giant_Hanging, -- Same as Giant_Hanging, except that the text is
191 -- in a smaller font (same as Small).
192 Wide_Hanging, -- The text is normal, but the first part of each
193 -- paragraph (up to the call of End_Hang_Item) hangs
194 -- out three units. Indent must be at least three.
195 Small_Wide_Hanging, -- Same as Wide_Hanging, except that the text is
196 -- in a smaller font (same as Small).
197 Medium_Hanging, -- The text is normal, but the first part of each
198 -- paragraph (up to the call of End_Hang_Item) hangs
199 -- out two units. Indent must be at least two.
200 Small_Medium_Hanging, -- Same as Medium_Hanging, except that the text is
201 -- in a smaller font (same as Small).
202 Narrow_Hanging, -- The text is normal, but the first part of each
203 -- paragraph (up to the call of End_Hang_Item) hangs
204 -- out one unit. Indent must be at least one.
205 Small_Narrow_Hanging, -- Same as Narrow_Hanging, except that the text is
206 -- in a smaller font (same as Small).
207 Hanging_in_Bulleted, -- The text is normal, but it has a right indent
208 -- of one unit, and the first part of each
209 -- paragraph (up to the call of End_Hang_Item) hangs
210 -- out two units. Indent must be at least two.
211 Small_Hanging_in_Bulleted); -- Same as Hanging_in_Bulleted, except that
212 -- the text is in a smaller font (same as Small).
213
214 subtype Unprefixed_Style_Subtype is
215 Paragraph_Style_Type range Normal .. Small_Swiss_Examples;
216 -- These styles have no prefix at all.
217 subtype Prefixed_Style_Subtype is
218 Paragraph_Style_Type range Bulleted .. Small_Hanging_in_Bulleted;
219 -- These styles have some sort of prefix.
220 subtype Text_Prefixed_Style_Subtype is
221 Paragraph_Style_Type range Enumerated .. Small_Hanging_in_Bulleted;
222 -- These styles have a text prefix.
223 subtype Bullet_Prefixed_Style_Subtype is
224 Paragraph_Style_Type range Bulleted .. Small_Nested_Bulleted;
225 -- These styles have a bullet prefix.
226
227
228 subtype Tab_Location is Natural range 0 .. 200; -- Location of tab stops, in picas.
229 type Tab_Kind_Type is (Left_Fixed, Left_Proportional);
230 -- Proportional tabs are adjusted based on the default font size of
231 -- the paragraph; they are given as if the font is 12 points.
232 type Tab_Stop_Type is record
233 Stop : Tab_Location;
234 Kind : Tab_Kind_Type;
235 end record;
236 type Tab_Stops_Type is array (1 .. 20) of Tab_Stop_Type;
237 type Tab_Info is record
238 Number : Natural;
239 Stops : Tab_Stops_Type;
240 end record;
241 NO_TABS : constant Tab_Info := (Number => 0, Stops => (others =>
242 (Kind => Left_Fixed, Stop => 0)));
243
244 type Justification_Type is (Default, Justified, Left, Center, Right);
245 -- Defines the text justification for the paragraph.
246
247 type Space_After_Type is (Normal, Narrow, Wide);
248 -- Defines the space following the paragraph. Narrow is about 30%
249 -- less than normal; Wide is about 50% more than normal.
250
251 type Change_Type is (None, Insertion, Deletion, Both);
252 -- Defines the change state. Both means both an Insertion and Deletion.
253
254 procedure Start_Paragraph (Output_Object : in out Output_Type;
255 Style : in ARM_Output.Paragraph_Style_Type;
256 Indent : in ARM_Output.Paragraph_Indent_Type;
257 Number : in String;
258 No_Prefix : in Boolean := False;
259 Tab_Stops : in ARM_Output.Tab_Info := ARM_Output.NO_TABS;
260 No_Breaks : in Boolean := False;
261 Keep_with_Next : in Boolean := False;
262 Space_After : in ARM_Output.Space_After_Type
263 := ARM_Output.Normal;
264 Justification : in ARM_Output.Justification_Type
265 := ARM_Output.Default) is abstract;
266 -- Start a new paragraph. The style and indent of the paragraph is as
267 -- specified. The (AA)RM paragraph number (which might include update
268 -- and version numbers as well: [12.1/1]) is Number. If the format is
269 -- a type with a prefix (bullets, hangining items), the prefix is
270 -- omitted if No_Prefix is true. Tab_Stops defines the tab stops for
271 -- the paragraph. If No_Breaks is True, we will try to avoid page breaks
272 -- in the paragraph. If Keep_with_Next is true, we will try to avoid
273 -- separating this paragraph and the next one. (These may have no
274 -- effect in formats that don't have page breaks). Space_After
275 -- specifies the amount of space following the paragraph. Justification
276 -- specifies the text justification for the paragraph. Not_Valid_Error
277 -- is raised if Tab_Stops /= NO_TABS for a hanging or bulleted format.
278
279 procedure End_Paragraph (Output_Object : in out Output_Type) is abstract;
280 -- End a paragraph.
281
282 procedure Category_Header (Output_Object : in out Output_Type;
283 Header_Text : String) is abstract;
284 -- Output a Category header (that is, "Legality Rules",
285 -- "Dynamic Semantics", etc.)
286 -- (Note: We did not use a enumeration here to insure that these
287 -- headers are spelled the same in all output versions).
288 -- Raises Not_Valid_Error if in a paragraph.
289
290 procedure Clause_Header (Output_Object : in out Output_Type;
291 Header_Text : in String;
292 Level : in ARM_Contents.Level_Type;
293 Clause_Number : in String;
294 Top_Level_Subdivision_Name : in ARM_Output.Top_Level_Subdivision_Name_Kind;
295 No_Page_Break : in Boolean := False) is abstract;
296 -- Output a Clause header. The level of the header is specified
297 -- in Level. The Clause Number is as specified; the top-level (and
298 -- other) subdivision names are as specified. These should appear in
299 -- the table of contents.
300 -- For hyperlinked formats, this should generate a link target.
301 -- If No_Page_Break is True, suppress any page breaks.
302 -- Raises Not_Valid_Error if in a paragraph.
303
304 procedure Revised_Clause_Header
305 (Output_Object : in out Output_Type;
306 New_Header_Text : in String;
307 Old_Header_Text : in String;
308 Level : in ARM_Contents.Level_Type;
309 Clause_Number : in String;
310 Version : in ARM_Contents.Change_Version_Type;
311 Old_Version : in ARM_Contents.Change_Version_Type;
312 Top_Level_Subdivision_Name : in ARM_Output.Top_Level_Subdivision_Name_Kind;
313 No_Page_Break : in Boolean := False) is abstract;
314 -- Output a revised clause header. Both the original and new text will
315 -- be output. The level of the header is specified in Level. The Clause
316 -- Number is as specified; the top-level (and other) subdivision names
317 -- are as specified. These should appear in the table of contents.
318 -- For hyperlinked formats, this should generate a link target.
319 -- Version is the insertion version of the new text; Old_Version is
320 -- the insertion version of the old text.
321 -- If No_Page_Break is True, suppress any page breaks.
322 -- Raises Not_Valid_Error if in a paragraph.
323
324 procedure TOC_Marker (Output_Object : in out Output_Type;
325 For_Start : in Boolean) is abstract;
326 -- Mark the start (if For_Start is True) or end (if For_Start is
327 -- False) of the table of contents data. Output objects that
328 -- auto-generate the table of contents can use this to do needed
329 -- actions.
330
331 type Page_Kind_Type is (Any_Page, Odd_Page_Only, Soft_Page);
332
333 procedure New_Page (Output_Object : in out Output_Type;
334 Kind : ARM_Output.Page_Kind_Type := ARM_Output.Any_Page) is abstract;
335 -- Output a page break.
336 -- Note that this has no effect on non-printing formats.
337 -- Any_Page breaks to the top of the next page (whatever it is);
338 -- Odd_Page_Only breaks to the top of the odd-numbered page;
339 -- Soft_Page allows a page break but does not force one (use in
340 -- "No_Breaks" paragraphs.)
341 -- Raises Not_Valid_Error if in a paragraph if Kind = Any_Page or
342 -- Odd_Page, and if not in a paragraph if Kind = Soft_Page.
343
344 procedure New_Column (Output_Object : in out Output_Type) is abstract;
345 -- Output a column break.
346 -- Raises Not_Valid_Error if in a paragraph, or if the number of
347 -- columns is 1.
348
349 procedure Separator_Line (Output_Object : in out Output_Type;
350 Is_Thin : Boolean := True) is abstract;
351 -- Output a separator line. It is thin if "Is_Thin" is true.
352 -- Raises Not_Valid_Error if in a paragraph.
353
354 type Column_Text_Alignment is (Center_All, Left_All, Center_except_First);
355 type Header_Kind_Type is (Both_Caption_and_Header, Header_Only, No_Headers);
356
357 procedure Start_Table (Output_Object : in out Output_Type;
358 Columns : in ARM_Output.Column_Count;
359 First_Column_Width : in ARM_Output.Column_Count;
360 Last_Column_Width : in ARM_Output.Column_Count;
361 Alignment : in ARM_Output.Column_Text_Alignment;
362 No_Page_Break : in Boolean;
363 Has_Border : in Boolean;
364 Small_Text_Size : in Boolean;
365 Header_Kind : in ARM_Output.Header_Kind_Type) is abstract;
366 -- Starts a table. The number of columns is Columns; the first
367 -- column has First_Column_Width times the normal column width, and
368 -- the last column has Last_Column_Width times the normal column width.
369 -- Alignment is the horizontal text alignment within the columns.
370 -- No_Page_Break should be True to keep the table intact on a single
371 -- page; False to allow it to be split across pages.
372 -- Has_Border should be true if a border is desired, false otherwise.
373 -- Small_Text_Size means that the contents will have the AARM size;
374 -- otherwise it will have the normal size.
375 -- Header_Kind determines whether the table has headers.
376 -- This command starts a paragraph; the entire table is a single
377 -- paragraph. Text will be considered part of the caption until the
378 -- next table marker call.
379 -- Raises Not_Valid_Error if in a paragraph.
380
381 type Table_Marker_Type is (End_Caption, End_Item, End_Header,
382 End_Row, End_Row_Next_Is_Last, End_Table);
383 procedure Table_Marker (Output_Object : in out Output_Type;
384 Marker : in ARM_Output.Table_Marker_Type) is abstract;
385 -- Marks the end of an entity in a table.
386 -- If Marker is End_Caption, the table caption ends and the
387 -- future text is part of the table header.
388 -- If Marker is End_Header, the table header ends and the
389 -- future text is part of the table body.
390 -- If Marker is End_Row, a row in the table is completed, and another
391 -- row started.
392 -- If Marker is End_Row_Next_Is_Last, a row in the table is completed,
393 -- and another row started. That row is the last row in the table.
394 -- If Marker is End_Item, an item in the table header or body is ended,
395 -- and another started.
396 -- If Marker is End_Table, the entire table is finished.
397 -- Raises Not_Valid_Error if not in a table.
398
399 -- Text output: These are only allowed after a Start_Paragraph and
400 -- before any End_Paragraph. Raises Not_Valid_Error if not allowed.
401
402 procedure Ordinary_Text (Output_Object : in out Output_Type;
403 Text : in String) is abstract;
404 -- Output ordinary text.
405 -- The text must end at a word break, never in the middle of a word.
406
407 procedure Ordinary_Character (Output_Object : in out Output_Type;
408 Char : in Character) is abstract;
409 -- Output an ordinary (Latin-1) character.
410 -- Spaces will be used to break lines as needed.
411
412 procedure Hard_Space (Output_Object : in out Output_Type) is abstract;
413 -- Output a hard space. No line break should happen at a hard space.
414
415 procedure Line_Break (Output_Object : in out Output_Type) is abstract;
416 -- Output a line break. This does not start a new paragraph.
417 -- This corresponds to a "<BR>" in HTML.
418
419 procedure Index_Line_Break (Output_Object : in out Output_Type;
420 Clear_Keep_with_Next : in Boolean) is abstract;
421 -- Output a line break for the index. This does not start a new
422 -- paragraph in terms of spacing. This corresponds to a "<BR>"
423 -- in HTML. If Clear_Keep_with_Next is true, insure that the next
424 -- line does not require the following line to stay with it.
425 -- Raises Not_Valid_Error if the paragraph is not in the index format.
426
427 procedure Soft_Line_Break (Output_Object : in out Output_Type) is abstract;
428 -- Output a soft line break. This is a place (in the middle of a
429 -- "word") that we allow a line break. It is usually used after
430 -- underscores in long non-terminals.
431
432 procedure Soft_Hyphen_Break (Output_Object : in out Output_Type) is abstract;
433 -- Output a soft line break, with a hyphen. This is a place (in the middle of
434 -- a "word") that we allow a line break. If the line break is used,
435 -- a hyphen will be added to the text.
436
437 procedure Tab (Output_Object : in out Output_Type) is abstract;
438 -- Output a tab, inserting space up to the next tab stop.
439 -- Raises Not_Valid_Error if the paragraph was created with
440 -- Tab_Stops = ARM_Output.NO_TABS.
441
442 type Special_Character_Type is (EM_Dash, -- EM (very long) dash.
443 EN_Dash, -- EN (long) dash
444 GEQ, -- Greater than or equal symbol.
445 LEQ, -- Less than or equal symbol.
446 NEQ, -- Not equal symbol.
447 PI, -- PI.
448 Left_Ceiling, -- Left half of ceiling.
449 Right_Ceiling, -- Right half of ceiling.
450 Left_Floor, -- Left half of floor.
451 Right_Floor, -- Right half of floor.
452 Thin_Space, -- A thinner than usual space.
453 Left_Quote, -- A left facing single quote.
454 Right_Quote, -- A right facing single quote.
455 Left_Double_Quote, -- A left facing double quote.
456 Right_Double_Quote, -- A right facing double quote.
457 Small_Dotless_I, -- A small i without a dot (Unicode(16#0131#).
458 Capital_Dotted_I -- A large I with a dot (Unicode(16#0130#).
459 );
460
461 procedure Special_Character (Output_Object : in out Output_Type;
462 Char : in ARM_Output.Special_Character_Type) is abstract;
463 -- Output an special character.
464
465 type Unicode_Type is range 0 .. 2**31-2;
466
467 procedure Unicode_Character (Output_Object : in out Output_Type;
468 Char : in ARM_Output.Unicode_Type) is abstract;
469 -- Output a Unicode character, with code position Char.
470
471 procedure End_Hang_Item (Output_Object : in out Output_Type) is abstract;
472 -- Marks the end of a hanging item. Call only once per paragraph.
473 -- Raises Not_Valid_Error if the paragraph style is not in
474 -- Text_Prefixed_Style_Subtype, or if this has already been
475 -- called for the current paragraph, or if the paragraph was started
476 -- with No_Prefix = True.
477
478
479 type Font_Family_Type is (Roman, Swiss, Fixed, Default);
480 -- Determines the font family. "Default" is the font family
481 -- of a paragraph before it is changed.
482
483 type Size_Type is range -9 .. 9;
484 -- Determines the relative size. This is the change in size. For
485 -- formats that allow it, this is the change in size in points.
486 -- Otherwise, this is a relative change.
487
488 type Color_Type is (Default, Black, Red, Green, Blue);
489 -- Determines the text color. "Default" is usually black,
490 -- although some formats may use color to indicate changes.
491
492 type Location_Type is (Normal, Subscript, Superscript);
493 -- Determines the location (vertical position) of the text: in the
494 -- normal position, subscripted (below the normal position), or
495 -- superscripted (above the normal position).
496
497 type Format_Type is record
498 -- A grouping of all of the format parameters.
499 Bold : Boolean;
500 Italic : Boolean;
501 Font : ARM_Output.Font_Family_Type;
502 Size : ARM_Output.Size_Type;
503 Color : ARM_Output.Color_Type;
504 Change : ARM_Output.Change_Type;
505 Version : ARM_Contents.Change_Version_Type;
506 Added_Version : ARM_Contents.Change_Version_Type;
507 -- Only used when Change = Both; this is then the version
508 -- of the insertion, and Version is then the version of the deletion.
509 Location : ARM_Output.Location_Type;
510 end record;
511 NORMAL_FORMAT : constant Format_Type :=
512 (Bold => False, Italic => False, Font => Default,
513 Size => 0, Color => Default, Change => None, Version => '0',
514 Added_Version => '0', Location => Normal);
515 -- The format of utterly normal text. Usually used to reset
516 -- the format or for initialization.
517
518 procedure Text_Format (Output_Object : in out Output_Type;
519 Format : in ARM_Output.Format_Type) is abstract;
520 -- Change the text format so that all of the properties are as specified.
521 -- Note: Changes to these properties ought be stack-like; that is,
522 -- Bold on, Italic on, Italic off, Bold off is OK; Bold on, Italic on,
523 -- Bold off, Italic off should be avoided (as separate commands).
524
525 procedure Clause_Reference (Output_Object : in out Output_Type;
526 Text : in String;
527 Clause_Number : in String) is abstract;
528 -- Generate a reference to a clause in the standard. The text of
529 -- the reference is "Text", and the number of the clause is
530 -- Clause_Number. For hyperlinked formats, this should generate
531 -- a link; for other formats, the text alone is generated.
532
533 procedure Index_Target (Output_Object : in out Output_Type;
534 Index_Key : in Natural) is abstract;
535 -- Generate a index target. This marks the location where an index
536 -- reference occurs. Index_Key names the index item involved.
537 -- For hyperlinked formats, this should generate a link target;
538 -- for other formats, nothing is generated.
539
540 procedure Index_Reference (Output_Object : in out Output_Type;
541 Text : in String;
542 Index_Key : in Natural;
543 Clause_Number : in String) is abstract;
544 -- Generate a reference to an index target in the standard. The text
545 -- of the reference is "Text", and Index_Key and Clause_Number denotes
546 -- the target. For hyperlinked formats, this should generate
547 -- a link; for other formats, the text alone is generated.
548
549 procedure DR_Reference (Output_Object : in out Output_Type;
550 Text : in String;
551 DR_Number : in String) is abstract;
552 -- Generate a reference to a DR from the standard. The text
553 -- of the reference is "Text", and DR_Number denotes
554 -- the target. For hyperlinked formats, this should generate
555 -- a link; for other formats, the text alone is generated.
556
557 procedure AI_Reference (Output_Object : in out Output_Type;
558 Text : in String;
559 AI_Number : in String) is abstract;
560 -- Generate a reference to an AI from the standard. The text
561 -- of the reference is "Text", and AI_Number denotes
562 -- the target (in unfolded format). For hyperlinked formats, this
563 -- should generate a link; for other formats, the text alone is
564 -- generated.
565
566 procedure Local_Target (Output_Object : in out Output_Type;
567 Text : in String;
568 Target : in String) is abstract;
569 -- Generate a local target. This marks the potential target of local
570 -- links identified by "Target". Text is the text of the target.
571 -- For hyperlinked formats, this should generate a link target;
572 -- for other formats, only the text is generated.
573
574 procedure Local_Link (Output_Object : in out Output_Type;
575 Text : in String;
576 Target : in String;
577 Clause_Number : in String) is abstract;
578 -- Generate a local link to the target and clause given.
579 -- Text is the text of the link.
580 -- For hyperlinked formats, this should generate a link;
581 -- for other formats, only the text is generated.
582
583 procedure Local_Link_Start (Output_Object : in out Output_Type;
584 Target : in String;
585 Clause_Number : in String) is abstract;
586 -- Generate a local link to the target and clause given.
587 -- The link will surround text until Local_Link_End is called.
588 -- Local_Link_End must be called before this routine can be used again.
589 -- For hyperlinked formats, this should generate a link;
590 -- for other formats, only the text is generated.
591
592 procedure Local_Link_End (Output_Object : in out Output_Type;
593 Target : in String;
594 Clause_Number : in String) is abstract;
595 -- End a local link for the target and clause given.
596 -- This must be in the same paragraph as the Local_Link_Start.
597 -- For hyperlinked formats, this should generate a link;
598 -- for other formats, only the text is generated.
599
600 procedure URL_Link (Output_Object : in out Output_Type;
601 Text : in String;
602 URL : in String) is abstract;
603 -- Generate a link to the URL given.
604 -- Text is the text of the link.
605 -- For hyperlinked formats, this should generate a link;
606 -- for other formats, only the text is generated.
607
608 type Picture_Alignment is (Inline, Float_Left, Float_Right,
609 Alone_Left, Alone_Right, Alone_Center);
610 -- Inline puts the picture as part of a paragraph;
611 -- Alone styles put the picture as the only things on the line;
612 -- Float styles wrap text around the picture. Alone styles are
613 -- *not* part of paragraphs.
614
615 type Border_Kind is (None, Thin, Thick);
616
617 procedure Picture (Output_Object : in out Output_Type;
618 Name : in String;
619 Descr : in String;
620 Alignment : in ARM_Output.Picture_Alignment;
621 Height, Width : in Natural;
622 Border : in ARM_Output.Border_Kind) is abstract;
623 -- Generate a picture.
624 -- Name is the (simple) file name of the picture; Descr is a
625 -- descriptive name for the picture (it will appear in some web
626 -- browsers).
627 -- We assume that it is a .PNG or .JPG and that it will be present
628 -- in the same directory as the output files.
629 -- Alignment specifies the picture alignment.
630 -- Height and Width specify the picture size in pixels.
631 -- Border specifies the kind of border.
632
633 end ARM_Output;