-- $Date: 2004/03/08 10:53:29 $
-- $Revision: 1.3 $
-- $Author: jcrocholl $
-- $Hash: a68b3e49c43a50c90fdc072382d72cde $

-- This file was automatically created with ado.php.
-- Manual changes will be lost when it is updated.

with Ada.Exceptions; use Ada.Exceptions;
with Ada.IO_Exceptions; use Ada.IO_Exceptions;
with Choices; use Choices;
with Glyphs; use Glyphs;
with String_Hash_Tables;

with Strings; use Strings;

package Font_Loaders is

   Font_Not_Found : exception;
   Glyph_Not_Found : exception;

   -- Public representation.
   type Font_Loader is limited private;

   -- Pointer to representation data.
   type Font_Loader_Access is access all Font_Loader;

   -- Constructor for instances.
   function Create
     (Path    : in String;      -- The initial path.
      Special : in Percent)     -- The initial special.
     return Font_Loader_Access-- The newly created font loader.

   -- Accessor to read the path of a font loader.
   function Get_Path
     (This : access Font_Loader-- The font loader to read from.
     return String;              -- The path of that font loader.

   -- Accessor to read the special of a font loader.
   function Get_Special
     (This : access Font_Loader-- The font loader to read from.
     return Percent;             -- The special of that font loader.

   function Glyph_Filename
     (This       : access Font_Loader-- The font loader object instance.
      Glyph_Name : in String)          -- Subdirectory and file name.
     return String;                    -- Full path of the SVG file.

   function Load_Glyph
     (This       : access Font_Loader-- The font loader object instance.
      Glyph_Name : in String)          -- Name of the glyph.
     return Glyph_Access;              -- The newly created glyph.

private

   package Choice_Hash_Tables is new String_Hash_Tables(Choice_Access);
   subtype Choice_Hash_Table is Choice_Hash_Tables.Hash_Table;
   subtype Choice_Hash_Table_Access is Choice_Hash_Tables.Hash_Table_Access;

   -- Private representation.
   type Font_Loader is limited record
      Path    : String_Access-- Font path, eg "../fonts/music/roemer".
      Special : Percent;       -- How many special glyphs?
      Choices : Choice_Hash_Table_Access;
   end record;

end Font_Loaders;