------------------------------------------------------------------------------
--                                                                          --
--                An Ada2005 binding to the Qt C++ framework                --
--                                                                          --
------------------------------------------------------------------------------
--                                                                          --
-- Copyright © 2008-2010 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.                                      --
--                                                                          --
------------------------------------------------------------------------------
--  $Revision: 3793 $ $Date: 2010-10-29 20:53:24 +0400 (Fri, 29 Oct 2010) $
------------------------------------------------------------------------------
with Qt_Ada.Internals.Object_Registry;
with Qt_Ada.Internals.Objects;
with Qt_Ada.Internals.Objects.Widget_Utilities;

package body Qt4.Designer_Custom_Widget_Interfaces.View is

   ---------------------------------------------------------------------------
   --! <Subprogram>
   --!    <Unit> createWidget_dispatch
   --!    <Purpose> Подпрограмма-обёртка вызова статической функции
   --! QDesignerCustomWidgetInterface::createWidget.
   --!    <Exceptions>
   ---------------------------------------------------------------------------
   function createWidget_dispatch
    (Self   : not null access Q_Designer_Custom_Widget_Interface'Class;
     Parent : access Qt_Ada.Internals.Objects.QObject)
       return not null access Qt_Ada.Internals.Objects.QObject;
   pragma Export
    (C,
     createWidget_dispatch,
     "__Qt4Ada_QDesignerCustomWidgetInterface_createWidget_dispatch");
   pragma Warnings (Off, createWidget_dispatch);

   ---------------------------------------------------------------------------
   --! <Subprogram>
   --!    <Unit> includeFile_dispatch
   --!    <Purpose> Подпрограмма-обёртка вызова статической функции
   --! QDesignerCustomWidgetInterface::includeFile.
   --!    <Exceptions>
   ---------------------------------------------------------------------------
   function includeFile_dispatch
    (Self : not null access Q_Designer_Custom_Widget_Interface'Class)
       return not null access Qt4.Strings.Internals.QString;
   pragma Export
    (C,
     includeFile_dispatch,
     "__Qt4Ada_QDesignerCustomWidgetInterface_includeFile_dispatch");
   pragma Warnings (Off, includeFile_dispatch);

   ---------------------------------------------------------------------------
   --! <Subprogram>
   --!    <Unit> whatsThis_dispatch
   --!    <Purpose> Подпрограмма-обёртка вызова статической функции
   --! QDesignerCustomWidgetInterface::whatsThis.
   --!    <Exceptions>
   ---------------------------------------------------------------------------
   function whatsThis_dispatch
    (Self : not null access Q_Designer_Custom_Widget_Interface'Class)
       return not null access Qt4.Strings.Internals.QString;
   pragma Export
    (C,
     whatsThis_dispatch,
     "__Qt4Ada_QDesignerCustomWidgetInterface_whatsThis_dispatch");
   pragma Warnings (Off, whatsThis_dispatch);

   ---------------------------------------------------------------------------
   --! <Subprogram>
   --!    <Unit> toolTip_dispatch
   --!    <Purpose> Подпрограмма-обёртка вызова статической функции
   --! QDesignerCustomWidgetInterface::toolTip.
   --!    <Exceptions>
   ---------------------------------------------------------------------------
   function toolTip_dispatch
    (Self : not null access Q_Designer_Custom_Widget_Interface'Class)
       return not null access Qt4.Strings.Internals.QString;
   pragma Export
    (C,
     toolTip_dispatch,
     "__Qt4Ada_QDesignerCustomWidgetInterface_toolTip_dispatch");
   pragma Warnings (Off, toolTip_dispatch);

   ---------------------------------------------------------------------------
   --! <Subprogram>
   --!    <Unit> name_dispatch
   --!    <Purpose> Подпрограмма-обёртка вызова статической функции
   --! QDesignerCustomWidgetInterface::name.
   --!    <Exceptions>
   ---------------------------------------------------------------------------
   function name_dispatch
    (Self : not null access Q_Designer_Custom_Widget_Interface'Class)
       return not null access Qt4.Strings.Internals.QString;
   pragma Export
    (C,
     name_dispatch,
     "__Qt4Ada_QDesignerCustomWidgetInterface_name_dispatch");
   pragma Warnings (Off, name_dispatch);

   ---------------------------------------------------------------------------
   --! <Subprogram>
   --!    <Unit> group_dispatch
   --!    <Purpose> Подпрограмма-обёртка вызова статической функции
   --! QDesignerCustomWidgetInterface::group.
   --!    <Exceptions>
   ---------------------------------------------------------------------------
   function group_dispatch
    (Self : not null access Q_Designer_Custom_Widget_Interface'Class)
       return not null access Qt4.Strings.Internals.QString;
   pragma Export
    (C,
     group_dispatch,
     "__Qt4Ada_QDesignerCustomWidgetInterface_group_dispatch");
   pragma Warnings (Off, group_dispatch);

   ---------------------------------------------------------------------------
   --! <Subprogram>
   --!    <Unit> isContainer_dispatch
   --!    <Purpose> Подпрограмма-обёртка вызова статической функции
   --! QDesignerCustomWidgetInterface::isConstainer.
   --!    <Exceptions>
   ---------------------------------------------------------------------------
   function isContainer_dispatch
    (Self : not null access Q_Designer_Custom_Widget_Interface'Class)
       return Qt4.bool;
   pragma Export
    (C,
     isContainer_dispatch,
     "__Qt4Ada_QDesignerCustomWidgetInterface_isContainer_dispatch");
   pragma Warnings (Off, isContainer_dispatch);

   ---------------------------------------------------------------------------
   --! <Subprogram>
   --!    <Unit> isInitialized_dispatch
   --!    <Purpose> Подпрограмма-обёртка вызова статической функции
   --! QDesignerCustomWidgetInterface::isInitialized.
   --!    <Exceptions>
   ---------------------------------------------------------------------------
   function isInitialized_dispatch
    (Self : not null access Q_Designer_Custom_Widget_Interface'Class)
       return Qt4.bool;
   pragma Export
    (C,
     isInitialized_dispatch,
     "__Qt4Ada_QDesignerCustomWidgetInterface_isInitialized_dispatch");
   pragma Warnings (Off, isInitialized_dispatch);

   ---------------------------------------------------------------------------
   --! <Subprogram>
   --!    <Unit> domXml_dispatch
   --!    <Purpose> Подпрограмма-обёртка вызова статической функции
   --! QDesignerCustomWidgetInterface::domXml.
   --!    <Exceptions>
   ---------------------------------------------------------------------------
   function domXml_dispatch
    (Self : not null access Q_Designer_Custom_Widget_Interface'Class)
       return not null access Qt4.Strings.Internals.QString;
   pragma Export
    (C,
     domXml_dispatch,
     "__Qt4Ada_QDesignerCustomWidgetInterface_domXml_dispatch");
   pragma Warnings (Off, domXml_dispatch);

   ---------------------------------------------------------------------------
   --! <Subprogram>
   --!    <Unit> initialize_dispatch
   --!    <Purpose> Подпрограмма-обёртка вызова статической функции
   --! QDesignerCustomWidgetInterface::initialize.
   --!    <Exceptions>
   ---------------------------------------------------------------------------
   procedure initialize_dispatch
    (Self        : not null access Q_Designer_Custom_Widget_Interface'Class;
     Form_Editor : access Qt_Ada.Internals.Objects.QObject);
   pragma Export
    (C,
     initialize_dispatch,
     "__Qt4Ada_QDesignerCustomWidgetInterface_initialize_dispatch");
   pragma Warnings (Off, initialize_dispatch);

   -------------------
   -- Create_Widget --
   -------------------

   overriding function Create_Widget
    (Self   : not null access Q_Designer_Custom_Widget_Interface_View;
     Parent : access Qt4.Widgets.Q_Widget'Class)
       return not null access Qt4.Widgets.Q_Widget'Class is
   begin
      return Self.Owner.Create_Widget (Parent);
   end Create_Widget;

   ---------------------------
   -- createWidget_dispatch --
   ---------------------------

   function createWidget_dispatch
    (Self   : not null access Q_Designer_Custom_Widget_Interface'Class;
     Parent : access Qt_Ada.Internals.Objects.QObject)
       return not null access Qt_Ada.Internals.Objects.QObject is
   begin
      return
        Self.Create_Widget
         (Qt_Ada.Internals.Objects.Widget_Utilities.Corresponding_Q_Widget
           (Parent)).QObject_View;
   end createWidget_dispatch;

   ---------------------------------------------------------------------------
   --! <Subprogram>
   --!    <Unit> Dom_Xml
   --!    <ImplementationNotes>
   ---------------------------------------------------------------------------
   overriding function Dom_Xml
    (Self : not null access Q_Designer_Custom_Widget_Interface_View)
     return Qt4.Strings.Q_String
   is
   begin
      return Self.Owner.Dom_Xml;
   end Dom_Xml;

   ---------------------------------------------------------------------------
   --! <Subprogram>
   --!    <Unit> domXml_dispatch
   --!    <ImplementationNotes>
   ---------------------------------------------------------------------------
   function domXml_dispatch
    (Self : not null access Q_Designer_Custom_Widget_Interface'Class)
       return not null access Qt4.Strings.Internals.QString
   is
   begin
      return
        Qt4.Strings.Thin.copy_QString
         (Qt4.Strings.Internals.QString_View (Self.Dom_Xml));
   end domXml_dispatch;

   ---------------------------------------------------------------------------
   --! <Subprogram>
   --!    <Unit> Group
   --!    <ImplementationNotes>
   ---------------------------------------------------------------------------
   overriding function Group
    (Self : not null access Q_Designer_Custom_Widget_Interface_View)
       return Qt4.Strings.Q_String
   is
   begin
      return Self.Owner.Group;
   end Group;

   ---------------------------------------------------------------------------
   --! <Subprogram>
   --!    <Unit> group_dispatch
   --!    <ImplementationNotes>
   ---------------------------------------------------------------------------
   function group_dispatch
    (Self : not null access Q_Designer_Custom_Widget_Interface'Class)
       return not null access Qt4.Strings.Internals.QString
   is
   begin
      return
        Qt4.Strings.Thin.copy_QString
         (Qt4.Strings.Internals.QString_View (Self.Group));
   end group_dispatch;

   ---------------------------------------------------------------------------
   --! <Subprogram>
   --!    <Unit> Include_File
   --!    <ImplementationNotes>
   ---------------------------------------------------------------------------
   overriding function Include_File
    (Self : not null access Q_Designer_Custom_Widget_Interface_View)
       return Qt4.Strings.Q_String
   is
   begin
      return Self.Owner.Include_File;
   end Include_File;

   ---------------------------------------------------------------------------
   --! <Subprogram>
   --!    <Unit> includeFile_dispatch
   --!    <ImplementationNotes>
   ---------------------------------------------------------------------------
   function includeFile_dispatch
    (Self : not null access Q_Designer_Custom_Widget_Interface'Class)
       return not null access Qt4.Strings.Internals.QString
   is
   begin
      return
        Qt4.Strings.Thin.copy_QString
         (Qt4.Strings.Internals.QString_View (Self.Include_File));
   end includeFile_dispatch;

   -------------------------
   -- initialize_dispatch --
   -------------------------

   procedure initialize_dispatch
    (Self        : not null access Q_Designer_Custom_Widget_Interface'Class;
     Form_Editor : access Qt_Ada.Internals.Objects.QObject) is
   begin
      Self.Initialize
       (Qt4.Designer_Form_Editor_Interfaces.Q_Designer_Form_Editor_Interface'Class
         (Qt_Ada.Internals.Object_Registry.To_Q_Object
           (Form_Editor).all)'Access);
   end initialize_dispatch;

   ----------------
   -- Initialize --
   ----------------

   overriding procedure Initialize
    (Self        : not null access Q_Designer_Custom_Widget_Interface_View;
     Form_Editor : not null access
       Qt4.Designer_Form_Editor_Interfaces.Q_Designer_Form_Editor_Interface'Class) is
   begin
      Self.Owner.Initialize (Form_Editor);
   end Initialize;

   ---------------------------------------------------------------------------
   --! <Subprogram>
   --!    <Unit> Is_Container
   --!    <ImplementationNotes>
   ---------------------------------------------------------------------------
   overriding function Is_Container
    (Self : not null access Q_Designer_Custom_Widget_Interface_View)
       return Boolean
   is
   begin
      return Self.Owner.Is_Container;
   end Is_Container;

   ---------------------------------------------------------------------------
   --! <Subprogram>
   --!    <Unit> Is_Initialized
   --!    <ImplementationNotes>
   ---------------------------------------------------------------------------
   overriding function Is_Initialized
    (Self : not null access Q_Designer_Custom_Widget_Interface_View)
       return Boolean
   is
   begin
      return Self.Owner.Is_Initialized;
   end Is_Initialized;

   ---------------------------------------------------------------------------
   --! <Subprogram>
   --!    <Unit> isContainer_dispatch
   --!    <ImplementationNotes>
   ---------------------------------------------------------------------------
   function isContainer_dispatch
    (Self : not null access Q_Designer_Custom_Widget_Interface'Class)
       return Qt4.bool
   is
   begin
      return Qt4.To_bool (Self.Is_Container);
   end isContainer_dispatch;

   ---------------------------------------------------------------------------
   --! <Subprogram>
   --!    <Unit> isInitialized_dispatch
   --!    <ImplementationNotes>
   ---------------------------------------------------------------------------
   function isInitialized_dispatch
    (Self : not null access Q_Designer_Custom_Widget_Interface'Class)
       return Qt4.bool
   is
   begin
      return Qt4.To_bool (Self.Is_Initialized);
   end isInitialized_dispatch;

   ---------------------------------------------------------------------------
   --! <Subprogram>
   --!    <Unit> Name
   --!    <ImplementationNotes>
   ---------------------------------------------------------------------------
   overriding function Name
    (Self : not null access Q_Designer_Custom_Widget_Interface_View)
       return Qt4.Strings.Q_String
   is
   begin
      return Self.Owner.Name;
   end Name;

   ---------------------------------------------------------------------------
   --! <Subprogram>
   --!    <Unit> name_dispatch
   --!    <ImplementationNotes>
   ---------------------------------------------------------------------------
   function name_dispatch
    (Self : not null access Q_Designer_Custom_Widget_Interface'Class)
       return not null access Qt4.Strings.Internals.QString
   is
   begin
      return
        Qt4.Strings.Thin.copy_QString
         (Qt4.Strings.Internals.QString_View (Self.Name));
   end name_dispatch;

   ---------------------------------------------------------------------------
   --! <Subprogram>
   --!    <Unit> Tool_Tip
   --!    <ImplementationNotes>
   ---------------------------------------------------------------------------
   overriding function Tool_Tip
    (Self : not null access Q_Designer_Custom_Widget_Interface_View)
       return Qt4.Strings.Q_String
   is
   begin
      return Self.Owner.Tool_Tip;
   end Tool_Tip;

   ---------------------------------------------------------------------------
   --! <Subprogram>
   --!    <Unit> toolTip_dispatch
   --!    <ImplementationNotes>
   ---------------------------------------------------------------------------
   function toolTip_dispatch
    (Self : not null access Q_Designer_Custom_Widget_Interface'Class)
       return not null access Qt4.Strings.Internals.QString
   is
   begin
      return
        Qt4.Strings.Thin.copy_QString
         (Qt4.Strings.Internals.QString_View (Self.Tool_Tip));
   end toolTip_dispatch;

   ---------------------------------------------------------------------------
   --! <Subprogram>
   --!    <Unit> Whats_This
   --!    <ImplementationNotes>
   ---------------------------------------------------------------------------
   overriding function Whats_This
    (Self : not null access Q_Designer_Custom_Widget_Interface_View)
       return Qt4.Strings.Q_String
   is
   begin
      return Self.Owner.Whats_This;
   end Whats_This;

   ---------------------------------------------------------------------------
   --! <Subprogram>
   --!    <Unit> whatsThis_dispatch
   --!    <ImplementationNotes>
   ---------------------------------------------------------------------------
   function whatsThis_dispatch
    (Self : not null access Q_Designer_Custom_Widget_Interface'Class)
       return not null access Qt4.Strings.Internals.QString
   is
   begin
      return
        Qt4.Strings.Thin.copy_QString
         (Qt4.Strings.Internals.QString_View (Self.Whats_This));
   end whatsThis_dispatch;

end Qt4.Designer_Custom_Widget_Interfaces.View;
