------------------------------------------------------------------------------
--                                                                          --
--                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.Child_Events;
with Qt4.Events;
with Qt4.Text_Documents;
with Qt4.Text_Formats;
with Qt4.Timer_Events;
with Qt_Ada.Internals.Events;
with Qt_Ada.Internals.Object_Registry;
pragma Elaborate (Qt_Ada.Internals.Object_Registry);
with Qt_Ada.Internals.Objects;
with Qt_Ada.Internals.Objects.Object_Utilities;

package body Qt4.Syntax_Highlighters.Directors is

   function qt_metacall_wrapper
    (Self : not null access Qt_Ada.Internals.Objects.QObject;
     Kind : Qt4.Meta_Objects.Call;
     Id   : Qt4.Q_Integer;
     Args : Qt4.Address_Pointer)
       return Qt4.Q_Integer;
   pragma Import (C, qt_metacall_wrapper,
                  "__Qt4Ada_QSyntaxHighlighter_qt_metacall_wrapper");

   function qt_metacast_wrapper
    (Self  : not null access Qt_Ada.Internals.Objects.QObject;
     Class : Interfaces.C.char_array)
       return System.Address;
   pragma Import (C, qt_metacast_wrapper,
                  "__Qt4Ada_QSyntaxHighlighter_qt_metacast_wrapper");

   function currentBlockState_0_wrapper
    (Self : not null access Qt_Ada.Internals.Objects.QObject)
       return Qt4.Q_Integer;
   pragma Import (C, currentBlockState_0_wrapper,
                     "__Qt4Ada_QSyntaxHighlighter_currentBlockState_0_wrapper");

   procedure highlightBlock_0_dispatch
    (Self : not null Qt_Ada.Internals.Objects.Q_Object_Base_Access;
     Text : not null access Qt4.Strings.Internals.QString);
   pragma Export (C, highlightBlock_0_dispatch,
                     "__Qt4Ada_QSyntaxHighlighter_highlightBlock_0_dispatch");
   pragma Warnings (Off, highlightBlock_0_dispatch);
   --  GCC GNAT 4.3.0: suppress warning
   --  is a tagged type which does not correspond to any C type

   function previousBlockState_0_wrapper
    (Self : not null access Qt_Ada.Internals.Objects.QObject)
       return Qt4.Q_Integer;
   pragma Import (C, previousBlockState_0_wrapper,
                     "__Qt4Ada_QSyntaxHighlighter_previousBlockState_0_wrapper");

   procedure setCurrentBlockState_0_wrapper
    (Self : not null access Qt_Ada.Internals.Objects.QObject;
     New_State : Qt4.Q_Integer);
   pragma Import (C, setCurrentBlockState_0_wrapper,
                     "__Qt4Ada_QSyntaxHighlighter_setCurrentBlockState_0_wrapper");

   procedure setFormat_2_wrapper
    (Self : not null access Qt_Ada.Internals.Objects.QObject;
     Start : Qt4.Q_Integer;
     Count : Qt4.Q_Integer;
     Color : not null access constant Qt4.Colors.Internals.QColor);
   pragma Import (C, setFormat_2_wrapper,
                     "__Qt4Ada_QSyntaxHighlighter_setFormat_2_wrapper");

   procedure setFormat_1_wrapper
    (Self : not null access Qt_Ada.Internals.Objects.QObject;
     Start : Qt4.Q_Integer;
     Count : Qt4.Q_Integer;
     Font : not null access constant Qt4.Fonts.Internals.QFont);
   pragma Import (C, setFormat_1_wrapper,
                     "__Qt4Ada_QSyntaxHighlighter_setFormat_1_wrapper");

   procedure setFormat_0_wrapper
    (Self : not null access Qt_Ada.Internals.Objects.QObject;
     Start : Qt4.Q_Integer;
     Count : Qt4.Q_Integer;
     Format : not null access constant Qt4.Text_Formats.Internals.QTextFormat);
   pragma Import (C, setFormat_0_wrapper,
                     "__Qt4Ada_QSyntaxHighlighter_setFormat_0_wrapper");

   procedure childEvent_0_wrapper
    (Self : not null access Qt_Ada.Internals.Objects.QObject;
     Event : not null access Qt_Ada.Internals.Events.QEvent);
   pragma Import (C, childEvent_0_wrapper,
                     "__Qt4Ada_QSyntaxHighlighter_childEvent_0_wrapper");

   procedure customEvent_0_wrapper
    (Self : not null access Qt_Ada.Internals.Objects.QObject;
     Event : not null access Qt_Ada.Internals.Events.QEvent);
   pragma Import (C, customEvent_0_wrapper,
                     "__Qt4Ada_QSyntaxHighlighter_customEvent_0_wrapper");

   procedure timerEvent_0_wrapper
    (Self : not null access Qt_Ada.Internals.Objects.QObject;
     Event : not null access Qt_Ada.Internals.Events.QEvent);
   pragma Import (C, timerEvent_0_wrapper,
                     "__Qt4Ada_QSyntaxHighlighter_timerEvent_0_wrapper");

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

   ------------------
   -- Constructors --
   ------------------

   package body Constructors is

      function new_QSyntaxHighlighterDirector_QObject
       (Object : not null Qt_Ada.Internals.Objects.Q_Object_Base_Access;
        Parent : access Qt_Ada.Internals.Objects.QObject)
          return not null Qt_Ada.Internals.Objects.QObject_Access;
      pragma Import (C,
                     new_QSyntaxHighlighterDirector_QObject,
                     "__Qt4Ada_new_QSyntaxHighlighterDirector_QObjectP");
      pragma Warnings (Off, new_QSyntaxHighlighterDirector_QObject);

      function new_QSyntaxHighlighterDirector_QTextDocument
       (Object : not null Qt_Ada.Internals.Objects.Q_Object_Base_Access;
        Parent : access Qt_Ada.Internals.Objects.QObject)
          return not null Qt_Ada.Internals.Objects.QObject_Access;
      pragma Import (C,
                     new_QSyntaxHighlighterDirector_QTextDocument,
                     "__Qt4Ada_new_QSyntaxHighlighterDirector_QTextDocumentP");
      pragma Warnings (Off, new_QSyntaxHighlighterDirector_QTextDocument);

      function new_QSyntaxHighlighterDirector_QTextEdit
       (Object : not null Qt_Ada.Internals.Objects.Q_Object_Base_Access;
        Parent : access Qt_Ada.Internals.Objects.QObject)
          return not null Qt_Ada.Internals.Objects.QObject_Access;
      pragma Import (C,
                     new_QSyntaxHighlighterDirector_QTextEdit,
                     "__Qt4Ada_new_QSyntaxHighlighterDirector_QTextEditP");
      pragma Warnings (Off, new_QSyntaxHighlighterDirector_QTextEdit);

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

      procedure Initialize
       (Self   : not null access Q_Syntax_Highlighter_Director'Class;
        Parent : access Qt4.Objects.Q_Object'Class := null)
      is
         Director : Qt_Ada.Internals.Objects.QObject_Access;

      begin
         if Parent /= null
           and then Parent.all in Qt4.Text_Documents.Q_Text_Document'Class
         then
            Director :=
              new_QSyntaxHighlighterDirector_QTextDocument
               (Qt_Ada.Internals.Objects.Q_Object_Base_Access (Self),
                Parent.QObject_View);

         elsif Parent /= null
           and then Parent.all in Qt4.Text_Edits.Q_Text_Edit'Class
         then
            Director :=
              new_QSyntaxHighlighterDirector_QTextEdit
               (Qt_Ada.Internals.Objects.Q_Object_Base_Access (Self),
                Parent.QObject_View);

         else
           Director :=
             new_QSyntaxHighlighterDirector_QObject
               (Qt_Ada.Internals.Objects.Q_Object_Base_Access (Self),
                Qt_Ada.Internals.Objects.Object_Utilities.Corresponding_QObject
                 (Parent));
         end if;

         Qt_Ada.Internals.Objects.Initialize (Self, Director);
      end Initialize;

   end Constructors;

   pragma Style_Checks ("N");

   -------------------------
   -- Current_Block_State --
   -------------------------

   not overriding
   function Current_Block_State
    (Self : not null access constant Q_Syntax_Highlighter_Director)
       return Qt4.Q_Integer
   is
   begin
      return
        currentBlockState_0_wrapper
         (Q_Syntax_Highlighter_Director'Class (Self.all).QObject_View);
   end Current_Block_State;

   -------------------------------
   -- highlightBlock_0_dispatch --
   -------------------------------

   procedure highlightBlock_0_dispatch
    (Self : not null Qt_Ada.Internals.Objects.Q_Object_Base_Access;
     Text : not null access Qt4.Strings.Internals.QString)
   is
   begin
      Q_Syntax_Highlighter_Director'Class (Self.all).Highlight_Block
       (Qt4.Strings.Internals.Create_Wrapper (Qt4.Strings.Internals.QString_Access (Text)));
   end highlightBlock_0_dispatch;

   --------------------------
   -- Previous_Block_State --
   --------------------------

   not overriding
   function Previous_Block_State
    (Self : not null access constant Q_Syntax_Highlighter_Director)
       return Qt4.Q_Integer
   is
   begin
      return
        previousBlockState_0_wrapper
         (Q_Syntax_Highlighter_Director'Class (Self.all).QObject_View);
   end Previous_Block_State;

   -----------------------------
   -- Set_Current_Block_State --
   -----------------------------

   not overriding
   procedure Set_Current_Block_State
    (Self : not null access Q_Syntax_Highlighter_Director;
     New_State : Qt4.Q_Integer)
   is
   begin
      setCurrentBlockState_0_wrapper
       (Q_Syntax_Highlighter_Director'Class (Self.all).QObject_View,
        New_State);
   end Set_Current_Block_State;

   ----------------
   -- Set_Format --
   ----------------

   not overriding
   procedure Set_Format
    (Self : not null access Q_Syntax_Highlighter_Director;
     Start : Qt4.Q_Integer;
     Count : Qt4.Q_Integer;
     Color : Qt4.Colors.Q_Color)
   is
   begin
      setFormat_2_wrapper
       (Q_Syntax_Highlighter_Director'Class (Self.all).QObject_View,
        Start,
        Count,
        Qt4.Colors.Internals.QColor_View (Color));
   end Set_Format;

   ----------------
   -- Set_Format --
   ----------------

   not overriding
   procedure Set_Format
    (Self : not null access Q_Syntax_Highlighter_Director;
     Start : Qt4.Q_Integer;
     Count : Qt4.Q_Integer;
     Font : Qt4.Fonts.Q_Font)
   is
   begin
      setFormat_1_wrapper
       (Q_Syntax_Highlighter_Director'Class (Self.all).QObject_View,
        Start,
        Count,
        Qt4.Fonts.Internals.QFont_View (Font));
   end Set_Format;

   ----------------
   -- Set_Format --
   ----------------

   not overriding
   procedure Set_Format
    (Self : not null access Q_Syntax_Highlighter_Director;
     Start : Qt4.Q_Integer;
     Count : Qt4.Q_Integer;
     Format : Qt4.Text_Char_Formats.Q_Text_Char_Format'Class)
   is
   begin
      setFormat_0_wrapper
       (Q_Syntax_Highlighter_Director'Class (Self.all).QObject_View,
        Start,
        Count,
        Qt4.Text_Formats.Internals.QTextFormat_View (Format));
   end Set_Format;

   -----------------
   -- Child_Event --
   -----------------

   overriding
   procedure Child_Event
    (Self : not null access Q_Syntax_Highlighter_Director;
     Event : not null access Qt4.Child_Events.Q_Child_Event'Class)
   is
   begin
      childEvent_0_wrapper
       (Q_Syntax_Highlighter_Director'Class (Self.all).QObject_View,
        Event.QEvent_View);
   end Child_Event;

   ------------------
   -- Custom_Event --
   ------------------

   overriding
   procedure Custom_Event
    (Self : not null access Q_Syntax_Highlighter_Director;
     Event : not null access Qt4.Events.Q_Event'Class)
   is
   begin
      customEvent_0_wrapper
       (Q_Syntax_Highlighter_Director'Class (Self.all).QObject_View,
        Event.QEvent_View);
   end Custom_Event;

   -----------------
   -- Timer_Event --
   -----------------

   overriding
   procedure Timer_Event
    (Self : not null access Q_Syntax_Highlighter_Director;
     Event : not null access Qt4.Timer_Events.Q_Timer_Event'Class)
   is
   begin
      timerEvent_0_wrapper
       (Q_Syntax_Highlighter_Director'Class (Self.all).QObject_View,
        Event.QEvent_View);
   end Timer_Event;

   ------------
   -- Sender --
   ------------

   overriding
   function Sender
    (Self : not null access constant Q_Syntax_Highlighter_Director)
       return access Qt4.Objects.Q_Object'Class
   is
   begin
      return
        Qt_Ada.Internals.Objects.Object_Utilities.Corresponding_Q_Object
         (sender_0_wrapper
           (Q_Syntax_Highlighter_Director'Class (Self.all).QObject_View));
   end Sender;

begin
   Qt_Ada.Internals.Object_Registry.Register_Director
    ("QSyntaxHighlighter", qt_metacast_wrapper'Access, qt_metacall_wrapper'Access);

end Qt4.Syntax_Highlighters.Directors;
