--------------------------------------------------------------------------------
--                                                                            --
-- Copyright (C) 2004, RISC OS Ada Library (RASCAL) developers.               --
--                                                                            --
-- This library is free software; you can redistribute it and/or              --
-- modify it under the terms of the GNU Lesser General Public                 --
-- License as published by the Free Software Foundation; either               --
-- version 2.1 of the License, or (at your option) any later version.         --
--                                                                            --
-- This library is distributed in the hope that it will be useful,            --
-- but WITHOUT ANY WARRANTY; without even the implied warranty of             --
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU           --
-- Lesser General Public License for more details.                            --
--                                                                            --
-- You should have received a copy of the GNU Lesser General Public           --
-- License along with this library; if not, write to the Free Software        --
-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA    --
--                                                                            --
--------------------------------------------------------------------------------

-- @brief Toolbox button related types and methods.
-- $Author$
-- $Date$
-- $Revision$

with RASCAL.Toolbox;          use RASCAL.Toolbox;
with RASCAL.OS;               use RASCAL.OS;

with System.Unsigned_Types;   use System.Unsigned_Types;

package RASCAL.ToolboxButton is

   -- Flags
   Button_Task_Sprite_Area  : constant := 16#1#;
   Button_Allow_Menu_Clicks : constant := 16#2#;

   --
   -- Returns the flags of the specified button gadget.
   --
   function Get_Flags (Window    : in Object_ID;
                       Component : in Component_ID;
                       Flags     : in System.Unsigned_Types.Unsigned := 0) return System.Unsigned_Types.Unsigned;

   --
   -- Returns the validation string of the button.
   --
   function Get_Validation (Window    : in Object_ID;
                            Component : in Component_ID;
                            Flags     : in System.Unsigned_Types.Unsigned := 0) return String;

   --
   -- Returns the value of the button.
   --
   function Get_Value (Window    : in Object_ID;
                       Component : in Component_ID;
                       Flags     : in System.Unsigned_Types.Unsigned := 0) return String;

   --
   -- Sets the flags of the specified button gadget.
   --
   procedure Set_Flags (Window    : in Object_ID;
                        Component : in Component_ID;
                        Clear     : in System.Unsigned_Types.Unsigned;
                        EOR       : in System.Unsigned_Types.Unsigned;
                        Flags     : in System.Unsigned_Types.Unsigned := 0);

   --
   -- Makes the button use an anti-aliased font. Default is the system font.
   --
   procedure Set_Font (Window       : in Object_ID;
                       Component    : in Component_ID;
                       Font         : in string;
                       Font_Width   : in integer;
                       Font_Height  : in integer;
                       Flags        : in System.Unsigned_Types.Unsigned := 0);

   --
   -- Sets the validation string of the button.
   --
   procedure Set_Validation (Window       : in Object_ID;
                             Component    : in Component_ID;
                             Validation   : in string;
                             Flags        : in System.Unsigned_Types.Unsigned := 0);

   --
   -- Sets the value of the button.
   --
   procedure Set_Value (Window    : in Object_ID;
                        Component : in Component_ID;
                        New_Value : in String;
                        Flags     : in System.Unsigned_Types.Unsigned := 0);


   --
   -- Returns the Foreground colour of the button.
   --
   function Get_Foreground (Window    : in Object_ID;
                            Component : in Component_ID;
                            Flags     : in System.Unsigned_Types.Unsigned := 0) return Wimp_Colour;
                            
   --
   -- Returns the background colour of the button.
   --
   function Get_Background (Window    : in Object_ID;
                            Component : in Component_ID;
                            Flags     : in System.Unsigned_Types.Unsigned := 0) return Wimp_Colour;

   --
   -- Sets the background colour of the icon.
   --
   procedure Set_background (Window    : in Object_ID;
                             Component : in Component_ID;
                             Colour    : in Wimp_Colour;
                             Flags     : in System.Unsigned_Types.Unsigned := 0);

   --
   -- Sets the foreground colour of the icon.
   --
   procedure Set_Foreground (Window    : in Object_ID;
                             Component : in Component_ID;
                             Colour    : in Wimp_Colour;
                             Flags     : in System.Unsigned_Types.Unsigned := 0);
                             
end RASCAL.ToolboxButton;
