------------------------------------------------------------------------------
--                                                                          --
--                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 Qt4.Menus;
with Qt_Ada.Internals.Object_Registry;
with Qt_Ada.Internals.Objects;

with Qt_Ada.Internals.Objects.Menu_Bar_Proxies;
pragma Warnings (Off, Qt_Ada.Internals.Objects.Menu_Bar_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.Menu_Bars is

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

   function addAction_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, addAction_1_wrapper,
                     "__Qt4Ada_QMenuBar_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_QMenuBar_addMenu_2_wrapper");

   function addMenu_1_wrapper
    (Self : not null access Qt_Ada.Internals.Objects.QObject;
     Title : not null access constant Qt4.Strings.Internals.QString)
       return not null access Qt_Ada.Internals.Objects.QObject;
   pragma Import (C, addMenu_1_wrapper,
                     "__Qt4Ada_QMenuBar_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;
     Title : not null access constant Qt4.Strings.Internals.QString)
       return not null access Qt_Ada.Internals.Objects.QObject;
   pragma Import (C, addMenu_0_wrapper,
                     "__Qt4Ada_QMenuBar_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_QMenuBar_addSeparator_0_wrapper");

   procedure clear_0_wrapper
    (Self : not null access Qt_Ada.Internals.Objects.QObject);
   pragma Import (C, clear_0_wrapper,
                     "__Qt4Ada_QMenuBar_clear_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_QMenuBar_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_QMenuBar_insertSeparator_0_wrapper");

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

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

   procedure setDefaultUp_0_wrapper
    (Self : not null access Qt_Ada.Internals.Objects.QObject;
     U : Qt4.bool);
   pragma Import (C, setDefaultUp_0_wrapper,
                     "__Qt4Ada_QMenuBar_setDefaultUp_0_wrapper");

   pragma Style_Checks ("N");

   -------------------
   -- Active_Action --
   -------------------

   function Active_Action
    (Self : not null access constant Q_Menu_Bar'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
           (activeAction_0_wrapper
             (Self.QObject_View)).all)'Access;
   end Active_Action;

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

   function Add_Action
    (Self : not null access Q_Menu_Bar'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_1_wrapper
             (Self.QObject_View,
              Qt4.Strings.Internals.QString_View (Text))).all)'Access;
   end Add_Action;

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

   function Add_Menu
    (Self : not null access Q_Menu_Bar'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_Bar'Class;
     Title : 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 (Title))).all)'Access;
   end Add_Menu;

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

   function Add_Menu
    (Self : not null access Q_Menu_Bar'Class;
     Icon : Qt4.Icons.Q_Icon;
     Title : 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 (Title))).all)'Access;
   end Add_Menu;

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

   function Add_Separator
    (Self : not null access Q_Menu_Bar'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_Bar'Class)
   is
   begin
      clear_0_wrapper
       (Self.QObject_View);
   end Clear;

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

   function Insert_Menu
    (Self : not null access Q_Menu_Bar'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_Bar'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_Default_Up --
   -------------------

   function Is_Default_Up
    (Self : not null access constant Q_Menu_Bar'Class)
       return Standard.Boolean
   is
   begin
      return
        Qt4.To_Boolean
         (isDefaultUp_0_wrapper
           (Self.QObject_View));
   end Is_Default_Up;

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

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

   --------------------
   -- Set_Default_Up --
   --------------------

   procedure Set_Default_Up
    (Self : not null access Q_Menu_Bar'Class;
     U : Standard.Boolean)
   is
   begin
      setDefaultUp_0_wrapper
       (Self.QObject_View,
        Qt4.To_bool (U));
   end Set_Default_Up;

end Qt4.Menu_Bars;
