--------------------------------------------------------------------------------
--                                                                            --
-- 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 ToolboxTabs related types and methods.
-- $Author$
-- $Date$
-- $Revision$

with System;                     use System;
with System.Unsigned_Types;      use System.Unsigned_Types;

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

package RASCAL.ToolboxTabs is

   --
   --
   --
   procedure Set_State (Window    : in Object_ID;
                        Component : in Component_ID;
                        State     : in System.Unsigned_Types.unsigned;
                        Flags     : in System.Unsigned_Types.unsigned :=0);

   --
   --
   --
   function Get_State (Window    : in Object_ID;
                       Component : in Component_ID;
                       Flags     : in System.Unsigned_Types.unsigned := 0) return System.Unsigned_Types.unsigned;

   --
   --Equivalent to clicking on the specified tab. Returns an error if the
   --supplied tab index is invalid.
   --
   procedure Set_Selected (Window    : in Object_ID;
                           Component : in Component_ID;
                           Index     : in out Natural;
                           Flags     : in System.Unsigned_Types.unsigned := 0);

   --
   --
   --
   function Get_Selected (Window    : in Object_ID;
                          Component : in Component_ID;
                          Flags     : in System.Unsigned_Types.unsigned := 0) return integer;

   --
   -- Returns the window object that a particular tab is associated with.
   --Returns an error if the supplied tab index is invalid.
   --
   function Get_WindowFromTab (Window    : in Object_ID;
                               Component : in Component_ID;
                               Index     : in Natural;
                               Flags     : in System.Unsigned_Types.unsigned := 0) return Object_ID;

   --
   -- Returns the index of the tab which has a particular window associated
   --with it. Note that if you use shared window objects, only the first tab
   --to use a particular window will be returned. Returns -1 if the supplied
   --window object id doesn't match any attached to tabs.
   --
   function Get_TabFromWindow (Window    : in Object_ID;
                               Component : in Component_ID;
                               Tab_Window: in Object_ID;
                               Flags     : in System.Unsigned_Types.unsigned := 0) return integer;

   --
   -- Sets the text for a particular tab. By default the text is the title of
   --the window nested in the tab, but it can be changed with this method.
   --Returns an error if the supplied tab index is invalid.
   --
   procedure Set_Label (Window    : in Object_ID;
                        Component : in Component_ID;
                        Index     : in Natural;
                        Text      : in String;
                        Flags     : in System.Unsigned_Types.unsigned := 0);

   --
   --
   --
   function Get_Label (Window    : in Object_ID;
                       Component : in Component_ID;
                       Index     : in Natural;
                       Flags     : in System.Unsigned_Types.unsigned := 0) return String;

                                                                                                             
private
end RASCAL.ToolboxTabs;
