-- $Date: 2004/03/08 10:42:19 $
-- $Revision: 1.9 $
-- $Author: jcrocholl $
-- $Hash: 3116f54bd5b19814ec2a631091b5f793 $

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

with Ada.Tags; use Ada.Tags;
with Glyphs; use Glyphs;
with Font_Loaders; use Font_Loaders;
with Printers; use Printers;
with Music.Notes; use Music.Notes;

package Boxes.Note_Heads is

   type Stem_Side_Enum is (None, Left, Right);

   subtype Dot_Range is Positive range 1 .. 3;
   type Dot_Array is array(Dot_Range) of Glyph_Access;

   -- Public representation.
   type Note_Head_Box is new Box with private;

   -- Work-around for GNAT bug.
   Note_Head_Box_Tag : constant String;

   -- Pointer to representation data.
   type Note_Head_Box_Access is access all Note_Head_Box;

   -- Constructor for instances.
   function Create
     (Note_Head : in Note_Head_Enum-- The initial note head.
      Filled    : in Boolean;        -- The initial filled.
      Position  : in Integer)        -- The initial position.
     return Note_Head_Box_Access;    -- The newly created note head box.

   -- Accessor to read the note head of a note head box.
   function Get_Note_Head
     (This : access Note_Head_Box-- The note head box to read from.
     return Note_Head_Enum;        -- The note head of that note head box.

   -- Accessor to read the filled of a note head box.
   function Get_Filled
     (This : access Note_Head_Box-- The note head box to read from.
     return Boolean;               -- The filled of that note head box.

   -- Accessor to read the position of a note head box.
   function Get_Position
     (This : access Note_Head_Box-- The note head box to read from.
     return Integer;               -- The position of that note head box.

   -- Mutator to update the stem side of a note head box.
   procedure Set_Stem_Side
     (This      : access Note_Head_Box-- The note head box to be updated.
      Stem_Side : in Stem_Side_Enum);   -- The new stem side of that note head box.

   -- Accessor to read the stem side of a note head box.
   function Get_Stem_Side
     (This : access Note_Head_Box-- The note head box to read from.
     return Stem_Side_Enum;        -- The stem side of that note head box.

   function Get_Name
     (This : access Note_Head_Box-- The note head box object instance.
     return String;                -- The glyph name.

   procedure Layout
     (This : access Note_Head_Box-- The note head box object instance.
      Font : access Font_Loader);  -- Use this font loader.

   procedure Add_Dots
     (This   : access Note_Head_Box-- The note head box object instance.
      Font   : access Font_Loader;   -- Use this font loader.
      Dots   : in Positive;          -- Number of dots.
      Offset : in Vector);           -- Position of first dot.

   procedure Print
     (This   : access Note_Head_Box;      -- The note head box object instance.
      To     : access Printer'Class-- Render to this printer.
      Center : in Vector);                -- Center of container.

private

   -- Private representation.
   type Note_Head_Box is
     new Box with
      record
         Note_Head  : Note_Head_Enum-- The note head in this box.
         Filled     : Boolean;        -- Filled or hollow head?
         Position   : Integer;        -- Up or down from middle line.
         Stem_Side  : Stem_Side_Enum-- Which side of the stem?
         Glyph      : Glyph_Access;   -- The note head glyph.
         Dots       : Dot_Array;      -- Glyphs for the dots.
         Dot_Offset : Vector;         -- Position of first dot.
      end record;

   -- Work-around for GNAT bug.
   Note_Head_Box_Tag : constant String := "boxes.note_heads.note_head_box";

end Boxes.Note_Heads;