------------------------------------------------------------------------------
--                                                                          --
--                An Ada2005 binding to the Qt C++ framework                --
--                                                                          --
------------------------------------------------------------------------------
--                                                                          --
-- Copyright © 2008 Vadim Godunko <vgodunko@gmail.com>                      --
--                                                                          --
-- QtAda is free software;  you can  redistribute it and/or modify it under --
-- terms of the  GNU General Public License as published  by the Free Soft- --
-- ware  Foundation;  either version 2,  or (at your option) any later ver- --
-- sion. QtAda is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY;  without even the  implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License --
-- for  more details.  You should have  received  a copy of the GNU General --
-- Public License distributed with QtAda;  see file COPYING.  If not, write --
-- to  the  Free Software Foundation,  51  Franklin  Street,  Fifth  Floor, --
-- Boston, MA 02110-1301, USA.                                              --
--                                                                          --
-- As a special exception,  if other files  instantiate  generics from this --
-- unit, or you link  this unit with other files  to produce an executable, --
-- this  unit  does not  by itself cause  the resulting  executable  to  be --
-- covered  by the  GNU  General  Public  License.  This exception does not --
-- however invalidate  any other reasons why  the executable file  might be --
-- covered by the  GNU Public License.                                      --
--                                                                          --
------------------------------------------------------------------------------
--    This file has been generated automatically. Please don't edit it.     --
------------------------------------------------------------------------------
with Qt4.Actions;
with Qt_Ada.Internals.Object_Registry;
with Qt_Ada.Internals.Objects;

with Qt_Ada.Internals.Objects.Menu_Proxies;
pragma Warnings (Off, Qt_Ada.Internals.Objects.Menu_Proxies);
--  Elaboration of the proxy tagged type package register proxy object
--  constructor. Bindings must be able to create proxy object of the
--  corresponding tagged type for works properly.

package body Qt4.Menus is

   function actionAt_0_wrapper
    (Self : not null access Qt_Ada.Internals.Objects.QObject;
     Pt : not null access constant Qt4.Points.Internals.QPoint)
       return not null access Qt_Ada.Internals.Objects.QObject;
   pragma Import (C, actionAt_0_wrapper,
                     "__Qt4Ada_QMenu_actionAt_0_wrapper");

   procedure actionGeometry_0_wrapper
    (Self : not null access Qt_Ada.Internals.Objects.QObject;
     Act : not null access Qt_Ada.Internals.Objects.QObject;
     Returns : not null access Qt4.Rects.Internals.QRect);
   pragma Import (C, actionGeometry_0_wrapper,
                     "__Qt4Ada_QMenu_actionGeometry_0_wrapper");

   function addAction_2_wrapper
    (Self : not null access Qt_Ada.Internals.Objects.QObject;
     Text : not null access constant Qt4.Strings.Internals.QString)
       return not null access Qt_Ada.Internals.Objects.QObject;
   pragma Import (C, addAction_2_wrapper,
                     "__Qt4Ada_QMenu_addAction_2_wrapper");

   function addAction_1_wrapper
    (Self : not null access Qt_Ada.Internals.Objects.QObject;
     Icon : not null access constant Qt4.Icons.Internals.QIcon;
     Text : not null access constant Qt4.Strings.Internals.QString)
       return not null access Qt_Ada.Internals.Objects.QObject;
   pragma Import (C, addAction_1_wrapper,
                     "__Qt4Ada_QMenu_addAction_1_wrapper");

   function addMenu_2_wrapper
    (Self : not null access Qt_Ada.Internals.Objects.QObject;
     Menu : not null access Qt_Ada.Internals.Objects.QObject)
       return not null access Qt_Ada.Internals.Objects.QObject;
   pragma Import (C, addMenu_2_wrapper,
                     "__Qt4Ada_QMenu_addMenu_2_wrapper");

   function addMenu_1_wrapper
    (Self : not null access Qt_Ada.Internals.Objects.QObject;
     Text : not null access constant Qt4.Strings.Internals.QString)
       return not null access Qt_Ada.Internals.Objects.QObject;
   pragma Import (C, addMenu_1_wrapper,
                     "__Qt4Ada_QMenu_addMenu_1_wrapper");

   function addMenu_0_wrapper
    (Self : not null access Qt_Ada.Internals.Objects.QObject;
     Icon : not null access constant Qt4.Icons.Internals.QIcon;
     Text : not null access constant Qt4.Strings.Internals.QString)
       return not null access Qt_Ada.Internals.Objects.QObject;
   pragma Import (C, addMenu_0_wrapper,
                     "__Qt4Ada_QMenu_addMenu_0_wrapper");

   function addSeparator_0_wrapper
    (Self : not null access Qt_Ada.Internals.Objects.QObject)
       return not null access Qt_Ada.Internals.Objects.QObject;
   pragma Import (C, addSeparator_0_wrapper,
                     "__Qt4Ada_QMenu_addSeparator_0_wrapper");

   procedure clear_0_wrapper
    (Self : not null access Qt_Ada.Internals.Objects.QObject);
   pragma Import (C, clear_0_wrapper,
                     "__Qt4Ada_QMenu_clear_0_wrapper");

   function defaultAction_0_wrapper
    (Self : not null access Qt_Ada.Internals.Objects.QObject)
       return not null access Qt_Ada.Internals.Objects.QObject;
   pragma Import (C, defaultAction_0_wrapper,
                     "__Qt4Ada_QMenu_defaultAction_0_wrapper");

   function exec_0_wrapper
    (Self : not null access Qt_Ada.Internals.Objects.QObject)
       return not null access Qt_Ada.Internals.Objects.QObject;
   pragma Import (C, exec_0_wrapper,
                     "__Qt4Ada_QMenu_exec_0_wrapper");

   procedure hideTearOffMenu_0_wrapper
    (Self : not null access Qt_Ada.Internals.Objects.QObject);
   pragma Import (C, hideTearOffMenu_0_wrapper,
                     "__Qt4Ada_QMenu_hideTearOffMenu_0_wrapper");

   procedure icon_0_wrapper
    (Self : not null access Qt_Ada.Internals.Objects.QObject;
     Returns : not null access Qt4.Icons.Internals.QIcon);
   pragma Import (C, icon_0_wrapper,
                     "__Qt4Ada_QMenu_icon_0_wrapper");

   function insertMenu_0_wrapper
    (Self : not null access Qt_Ada.Internals.Objects.QObject;
     Before : not null access Qt_Ada.Internals.Objects.QObject;
     Menu : not null access Qt_Ada.Internals.Objects.QObject)
       return not null access Qt_Ada.Internals.Objects.QObject;
   pragma Import (C, insertMenu_0_wrapper,
                     "__Qt4Ada_QMenu_insertMenu_0_wrapper");

   function insertSeparator_0_wrapper
    (Self : not null access Qt_Ada.Internals.Objects.QObject;
     Before : not null access Qt_Ada.Internals.Objects.QObject)
       return not null access Qt_Ada.Internals.Objects.QObject;
   pragma Import (C, insertSeparator_0_wrapper,
                     "__Qt4Ada_QMenu_insertSeparator_0_wrapper");

   function isEmpty_0_wrapper
    (Self : not null access Qt_Ada.Internals.Objects.QObject)
       return Qt4.bool;
   pragma Import (C, isEmpty_0_wrapper,
                     "__Qt4Ada_QMenu_isEmpty_0_wrapper");

   function isTearOffEnabled_0_wrapper
    (Self : not null access Qt_Ada.Internals.Objects.QObject)
       return Qt4.bool;
   pragma Import (C, isTearOffEnabled_0_wrapper,
                     "__Qt4Ada_QMenu_isTearOffEnabled_0_wrapper");

   function isTearOffMenuVisible_0_wrapper
    (Self : not null access Qt_Ada.Internals.Objects.QObject)
       return Qt4.bool;
   pragma Import (C, isTearOffMenuVisible_0_wrapper,
                     "__Qt4Ada_QMenu_isTearOffMenuVisible_0_wrapper");

   function menuAction_0_wrapper
    (Self : not null access Qt_Ada.Internals.Objects.QObject)
       return not null access Qt_Ada.Internals.Objects.QObject;
   pragma Import (C, menuAction_0_wrapper,
                     "__Qt4Ada_QMenu_menuAction_0_wrapper");

   function separatorsCollapsible_0_wrapper
    (Self : not null access Qt_Ada.Internals.Objects.QObject)
       return Qt4.bool;
   pragma Import (C, separatorsCollapsible_0_wrapper,
                     "__Qt4Ada_QMenu_separatorsCollapsible_0_wrapper");

   procedure setActiveAction_0_wrapper
    (Self : not null access Qt_Ada.Internals.Objects.QObject;
     Act : not null access Qt_Ada.Internals.Objects.QObject);
   pragma Import (C, setActiveAction_0_wrapper,
                     "__Qt4Ada_QMenu_setActiveAction_0_wrapper");

   procedure setDefaultAction_0_wrapper
    (Self : not null access Qt_Ada.Internals.Objects.QObject;
     Act : not null access Qt_Ada.Internals.Objects.QObject);
   pragma Import (C, setDefaultAction_0_wrapper,
                     "__Qt4Ada_QMenu_setDefaultAction_0_wrapper");

   procedure setIcon_0_wrapper
    (Self : not null access Qt_Ada.Internals.Objects.QObject;
     Icon : not null access constant Qt4.Icons.Internals.QIcon);
   pragma Import (C, setIcon_0_wrapper,
                     "__Qt4Ada_QMenu_setIcon_0_wrapper");

   procedure setSeparatorsCollapsible_0_wrapper
    (Self : not null access Qt_Ada.Internals.Objects.QObject;
     Collapse : Qt4.bool);
   pragma Import (C, setSeparatorsCollapsible_0_wrapper,
                     "__Qt4Ada_QMenu_setSeparatorsCollapsible_0_wrapper");

   procedure setTearOffEnabled_0_wrapper
    (Self : not null access Qt_Ada.Internals.Objects.QObject;
     Enable : Qt4.bool);
   pragma Import (C, setTearOffEnabled_0_wrapper,
                     "__Qt4Ada_QMenu_setTearOffEnabled_0_wrapper");

   procedure setTitle_0_wrapper
    (Self : not null access Qt_Ada.Internals.Objects.QObject;
     Title : not null access constant Qt4.Strings.Internals.QString);
   pragma Import (C, setTitle_0_wrapper,
                     "__Qt4Ada_QMenu_setTitle_0_wrapper");

   procedure title_0_wrapper
    (Self : not null access Qt_Ada.Internals.Objects.QObject;
     Returns : not null access Qt4.Strings.Internals.QString);
   pragma Import (C, title_0_wrapper,
                     "__Qt4Ada_QMenu_title_0_wrapper");

   pragma Style_Checks ("N");

   ---------------
   -- Action_At --
   ---------------

   function Action_At
    (Self : not null access constant Q_Menu'Class;
     Pt : Qt4.Points.Q_Point)
       return not null access Qt4.Actions.Q_Action'Class
   is
   begin
      return
        Qt4.Actions.Q_Action'Class
         (Qt_Ada.Internals.Object_Registry.To_Q_Object
           (actionAt_0_wrapper
             (Self.QObject_View,
              Qt4.Points.Internals.QPoint_View (Pt))).all)'Access;
   end Action_At;

   ---------------------
   -- Action_Geometry --
   ---------------------

   function Action_Geometry
    (Self : not null access constant Q_Menu'Class;
     Act : not null access Qt4.Actions.Q_Action'Class)
       return Qt4.Rects.Q_Rect
   is
      Returns : Qt4.Rects.Q_Rect;

   begin
      actionGeometry_0_wrapper
       (Self.QObject_View,
        Act.QObject_View,
        Qt4.Rects.Internals.QRect_View (Returns));

      return Returns;
   end Action_Geometry;

   ----------------
   -- Add_Action --
   ----------------

   function Add_Action
    (Self : not null access Q_Menu'Class;
     Text : Qt4.Strings.Q_String)
       return not null access Qt4.Actions.Q_Action'Class
   is
   begin
      return
        Qt4.Actions.Q_Action'Class
         (Qt_Ada.Internals.Object_Registry.To_Q_Object
           (addAction_2_wrapper
             (Self.QObject_View,
              Qt4.Strings.Internals.QString_View (Text))).all)'Access;
   end Add_Action;

   ----------------
   -- Add_Action --
   ----------------

   function Add_Action
    (Self : not null access Q_Menu'Class;
     Icon : Qt4.Icons.Q_Icon;
     Text : Qt4.Strings.Q_String)
       return not null access Qt4.Actions.Q_Action'Class
   is
   begin
      return
        Qt4.Actions.Q_Action'Class
         (Qt_Ada.Internals.Object_Registry.To_Q_Object
           (addAction_1_wrapper
             (Self.QObject_View,
              Qt4.Icons.Internals.QIcon_View (Icon),
              Qt4.Strings.Internals.QString_View (Text))).all)'Access;
   end Add_Action;

   --------------
   -- Add_Menu --
   --------------

   function Add_Menu
    (Self : not null access Q_Menu'Class;
     Menu : not null access Qt4.Menus.Q_Menu'Class)
       return not null access Qt4.Actions.Q_Action'Class
   is
   begin
      return
        Qt4.Actions.Q_Action'Class
         (Qt_Ada.Internals.Object_Registry.To_Q_Object
           (addMenu_2_wrapper
             (Self.QObject_View,
              Menu.QObject_View)).all)'Access;
   end Add_Menu;

   --------------
   -- Add_Menu --
   --------------

   function Add_Menu
    (Self : not null access Q_Menu'Class;
     Text : Qt4.Strings.Q_String)
       return not null access Qt4.Menus.Q_Menu'Class
   is
   begin
      return
        Qt4.Menus.Q_Menu'Class
         (Qt_Ada.Internals.Object_Registry.To_Q_Object
           (addMenu_1_wrapper
             (Self.QObject_View,
              Qt4.Strings.Internals.QString_View (Text))).all)'Access;
   end Add_Menu;

   --------------
   -- Add_Menu --
   --------------

   function Add_Menu
    (Self : not null access Q_Menu'Class;
     Icon : Qt4.Icons.Q_Icon;
     Text : Qt4.Strings.Q_String)
       return not null access Qt4.Menus.Q_Menu'Class
   is
   begin
      return
        Qt4.Menus.Q_Menu'Class
         (Qt_Ada.Internals.Object_Registry.To_Q_Object
           (addMenu_0_wrapper
             (Self.QObject_View,
              Qt4.Icons.Internals.QIcon_View (Icon),
              Qt4.Strings.Internals.QString_View (Text))).all)'Access;
   end Add_Menu;

   -------------------
   -- Add_Separator --
   -------------------

   function Add_Separator
    (Self : not null access Q_Menu'Class)
       return not null access Qt4.Actions.Q_Action'Class
   is
   begin
      return
        Qt4.Actions.Q_Action'Class
         (Qt_Ada.Internals.Object_Registry.To_Q_Object
           (addSeparator_0_wrapper
             (Self.QObject_View)).all)'Access;
   end Add_Separator;

   -----------
   -- Clear --
   -----------

   procedure Clear
    (Self : not null access Q_Menu'Class)
   is
   begin
      clear_0_wrapper
       (Self.QObject_View);
   end Clear;

   --------------------
   -- Default_Action --
   --------------------

   function Default_Action
    (Self : not null access Q_Menu'Class)
       return not null access Qt4.Actions.Q_Action'Class
   is
   begin
      return
        Qt4.Actions.Q_Action'Class
         (Qt_Ada.Internals.Object_Registry.To_Q_Object
           (defaultAction_0_wrapper
             (Self.QObject_View)).all)'Access;
   end Default_Action;

   ----------
   -- Exec --
   ----------

   function Exec
    (Self : not null access Q_Menu'Class)
       return not null access Qt4.Actions.Q_Action'Class
   is
   begin
      return
        Qt4.Actions.Q_Action'Class
         (Qt_Ada.Internals.Object_Registry.To_Q_Object
           (exec_0_wrapper
             (Self.QObject_View)).all)'Access;
   end Exec;

   ------------------------
   -- Hide_Tear_Off_Menu --
   ------------------------

   procedure Hide_Tear_Off_Menu
    (Self : not null access Q_Menu'Class)
   is
   begin
      hideTearOffMenu_0_wrapper
       (Self.QObject_View);
   end Hide_Tear_Off_Menu;

   ----------
   -- Icon --
   ----------

   function Icon
    (Self : not null access constant Q_Menu'Class)
       return Qt4.Icons.Q_Icon
   is
      Returns : Qt4.Icons.Q_Icon;

   begin
      icon_0_wrapper
       (Self.QObject_View,
        Qt4.Icons.Internals.QIcon_View (Returns));

      return Returns;
   end Icon;

   -----------------
   -- Insert_Menu --
   -----------------

   function Insert_Menu
    (Self : not null access Q_Menu'Class;
     Before : not null access Qt4.Actions.Q_Action'Class;
     Menu : not null access Qt4.Menus.Q_Menu'Class)
       return not null access Qt4.Actions.Q_Action'Class
   is
   begin
      return
        Qt4.Actions.Q_Action'Class
         (Qt_Ada.Internals.Object_Registry.To_Q_Object
           (insertMenu_0_wrapper
             (Self.QObject_View,
              Before.QObject_View,
              Menu.QObject_View)).all)'Access;
   end Insert_Menu;

   ----------------------
   -- Insert_Separator --
   ----------------------

   function Insert_Separator
    (Self : not null access Q_Menu'Class;
     Before : not null access Qt4.Actions.Q_Action'Class)
       return not null access Qt4.Actions.Q_Action'Class
   is
   begin
      return
        Qt4.Actions.Q_Action'Class
         (Qt_Ada.Internals.Object_Registry.To_Q_Object
           (insertSeparator_0_wrapper
             (Self.QObject_View,
              Before.QObject_View)).all)'Access;
   end Insert_Separator;

   --------------
   -- Is_Empty --
   --------------

   function Is_Empty
    (Self : not null access constant Q_Menu'Class)
       return Standard.Boolean
   is
   begin
      return
        Qt4.To_Boolean
         (isEmpty_0_wrapper
           (Self.QObject_View));
   end Is_Empty;

   -------------------------
   -- Is_Tear_Off_Enabled --
   -------------------------

   function Is_Tear_Off_Enabled
    (Self : not null access constant Q_Menu'Class)
       return Standard.Boolean
   is
   begin
      return
        Qt4.To_Boolean
         (isTearOffEnabled_0_wrapper
           (Self.QObject_View));
   end Is_Tear_Off_Enabled;

   ------------------------------
   -- Is_Tear_Off_Menu_Visible --
   ------------------------------

   function Is_Tear_Off_Menu_Visible
    (Self : not null access constant Q_Menu'Class)
       return Standard.Boolean
   is
   begin
      return
        Qt4.To_Boolean
         (isTearOffMenuVisible_0_wrapper
           (Self.QObject_View));
   end Is_Tear_Off_Menu_Visible;

   -----------------
   -- Menu_Action --
   -----------------

   function Menu_Action
    (Self : not null access constant Q_Menu'Class)
       return not null access Qt4.Actions.Q_Action'Class
   is
   begin
      return
        Qt4.Actions.Q_Action'Class
         (Qt_Ada.Internals.Object_Registry.To_Q_Object
           (menuAction_0_wrapper
             (Self.QObject_View)).all)'Access;
   end Menu_Action;

   ----------------------------
   -- Separators_Collapsible --
   ----------------------------

   function Separators_Collapsible
    (Self : not null access constant Q_Menu'Class)
       return Standard.Boolean
   is
   begin
      return
        Qt4.To_Boolean
         (separatorsCollapsible_0_wrapper
           (Self.QObject_View));
   end Separators_Collapsible;

   -----------------------
   -- Set_Active_Action --
   -----------------------

   procedure Set_Active_Action
    (Self : not null access Q_Menu'Class;
     Act : not null access Qt4.Actions.Q_Action'Class)
   is
   begin
      setActiveAction_0_wrapper
       (Self.QObject_View,
        Act.QObject_View);
   end Set_Active_Action;

   ------------------------
   -- Set_Default_Action --
   ------------------------

   procedure Set_Default_Action
    (Self : not null access Q_Menu'Class;
     Act : not null access Qt4.Actions.Q_Action'Class)
   is
   begin
      setDefaultAction_0_wrapper
       (Self.QObject_View,
        Act.QObject_View);
   end Set_Default_Action;

   --------------
   -- Set_Icon --
   --------------

   procedure Set_Icon
    (Self : not null access Q_Menu'Class;
     Icon : Qt4.Icons.Q_Icon)
   is
   begin
      setIcon_0_wrapper
       (Self.QObject_View,
        Qt4.Icons.Internals.QIcon_View (Icon));
   end Set_Icon;

   --------------------------------
   -- Set_Separators_Collapsible --
   --------------------------------

   procedure Set_Separators_Collapsible
    (Self : not null access Q_Menu'Class;
     Collapse : Standard.Boolean)
   is
   begin
      setSeparatorsCollapsible_0_wrapper
       (Self.QObject_View,
        Qt4.To_bool (Collapse));
   end Set_Separators_Collapsible;

   --------------------------
   -- Set_Tear_Off_Enabled --
   --------------------------

   procedure Set_Tear_Off_Enabled
    (Self : not null access Q_Menu'Class;
     Enable : Standard.Boolean)
   is
   begin
      setTearOffEnabled_0_wrapper
       (Self.QObject_View,
        Qt4.To_bool (Enable));
   end Set_Tear_Off_Enabled;

   ---------------
   -- Set_Title --
   ---------------

   procedure Set_Title
    (Self : not null access Q_Menu'Class;
     Title : Qt4.Strings.Q_String)
   is
   begin
      setTitle_0_wrapper
       (Self.QObject_View,
        Qt4.Strings.Internals.QString_View (Title));
   end Set_Title;

   -----------
   -- Title --
   -----------

   function Title
    (Self : not null access constant Q_Menu'Class)
       return Qt4.Strings.Q_String
   is
      Returns : Qt4.Strings.Q_String;

   begin
      title_0_wrapper
       (Self.QObject_View,
        Qt4.Strings.Internals.QString_View (Returns));

      return Returns;
   end Title;

end Qt4.Menus;
