------------------------------------------------------------------------------
--                                                                          --
--                An Ada2005 binding to the Qt C++ framework                --
--                                                                          --
------------------------------------------------------------------------------
--                                                                          --
-- Copyright © 2007-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: 3806 $ $Date: 2010-11-30 14:14:00 +0300 (Tue, 30 Nov 2010) $
------------------------------------------------------------------------------
pragma Style_Checks ("NM32766");
with System.Address_To_Access_Conversions;

with Qt4.Reg_Exps;
with Qt4_Debug;
with Qt_Ada.Internals.Boolean_Conversions;

package body Qt4.Strings is

   procedure Q_String_Image (Item : Q_String);
   pragma Export (Ada, Q_String_Image, "q_string_image");

   function initialize_QChar
    (Storage : System.Address)
      return Internals.QChar_Access;
   pragma Import (C, initialize_QChar, "__QtAda_inititialize_QChar");

   function initialize_QChar_ushort
    (Storage : System.Address;
     Rc : Interfaces.C.unsigned_short)
      return Internals.QChar_Access;
   pragma Import (C, initialize_QChar_ushort, "__QtAda_inititialize_QChar_ushort");

   function initialize_QChar_uint
    (Storage : System.Address;
     Rc : Qt4.Q_Unsigned_Integer)
      return Internals.QChar_Access;
   pragma Import (C, initialize_QChar_uint, "__QtAda_inititialize_QChar_uint");

   function initialize_QChar_SpecialCharacter
    (Storage : System.Address;
     Sc : Special_Character)
      return Internals.QChar_Access;
   pragma Import (C, initialize_QChar_SpecialCharacter, "__QtAda_inititialize_QChar_SpecialCharacter");

   function adjust_QChar
    (Storage : System.Address;
     From    : Internals.QChar_Access)
       return Internals.QChar_Access;
   pragma Import (C, adjust_QChar, "__QtAda_adjust_QChar");

   procedure finalize_QChar (Object : Internals.QChar_Access);
   pragma Import (C, finalize_QChar, "__QtAda_finalize_QChar");

   function QChar_category
    (Self : Internals.QChar_Access)
       return Character_Category;
   pragma Import (C, QChar_category, "__QtAda_QChar_category_Q");

   function QChar_combiningClass
    (Self : Internals.QChar_Access)
       return Character_Combining_Class;
   pragma Import (C, QChar_combiningClass, "__QtAda_QChar_combiningClass_Q");

   procedure QChar_decomposition
    (Returns : Internals.QString_Access;
     Self : Internals.QChar_Access);
   pragma Import (C, QChar_decomposition, "__QtAda_QChar_decomposition_Q");

   function QChar_decompositionTag
    (Self : Internals.QChar_Access)
       return Character_Decomposition;
   pragma Import (C, QChar_decompositionTag, "__QtAda_QChar_decompositionTag_Q");

   function QChar_direction
    (Self : Internals.QChar_Access)
       return Character_Direction;
   pragma Import (C, QChar_direction, "__QtAda_QChar_direction_Q");

   function QChar_hasMirrored
    (Self : Internals.QChar_Access)
       return Interfaces.C.unsigned;
   pragma Import (C, QChar_hasMirrored, "__QtAda_QChar_hasMirrored_Q");

   function QChar_isDigit
    (Self : Internals.QChar_Access)
       return Interfaces.C.unsigned;
   pragma Import (C, QChar_isDigit, "__QtAda_QChar_isDigit_Q");

   function QChar_isHighSurrogate
    (Self : Internals.QChar_Access)
       return Interfaces.C.unsigned;
   pragma Import (C, QChar_isHighSurrogate, "__QtAda_QChar_isHighSurrogate_Q");

   function QChar_isLetter
    (Self : Internals.QChar_Access)
       return Interfaces.C.unsigned;
   pragma Import (C, QChar_isLetter, "__QtAda_QChar_isLetter_Q");

   function QChar_isLetterOrNumber
    (Self : Internals.QChar_Access)
       return Interfaces.C.unsigned;
   pragma Import (C, QChar_isLetterOrNumber, "__QtAda_QChar_isLetterOrNumber_Q");

   function QChar_isLowSurrogate
    (Self : Internals.QChar_Access)
       return Interfaces.C.unsigned;
   pragma Import (C, QChar_isLowSurrogate, "__QtAda_QChar_isLowSurrogate_Q");

   function QChar_isLower
    (Self : Internals.QChar_Access)
       return Interfaces.C.unsigned;
   pragma Import (C, QChar_isLower, "__QtAda_QChar_isLower_Q");

   function QChar_isMark
    (Self : Internals.QChar_Access)
       return Interfaces.C.unsigned;
   pragma Import (C, QChar_isMark, "__QtAda_QChar_isMark_Q");

   function QChar_isNull
    (Self : Internals.QChar_Access)
       return Interfaces.C.unsigned;
   pragma Import (C, QChar_isNull, "__QtAda_QChar_isNull_Q");

   function QChar_isNumber
    (Self : Internals.QChar_Access)
       return Interfaces.C.unsigned;
   pragma Import (C, QChar_isNumber, "__QtAda_QChar_isNumber_Q");

   function QChar_isPrint
    (Self : Internals.QChar_Access)
       return Interfaces.C.unsigned;
   pragma Import (C, QChar_isPrint, "__QtAda_QChar_isPrint_Q");

   function QChar_isPunct
    (Self : Internals.QChar_Access)
       return Interfaces.C.unsigned;
   pragma Import (C, QChar_isPunct, "__QtAda_QChar_isPunct_Q");

   function QChar_isSpace
    (Self : Internals.QChar_Access)
       return Interfaces.C.unsigned;
   pragma Import (C, QChar_isSpace, "__QtAda_QChar_isSpace_Q");

   function QChar_isSymbol
    (Self : Internals.QChar_Access)
       return Interfaces.C.unsigned;
   pragma Import (C, QChar_isSymbol, "__QtAda_QChar_isSymbol_Q");

   function QChar_isTitleCase
    (Self : Internals.QChar_Access)
       return Interfaces.C.unsigned;
   pragma Import (C, QChar_isTitleCase, "__QtAda_QChar_isTitleCase_Q");

   function QChar_isUpper
    (Self : Internals.QChar_Access)
       return Interfaces.C.unsigned;
   pragma Import (C, QChar_isUpper, "__QtAda_QChar_isUpper_Q");

   function QChar_joining
    (Self : Internals.QChar_Access)
       return Character_Joining;
   pragma Import (C, QChar_joining, "__QtAda_QChar_joining_Q");

   procedure QChar_mirroredChar
    (Returns : Internals.QChar_Access;
     Self : Internals.QChar_Access);
   pragma Import (C, QChar_mirroredChar, "__QtAda_QChar_mirroredChar_Q");

   procedure QChar_toCaseFolded
    (Returns : Internals.QChar_Access;
     Self : Internals.QChar_Access);
   pragma Import (C, QChar_toCaseFolded, "__QtAda_QChar_toCaseFolded_Q");

   procedure QChar_toLower
    (Returns : Internals.QChar_Access;
     Self : Internals.QChar_Access);
   pragma Import (C, QChar_toLower, "__QtAda_QChar_toLower_Q");

   procedure QChar_toTitleCase
    (Returns : Internals.QChar_Access;
     Self : Internals.QChar_Access);
   pragma Import (C, QChar_toTitleCase, "__QtAda_QChar_toTitleCase_Q");

   procedure QChar_toUpper
    (Returns : Internals.QChar_Access;
     Self : Internals.QChar_Access);
   pragma Import (C, QChar_toUpper, "__QtAda_QChar_toUpper_Q");

   function QChar_unicode
    (Self : Internals.QChar_Access)
       return Qt4.Q_Unsigned_Short;
   pragma Import (C, QChar_unicode, "__QtAda_QChar_unicode_Q");

   function QChar_unicodeVersion
    (Self : Internals.QChar_Access)
       return Character_Unicode_Version;
   pragma Import (C, QChar_unicodeVersion, "__QtAda_QChar_unicodeVersion_Q");

   function QChar_category_ushort
    (Ucs_2 : Interfaces.C.unsigned_short)
       return Character_Category;
   pragma Import (C, QChar_category_ushort, "__QtAda_QChar_category_ushort_S");

   function QChar_category_uint
    (Ucs_4 : Qt4.Q_Unsigned_Integer)
       return Character_Category;
   pragma Import (C, QChar_category_uint, "__QtAda_QChar_category_uint_S");

   function QChar_combiningClass_ushort
    (Ucs_2 : Interfaces.C.unsigned_short)
       return Character_Combining_Class;
   pragma Import (C, QChar_combiningClass_ushort, "__QtAda_QChar_combiningClass_ushort_S");

   function QChar_combiningClass_uint
    (Ucs_4 : Qt4.Q_Unsigned_Integer)
       return Character_Combining_Class;
   pragma Import (C, QChar_combiningClass_uint, "__QtAda_QChar_combiningClass_uint_S");

   procedure QChar_decomposition_uint
    (Returns : Internals.QString_Access;
     Ucs_4 : Qt4.Q_Unsigned_Integer);
   pragma Import (C, QChar_decomposition_uint, "__QtAda_QChar_decomposition_uint_S");

   function QChar_decompositionTag_uint
    (Ucs_4 : Qt4.Q_Unsigned_Integer)
       return Character_Decomposition;
   pragma Import (C, QChar_decompositionTag_uint, "__QtAda_QChar_decompositionTag_uint_S");

   function QChar_direction_ushort
    (Ucs_2 : Interfaces.C.unsigned_short)
       return Character_Direction;
   pragma Import (C, QChar_direction_ushort, "__QtAda_QChar_direction_ushort_S");

   function QChar_direction_uint
    (Ucs_4 : Qt4.Q_Unsigned_Integer)
       return Character_Direction;
   pragma Import (C, QChar_direction_uint, "__QtAda_QChar_direction_uint_S");

   function QChar_highSurrogate_uint
    (Ucs_4 : Qt4.Q_Unsigned_Integer)
       return Interfaces.C.unsigned_short;
   pragma Import (C, QChar_highSurrogate_uint, "__QtAda_QChar_highSurrogate_uint_S");

   function QChar_joining_ushort
    (Ucs_2 : Interfaces.C.unsigned_short)
       return Character_Joining;
   pragma Import (C, QChar_joining_ushort, "__QtAda_QChar_joining_ushort_S");

   function QChar_joining_uint
    (Ucs_4 : Qt4.Q_Unsigned_Integer)
       return Character_Joining;
   pragma Import (C, QChar_joining_uint, "__QtAda_QChar_joining_uint_S");

   function QChar_lowSurrogate_uint
    (Ucs_4 : Qt4.Q_Unsigned_Integer)
       return Interfaces.C.unsigned_short;
   pragma Import (C, QChar_lowSurrogate_uint, "__QtAda_QChar_lowSurrogate_uint_S");

   function QChar_mirroredChar_ushort
    (Ucs_2 : Interfaces.C.unsigned_short)
       return Interfaces.C.unsigned_short;
   pragma Import (C, QChar_mirroredChar_ushort, "__QtAda_QChar_mirroredChar_ushort_S");

   function QChar_mirroredChar_uint
    (Ucs_4 : Qt4.Q_Unsigned_Integer)
       return Qt4.Q_Unsigned_Integer;
   pragma Import (C, QChar_mirroredChar_uint, "__QtAda_QChar_mirroredChar_uint_S");

   function QChar_surrogateToUcs4_ushort_ushort
    (High : Interfaces.C.unsigned_short;
     Low : Interfaces.C.unsigned_short)
       return Qt4.Q_Unsigned_Integer;
   pragma Import (C, QChar_surrogateToUcs4_ushort_ushort, "__QtAda_QChar_surrogateToUcs4_ushort_ushort_S");

   function QChar_surrogateToUcs4_QChar_QChar
    (High : Internals.QChar_Access;
     Low : Internals.QChar_Access)
       return Qt4.Q_Unsigned_Integer;
   pragma Import (C, QChar_surrogateToUcs4_QChar_QChar, "__QtAda_QChar_surrogateToUcs4_QChar_QChar_S");

   function QChar_toCaseFolded_ushort
    (Ucs_2 : Interfaces.C.unsigned_short)
       return Interfaces.C.unsigned_short;
   pragma Import (C, QChar_toCaseFolded_ushort, "__QtAda_QChar_toCaseFolded_ushort_S");

   function QChar_toCaseFolded_uint
    (Ucs_4 : Qt4.Q_Unsigned_Integer)
       return Qt4.Q_Unsigned_Integer;
   pragma Import (C, QChar_toCaseFolded_uint, "__QtAda_QChar_toCaseFolded_uint_S");

   function QChar_toLower_ushort
    (Ucs_2 : Interfaces.C.unsigned_short)
       return Interfaces.C.unsigned_short;
   pragma Import (C, QChar_toLower_ushort, "__QtAda_QChar_toLower_ushort_S");

   function QChar_toLower_uint
    (Ucs_4 : Qt4.Q_Unsigned_Integer)
       return Qt4.Q_Unsigned_Integer;
   pragma Import (C, QChar_toLower_uint, "__QtAda_QChar_toLower_uint_S");

   function QChar_toTitleCase_ushort
    (Ucs_2 : Interfaces.C.unsigned_short)
       return Interfaces.C.unsigned_short;
   pragma Import (C, QChar_toTitleCase_ushort, "__QtAda_QChar_toTitleCase_ushort_S");

   function QChar_toTitleCase_uint
    (Ucs_4 : Qt4.Q_Unsigned_Integer)
       return Qt4.Q_Unsigned_Integer;
   pragma Import (C, QChar_toTitleCase_uint, "__QtAda_QChar_toTitleCase_uint_S");

   function QChar_toUpper_ushort
    (Ucs_2 : Interfaces.C.unsigned_short)
       return Interfaces.C.unsigned_short;
   pragma Import (C, QChar_toUpper_ushort, "__QtAda_QChar_toUpper_ushort_S");

   function QChar_toUpper_uint
    (Ucs_4 : Qt4.Q_Unsigned_Integer)
       return Qt4.Q_Unsigned_Integer;
   pragma Import (C, QChar_toUpper_uint, "__QtAda_QChar_toUpper_uint_S");

   function QChar_unicodeVersion_ushort
    (Ucs_2 : Interfaces.C.unsigned_short)
       return Character_Unicode_Version;
   pragma Import (C, QChar_unicodeVersion_ushort, "__QtAda_QChar_unicodeVersion_ushort_S");

   function QChar_unicodeVersion_uint
    (Ucs_4 : Qt4.Q_Unsigned_Integer)
       return Character_Unicode_Version;
   pragma Import (C, QChar_unicodeVersion_uint, "__QtAda_QChar_unicodeVersion_uint_S");

   function eq_QChar_QChar
    (C_1 : Internals.QChar_Access;
     C_2 : Internals.QChar_Access)
       return Interfaces.C.unsigned;
   pragma Import (C, eq_QChar_QChar, "__QtAda_eq_QChar_QChar");

   function le_QChar_QChar
    (C_1 : Internals.QChar_Access;
     C_2 : Internals.QChar_Access)
       return Interfaces.C.unsigned;
   pragma Import (C, le_QChar_QChar, "__QtAda_le_QChar_QChar");

   function ge_QChar_QChar
    (C_1 : Internals.QChar_Access;
     C_2 : Internals.QChar_Access)
       return Interfaces.C.unsigned;
   pragma Import (C, ge_QChar_QChar, "__QtAda_ge_QChar_QChar");

   function lt_QChar_QChar
    (C_1 : Internals.QChar_Access;
     C_2 : Internals.QChar_Access)
       return Interfaces.C.unsigned;
   pragma Import (C, lt_QChar_QChar, "__QtAda_lt_QChar_QChar");

   function gt_QChar_QChar
    (C_1 : Internals.QChar_Access;
     C_2 : Internals.QChar_Access)
       return Interfaces.C.unsigned;
   pragma Import (C, gt_QChar_QChar, "__QtAda_gt_QChar_QChar");

   --------------------
   -- Q_String_Image --
   --------------------

   procedure Q_String_Image (Item : Q_String) is
   begin
      Qt4_Debug.Output (Item.To_Local_8_Bit);
   end Q_String_Image;

   ------------
   -- Adjust --
   ------------

   overriding
   procedure Adjust (Self : in out Q_Char) is
   begin
      Self.Object := adjust_QChar (Self.Storage'Address, Self.Object);
      Self.Wrapper := False;
   end Adjust;

   --------------
   -- Finalize --
   --------------

   overriding
   procedure Finalize (Self : in out Q_Char) is
   begin
      if not Self.Wrapper then
         finalize_QChar (Self.Object);
      end if;
   end Finalize;

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

   overriding
   procedure Initialize (Self : in out Q_Char) is
      use type Internals.QChar_Access;

   begin
      if Self.Object = null then
         Self.Object := initialize_QChar (Self.Storage'Address);
      end if;
   end Initialize;

   ------------
   -- Create --
   ------------

   function Create
    (Rc : Wide_Character)
       return Q_Char
   is
   begin
      return Self : Q_Char
        := (Ada.Finalization.Controlled with others => <>)
      do
         Self.Object := initialize_QChar_ushort (Self.Storage'Address, Wide_Character'Pos (Rc));
      end return;
   end Create;

   ------------
   -- Create --
   ------------

   function Create
    (Rc : Wide_Wide_Character)
       return Q_Char
   is
   begin
      return Self : Q_Char
        := (Ada.Finalization.Controlled with others => <>)
      do
         Self.Object := initialize_QChar_uint (Self.Storage'Address, Wide_Wide_Character'Pos (Rc));
      end return;
   end Create;

   ------------
   -- Create --
   ------------

   function Create
    (Sc : Special_Character)
       return Q_Char
   is
   begin
      return Self : Q_Char
        := (Ada.Finalization.Controlled with others => <>)
      do
         Self.Object := initialize_QChar_SpecialCharacter (Self.Storage'Address, Sc);
      end return;
   end Create;

   --------------
   -- Category --
   --------------

   function Category
    (Self : Q_Char'Class)
       return Character_Category
   is
   begin
      return QChar_category (Self.Object);
   end Category;

   ---------------------
   -- Combining_Class --
   ---------------------

   function Combining_Class
    (Self : Q_Char'Class)
       return Character_Combining_Class
   is
   begin
      return QChar_combiningClass (Self.Object);
   end Combining_Class;

   -------------------
   -- Decomposition --
   -------------------

   function Decomposition
    (Self : Q_Char'Class)
       return Q_String
   is
   begin
      return Returns : Q_String do
         QChar_decomposition (Returns.Object, Self.Object);
      end return;
   end Decomposition;

   -----------------------
   -- Decomposition_Tag --
   -----------------------

   function Decomposition_Tag
    (Self : Q_Char'Class)
       return Character_Decomposition
   is
   begin
      return QChar_decompositionTag (Self.Object);
   end Decomposition_Tag;

   ---------------
   -- Direction --
   ---------------

   function Direction
    (Self : Q_Char'Class)
       return Character_Direction
   is
   begin
      return QChar_direction (Self.Object);
   end Direction;

   ------------------
   -- Has_Mirrored --
   ------------------

   function Has_Mirrored
    (Self : Q_Char'Class)
       return Boolean
   is
   begin
      return Interfaces.C."/=" (QChar_hasMirrored (Self.Object), 0);
   end Has_Mirrored;

   --------------
   -- Is_Digit --
   --------------

   function Is_Digit
    (Self : Q_Char'Class)
       return Boolean
   is
   begin
      return Interfaces.C."/=" (QChar_isDigit (Self.Object), 0);
   end Is_Digit;

   -----------------------
   -- Is_High_Surrogate --
   -----------------------

   function Is_High_Surrogate
    (Self : Q_Char'Class)
       return Boolean
   is
   begin
      return Interfaces.C."/=" (QChar_isHighSurrogate (Self.Object), 0);
   end Is_High_Surrogate;

   ---------------
   -- Is_Letter --
   ---------------

   function Is_Letter
    (Self : Q_Char'Class)
       return Boolean
   is
   begin
      return Interfaces.C."/=" (QChar_isLetter (Self.Object), 0);
   end Is_Letter;

   -------------------------
   -- Is_Letter_Or_Number --
   -------------------------

   function Is_Letter_Or_Number
    (Self : Q_Char'Class)
       return Boolean
   is
   begin
      return Interfaces.C."/=" (QChar_isLetterOrNumber (Self.Object), 0);
   end Is_Letter_Or_Number;

   ----------------------
   -- Is_Low_Surrogate --
   ----------------------

   function Is_Low_Surrogate
    (Self : Q_Char'Class)
       return Boolean
   is
   begin
      return Interfaces.C."/=" (QChar_isLowSurrogate (Self.Object), 0);
   end Is_Low_Surrogate;

   --------------
   -- Is_Lower --
   --------------

   function Is_Lower
    (Self : Q_Char'Class)
       return Boolean
   is
   begin
      return Interfaces.C."/=" (QChar_isLower (Self.Object), 0);
   end Is_Lower;

   -------------
   -- Is_Mark --
   -------------

   function Is_Mark
    (Self : Q_Char'Class)
       return Boolean
   is
   begin
      return Interfaces.C."/=" (QChar_isMark (Self.Object), 0);
   end Is_Mark;

   -------------
   -- Is_Null --
   -------------

   function Is_Null
    (Self : Q_Char'Class)
       return Boolean
   is
   begin
      return Interfaces.C."/=" (QChar_isNull (Self.Object), 0);
   end Is_Null;

   ---------------
   -- Is_Number --
   ---------------

   function Is_Number
    (Self : Q_Char'Class)
       return Boolean
   is
   begin
      return Interfaces.C."/=" (QChar_isNumber (Self.Object), 0);
   end Is_Number;

   --------------
   -- Is_Print --
   --------------

   function Is_Print
    (Self : Q_Char'Class)
       return Boolean
   is
   begin
      return Interfaces.C."/=" (QChar_isPrint (Self.Object), 0);
   end Is_Print;

   --------------
   -- Is_Punct --
   --------------

   function Is_Punct
    (Self : Q_Char'Class)
       return Boolean
   is
   begin
      return Interfaces.C."/=" (QChar_isPunct (Self.Object), 0);
   end Is_Punct;

   --------------
   -- Is_Space --
   --------------

   function Is_Space
    (Self : Q_Char'Class)
       return Boolean
   is
   begin
      return Interfaces.C."/=" (QChar_isSpace (Self.Object), 0);
   end Is_Space;

   ---------------
   -- Is_Symbol --
   ---------------

   function Is_Symbol
    (Self : Q_Char'Class)
       return Boolean
   is
   begin
      return Interfaces.C."/=" (QChar_isSymbol (Self.Object), 0);
   end Is_Symbol;

   -------------------
   -- Is_Title_Case --
   -------------------

   function Is_Title_Case
    (Self : Q_Char'Class)
       return Boolean
   is
   begin
      return Interfaces.C."/=" (QChar_isTitleCase (Self.Object), 0);
   end Is_Title_Case;

   --------------
   -- Is_Upper --
   --------------

   function Is_Upper
    (Self : Q_Char'Class)
       return Boolean
   is
   begin
      return Interfaces.C."/=" (QChar_isUpper (Self.Object), 0);
   end Is_Upper;

   -------------
   -- Joining --
   -------------

   function Joining
    (Self : Q_Char'Class)
       return Character_Joining
   is
   begin
      return QChar_joining (Self.Object);
   end Joining;

   -------------------
   -- Mirrored_Char --
   -------------------

   function Mirrored_Char
    (Self : Q_Char'Class)
       return Q_Char
   is
   begin
      return Returns : Q_Char do
         QChar_mirroredChar (Returns.Object, Self.Object);
      end return;
   end Mirrored_Char;

   --------------------
   -- To_Case_Folded --
   --------------------

   function To_Case_Folded
    (Self : Q_Char'Class)
       return Q_Char
   is
   begin
      return Returns : Q_Char do
         QChar_toCaseFolded (Returns.Object, Self.Object);
      end return;
   end To_Case_Folded;

   --------------
   -- To_Lower --
   --------------

   function To_Lower
    (Self : Q_Char'Class)
       return Q_Char
   is
   begin
      return Returns : Q_Char do
         QChar_toLower (Returns.Object, Self.Object);
      end return;
   end To_Lower;

   -------------------
   -- To_Title_Case --
   -------------------

   function To_Title_Case
    (Self : Q_Char'Class)
       return Q_Char
   is
   begin
      return Returns : Q_Char do
         QChar_toTitleCase (Returns.Object, Self.Object);
      end return;
   end To_Title_Case;

   --------------
   -- To_Upper --
   --------------

   function To_Upper
    (Self : Q_Char'Class)
       return Q_Char
   is
   begin
      return Returns : Q_Char do
         QChar_toUpper (Returns.Object, Self.Object);
      end return;
   end To_Upper;

   -------------
   -- Unicode --
   -------------

   function Unicode
    (Self : Q_Char'Class)
       return Qt4.Q_Unsigned_Short
   is
   begin
      return QChar_unicode (Self.Object);
   end Unicode;

   ---------------------
   -- Unicode_Version --
   ---------------------

   function Unicode_Version
    (Self : Q_Char'Class)
       return Character_Unicode_Version
   is
   begin
      return QChar_unicodeVersion (Self.Object);
   end Unicode_Version;

   --------------
   -- Category --
   --------------

   function Category
    (Ucs_2 : Wide_Character)
       return Character_Category
   is
   begin
      return QChar_category_ushort (Wide_Character'Pos (Ucs_2));
   end Category;

   --------------
   -- Category --
   --------------

   function Category
    (Ucs_4 : Wide_Wide_Character)
       return Character_Category
   is
   begin
      return QChar_category_uint (Wide_Wide_Character'Pos (Ucs_4));
   end Category;

   ---------------------
   -- Combining_Class --
   ---------------------

   function Combining_Class
    (Ucs_2 : Wide_Character)
       return Character_Combining_Class
   is
   begin
      return QChar_combiningClass_ushort (Wide_Character'Pos (Ucs_2));
   end Combining_Class;

   ---------------------
   -- Combining_Class --
   ---------------------

   function Combining_Class
    (Ucs_4 : Wide_Wide_Character)
       return Character_Combining_Class
   is
   begin
      return QChar_combiningClass_uint (Wide_Wide_Character'Pos (Ucs_4));
   end Combining_Class;

   -------------------
   -- Decomposition --
   -------------------

   function Decomposition
    (Ucs_4 : Wide_Wide_Character)
       return Q_String
   is
   begin
      return Returns : Q_String do
         QChar_decomposition_uint (Returns.Object, Wide_Wide_Character'Pos (Ucs_4));
      end return;
   end Decomposition;

   -----------------------
   -- Decomposition_Tag --
   -----------------------

   function Decomposition_Tag
    (Ucs_4 : Wide_Wide_Character)
       return Character_Decomposition
   is
   begin
      return QChar_decompositionTag_uint (Wide_Wide_Character'Pos (Ucs_4));
   end Decomposition_Tag;

   ---------------
   -- Direction --
   ---------------

   function Direction
    (Ucs_2 : Wide_Character)
       return Character_Direction
   is
   begin
      return QChar_direction_ushort (Wide_Character'Pos (Ucs_2));
   end Direction;

   ---------------
   -- Direction --
   ---------------

   function Direction
    (Ucs_4 : Wide_Wide_Character)
       return Character_Direction
   is
   begin
      return QChar_direction_uint (Wide_Wide_Character'Pos (Ucs_4));
   end Direction;

   --------------------
   -- High_Surrogate --
   --------------------

   function High_Surrogate
    (Ucs_4 : Wide_Wide_Character)
       return Wide_Character
   is
   begin
      return Wide_Character'Val (QChar_highSurrogate_uint (Wide_Wide_Character'Pos (Ucs_4)));
   end High_Surrogate;

   -------------
   -- Joining --
   -------------

   function Joining
    (Ucs_2 : Wide_Character)
       return Character_Joining
   is
   begin
      return QChar_joining_ushort (Wide_Character'Pos (Ucs_2));
   end Joining;

   -------------
   -- Joining --
   -------------

   function Joining
    (Ucs_4 : Wide_Wide_Character)
       return Character_Joining
   is
   begin
      return QChar_joining_uint (Wide_Wide_Character'Pos (Ucs_4));
   end Joining;

   -------------------
   -- Low_Surrogate --
   -------------------

   function Low_Surrogate
    (Ucs_4 : Wide_Wide_Character)
       return Wide_Character
   is
   begin
      return Wide_Character'Val (QChar_lowSurrogate_uint (Wide_Wide_Character'Pos (Ucs_4)));
   end Low_Surrogate;

   -------------------
   -- Mirrored_Char --
   -------------------

   function Mirrored_Char
    (Ucs_2 : Wide_Character)
       return Wide_Character
   is
   begin
      return Wide_Character'Val (QChar_mirroredChar_ushort (Wide_Character'Pos (Ucs_2)));
   end Mirrored_Char;

   -------------------
   -- Mirrored_Char --
   -------------------

   function Mirrored_Char
    (Ucs_4 : Wide_Wide_Character)
       return Wide_Wide_Character
   is
   begin
      return Wide_Wide_Character'Val (QChar_mirroredChar_uint (Wide_Wide_Character'Pos (Ucs_4)));
   end Mirrored_Char;

   ------------------------
   -- Surrogate_To_Ucs_4 --
   ------------------------

   function Surrogate_To_Ucs_4
    (High : Wide_Character;
     Low : Wide_Character)
       return Wide_Wide_Character
   is
   begin
      return Wide_Wide_Character'Val (QChar_surrogateToUcs4_ushort_ushort (Wide_Character'Pos (High), Wide_Character'Pos (Low)));
   end Surrogate_To_Ucs_4;

   ------------------------
   -- Surrogate_To_Ucs_4 --
   ------------------------

   function Surrogate_To_Ucs_4
    (High : Q_Char'Class;
     Low : Q_Char'Class)
       return Wide_Wide_Character
   is
   begin
      return Wide_Wide_Character'Val (QChar_surrogateToUcs4_QChar_QChar (High.Object, Low.Object));
   end Surrogate_To_Ucs_4;

   --------------------
   -- To_Case_Folded --
   --------------------

   function To_Case_Folded
    (Ucs_2 : Wide_Character)
       return Wide_Character
   is
   begin
      return Wide_Character'Val (QChar_toCaseFolded_ushort (Wide_Character'Pos (Ucs_2)));
   end To_Case_Folded;

   --------------------
   -- To_Case_Folded --
   --------------------

   function To_Case_Folded
    (Ucs_4 : Wide_Wide_Character)
       return Wide_Wide_Character
   is
   begin
      return Wide_Wide_Character'Val (QChar_toCaseFolded_uint (Wide_Wide_Character'Pos (Ucs_4)));
   end To_Case_Folded;

   --------------
   -- To_Lower --
   --------------

   function To_Lower
    (Ucs_2 : Wide_Character)
       return Wide_Character
   is
   begin
      return Wide_Character'Val (QChar_toLower_ushort (Wide_Character'Pos (Ucs_2)));
   end To_Lower;

   --------------
   -- To_Lower --
   --------------

   function To_Lower
    (Ucs_4 : Wide_Wide_Character)
       return Wide_Wide_Character
   is
   begin
      return Wide_Wide_Character'Val (QChar_toLower_uint (Wide_Wide_Character'Pos (Ucs_4)));
   end To_Lower;

   -------------------
   -- To_Title_Case --
   -------------------

   function To_Title_Case
    (Ucs_2 : Wide_Character)
       return Wide_Character
   is
   begin
      return Wide_Character'Val (QChar_toTitleCase_ushort (Wide_Character'Pos (Ucs_2)));
   end To_Title_Case;

   -------------------
   -- To_Title_Case --
   -------------------

   function To_Title_Case
    (Ucs_4 : Wide_Wide_Character)
       return Wide_Wide_Character
   is
   begin
      return Wide_Wide_Character'Val (QChar_toTitleCase_uint (Wide_Wide_Character'Pos (Ucs_4)));
   end To_Title_Case;

   --------------
   -- To_Upper --
   --------------

   function To_Upper
    (Ucs_2 : Wide_Character)
       return Wide_Character
   is
   begin
      return Wide_Character'Val (QChar_toUpper_ushort (Wide_Character'Pos (Ucs_2)));
   end To_Upper;

   --------------
   -- To_Upper --
   --------------

   function To_Upper
    (Ucs_4 : Wide_Wide_Character)
       return Wide_Wide_Character
   is
   begin
      return Wide_Wide_Character'Val (QChar_toUpper_uint (Wide_Wide_Character'Pos (Ucs_4)));
   end To_Upper;

   ---------------------
   -- Unicode_Version --
   ---------------------

   function Unicode_Version
    (Ucs_2 : Wide_Character)
       return Character_Unicode_Version
   is
   begin
      return QChar_unicodeVersion_ushort (Wide_Character'Pos (Ucs_2));
   end Unicode_Version;

   ---------------------
   -- Unicode_Version --
   ---------------------

   function Unicode_Version
    (Ucs_4 : Wide_Wide_Character)
       return Character_Unicode_Version
   is
   begin
      return QChar_unicodeVersion_uint (Wide_Wide_Character'Pos (Ucs_4));
   end Unicode_Version;

   ---------
   -- "=" --
   ---------

   function "="
    (C_1 : Q_Char;
     C_2 : Q_Char)
       return Boolean
   is
   begin
      return Interfaces.C."/=" (eq_QChar_QChar (C_1.Object, C_2.Object), 0);
   end "=";

   ----------
   -- "<=" --
   ----------

   function "<="
    (C_1 : Q_Char;
     C_2 : Q_Char)
       return Boolean
   is
   begin
      return Interfaces.C."/=" (le_QChar_QChar (C_1.Object, C_2.Object), 0);
   end "<=";

   ----------
   -- ">=" --
   ----------

   function ">="
    (C_1 : Q_Char;
     C_2 : Q_Char)
       return Boolean
   is
   begin
      return Interfaces.C."/=" (ge_QChar_QChar (C_1.Object, C_2.Object), 0);
   end ">=";

   ---------
   -- "<" --
   ---------

   function "<"
    (C_1 : Q_Char;
     C_2 : Q_Char)
       return Boolean
   is
   begin
      return Interfaces.C."/=" (lt_QChar_QChar (C_1.Object, C_2.Object), 0);
   end "<";

   ---------
   -- ">" --
   ---------

   function ">"
    (C_1 : Q_Char;
     C_2 : Q_Char)
       return Boolean
   is
   begin
      return Interfaces.C."/=" (gt_QChar_QChar (C_1.Object, C_2.Object), 0);
   end ">";

   function initialize_QStringList
    (Storage : System.Address)
      return Internals.QStringList_Access;
   pragma Import (C, initialize_QStringList, "__QtAda_inititialize_QStringList");

   function initialize_QStringList_QStringCR
    (Storage : System.Address;
     I : Internals.QString_Access)
      return Internals.QStringList_Access;
   pragma Import (C, initialize_QStringList_QStringCR, "__QtAda_inititialize_QStringList_QStringCR");

   function adjust_QStringList
    (Storage : System.Address;
     From    : Internals.QStringList_Access)
       return Internals.QStringList_Access;
   pragma Import (C, adjust_QStringList, "__QtAda_adjust_QStringList");

   procedure finalize_QStringList (Object : Internals.QStringList_Access);
   pragma Import (C, finalize_QStringList, "__QtAda_finalize_QStringList");

   procedure QStringList_append_QStringCR
    (Self : Internals.QStringList_Access;
     Str : Internals.QString_Access);
   pragma Import (C, QStringList_append_QStringCR, "__QtAda_QStringList_append_QStringCR");

   procedure QStringList_value_int
    (Returns : Internals.QString_Access;
     Self : Internals.QStringList_Access;
     Index : Qt4.Q_Integer);
   pragma Import (C, QStringList_value_int, "__QtAda_QStringList_value_int_Q");

   function QStringList_size
    (Self : Internals.QStringList_Access)
       return Qt4.Q_Integer;
   pragma Import (C, QStringList_size, "__QtAda_QStringList_size_Q");

   procedure QStringList_filter_QStringCR_CaseSensitivity
    (Returns : Internals.QStringList_Access;
     Self : Internals.QStringList_Access;
     Str : Internals.QString_Access;
     Cs : Qt4.Case_Sensitivity);
   pragma Import (C, QStringList_filter_QStringCR_CaseSensitivity, "__QtAda_QStringList_filter_QStringCR_CaseSensitivity_Q");

   procedure QStringList_filter_QRegExpCR
    (Returns : Internals.QStringList_Access;
     Self : Internals.QStringList_Access;
     Rx : Qt4.Reg_Exps.Internals.QRegExp_Access);
   pragma Import (C, QStringList_filter_QRegExpCR, "__QtAda_QStringList_filter_QRegExpCR_Q");

   function QStringList_indexOf_QRegExpCR_int
    (Self : Internals.QStringList_Access;
     Rx : Qt4.Reg_Exps.Internals.QRegExp_Access;
     From : Qt4.Q_Integer)
       return Qt4.Q_Integer;
   pragma Import (C, QStringList_indexOf_QRegExpCR_int, "__QtAda_QStringList_indexOf_QRegExpCR_int_Q");

   procedure QStringList_join_QStringCR
    (Returns : Internals.QString_Access;
     Self : Internals.QStringList_Access;
     Sep : Internals.QString_Access);
   pragma Import (C, QStringList_join_QStringCR, "__QtAda_QStringList_join_QStringCR_Q");

   function QStringList_lastIndexOf_QRegExpCR_int
    (Self : Internals.QStringList_Access;
     Rx : Qt4.Reg_Exps.Internals.QRegExp_Access;
     From : Qt4.Q_Integer)
       return Qt4.Q_Integer;
   pragma Import (C, QStringList_lastIndexOf_QRegExpCR_int, "__QtAda_QStringList_lastIndexOf_QRegExpCR_int_Q");

   procedure QStringList_replaceInStrings_QStringCR_QStringCR_CaseSensitivity
    (Self : Internals.QStringList_Access;
     Before : Internals.QString_Access;
     After : Internals.QString_Access;
     Cs : Qt4.Case_Sensitivity);
   pragma Import (C, QStringList_replaceInStrings_QStringCR_QStringCR_CaseSensitivity, "__QtAda_QStringList_replaceInStrings_QStringCR_QStringCR_CaseSensitivity");

   procedure QStringList_replaceInStrings_QRegExpCR_QStringCR
    (Self : Internals.QStringList_Access;
     Rx : Qt4.Reg_Exps.Internals.QRegExp_Access;
     After : Internals.QString_Access);
   pragma Import (C, QStringList_replaceInStrings_QRegExpCR_QStringCR, "__QtAda_QStringList_replaceInStrings_QRegExpCR_QStringCR");

   procedure QStringList_sort
    (Self : Internals.QStringList_Access);
   pragma Import (C, QStringList_sort, "__QtAda_QStringList_sort");

   procedure QStringList_removeFirst
    (Self : Internals.QStringList_Access);
   pragma Import (C, QStringList_removeFirst, "__QtAda_QStringList_removeFirst");

   procedure QStringList_removeLast
    (Self : Internals.QStringList_Access);
   pragma Import (C, QStringList_removeLast, "__QtAda_QStringList_removeLast");

   function eq_QStringListCR
    (Self : Internals.QStringList_Access;
     L : Internals.QStringList_Access)
       return Interfaces.C.unsigned;
   pragma Import (C, eq_QStringListCR, "__QtAda_QStringList_eq_QStringListCR_Q");

   ------------
   -- Adjust --
   ------------

   overriding
   procedure Adjust (Self : in out Q_String_List) is
   begin
      Self.Object := adjust_QStringList (Self.Storage'Address, Self.Object);
      Self.Wrapper := False;
   end Adjust;

   --------------
   -- Finalize --
   --------------

   overriding
   procedure Finalize (Self : in out Q_String_List) is
   begin
      if not Self.Wrapper then
         finalize_QStringList (Self.Object);
      end if;
   end Finalize;

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

   overriding
   procedure Initialize (Self : in out Q_String_List) is
      use type Internals.QStringList_Access;

   begin
      if Self.Object = null then
         Self.Object := initialize_QStringList (Self.Storage'Address);
      end if;
   end Initialize;

   ------------
   -- Create --
   ------------

   function Create
    (I : Q_String'Class)
       return Q_String_List
   is
   begin
      return Self : Q_String_List
        := (Ada.Finalization.Controlled with others => <>)
      do
         Self.Object := initialize_QStringList_QStringCR (Self.Storage'Address, I.Object);
      end return;
   end Create;

   ------------
   -- Append --
   ------------

   procedure Append
    (Self : in out Q_String_List'Class;
     Str : Q_String'Class)
   is
   begin
      QStringList_append_QStringCR (Self.Object, Str.Object);
   end Append;

   -----------
   -- Value --
   -----------

   function Value
    (Self : Q_String_List'Class;
     Index : Qt4.Q_Integer)
       return Q_String
   is
   begin
      return Returns : Q_String do
         QStringList_value_int (Returns.Object, Self.Object, Index);
      end return;
   end Value;

   ----------
   -- Size --
   ----------

   function Size
    (Self : Q_String_List'Class)
       return Qt4.Q_Integer
   is
   begin
      return QStringList_size (Self.Object);
   end Size;

   ------------
   -- Filter --
   ------------

   function Filter
    (Self : Q_String_List'Class;
     Str : Q_String'Class;
     Cs : Qt4.Case_Sensitivity
       := Case_Sensitive)
       return Q_String_List
   is
   begin
      return Returns : Q_String_List do
         QStringList_filter_QStringCR_CaseSensitivity (Returns.Object, Self.Object, Str.Object, Cs);
      end return;
   end Filter;

   ------------
   -- Filter --
   ------------

   function Filter
    (Self : Q_String_List'Class;
     Rx : Qt4.Reg_Exps.Q_Reg_Exp'Class)
       return Q_String_List
   is
   begin
      return Returns : Q_String_List do
         QStringList_filter_QRegExpCR (Returns.Object, Self.Object, Qt4.Reg_Exps.Internals.QRegExp_View (Rx));
      end return;
   end Filter;

   --------------
   -- Index_Of --
   --------------

   function Index_Of
    (Self : Q_String_List'Class;
     Rx : Qt4.Reg_Exps.Q_Reg_Exp'Class;
     From : Qt4.Q_Integer
       := 0)
       return Qt4.Q_Integer
   is
   begin
      return QStringList_indexOf_QRegExpCR_int (Self.Object, Qt4.Reg_Exps.Internals.QRegExp_View (Rx), From);
   end Index_Of;

   ----------
   -- Join --
   ----------

   function Join
    (Self : Q_String_List'Class;
     Sep : Q_String'Class)
       return Q_String
   is
   begin
      return Returns : Q_String do
         QStringList_join_QStringCR (Returns.Object, Self.Object, Sep.Object);
      end return;
   end Join;

   -------------------
   -- Last_Index_Of --
   -------------------

   function Last_Index_Of
    (Self : Q_String_List'Class;
     Rx : Qt4.Reg_Exps.Q_Reg_Exp'Class;
     From : Qt4.Q_Integer
       := -1)
       return Qt4.Q_Integer
   is
   begin
      return QStringList_lastIndexOf_QRegExpCR_int (Self.Object, Qt4.Reg_Exps.Internals.QRegExp_View (Rx), From);
   end Last_Index_Of;

   ------------------------
   -- Replace_In_Strings --
   ------------------------

   procedure Replace_In_Strings
    (Self : in out Q_String_List'Class;
     Before : Q_String'Class;
     After : Q_String'Class;
     Cs : Qt4.Case_Sensitivity
       := Case_Sensitive)
   is
   begin
      QStringList_replaceInStrings_QStringCR_QStringCR_CaseSensitivity (Self.Object, Before.Object, After.Object, Cs);
   end Replace_In_Strings;

   ------------------------
   -- Replace_In_Strings --
   ------------------------

   procedure Replace_In_Strings
    (Self : in out Q_String_List'Class;
     Rx : Qt4.Reg_Exps.Q_Reg_Exp'Class;
     After : Q_String'Class)
   is
   begin
      QStringList_replaceInStrings_QRegExpCR_QStringCR (Self.Object, Qt4.Reg_Exps.Internals.QRegExp_View (Rx), After.Object);
   end Replace_In_Strings;

   ----------
   -- Sort --
   ----------

   procedure Sort
    (Self : in out Q_String_List'Class)
   is
   begin
      QStringList_sort (Self.Object);
   end Sort;

   ------------------
   -- Remove_First --
   ------------------

   procedure Remove_First
    (Self : in out Q_String_List'Class)
   is
   begin
      QStringList_removeFirst (Self.Object);
   end Remove_First;

   -----------------
   -- Remove_Last --
   -----------------

   procedure Remove_Last
    (Self : in out Q_String_List'Class)
   is
   begin
      QStringList_removeLast (Self.Object);
   end Remove_Last;

   ---------
   -- "=" --
   ---------

   function "="
    (Self : Q_String_List;
     L : Q_String_List)
       return Boolean
   is
   begin
      return Interfaces.C."/=" (eq_QStringListCR (Self.Object, L.Object), 0);
   end "=";

   function initialize_QString
    (Storage : System.Address)
      return Internals.QString_Access;
   pragma Import (C, initialize_QString, "__QtAda_inititialize_QString");

   function initialize_QString_QChar
    (Storage : System.Address;
     C : Internals.QChar_Access)
      return Internals.QString_Access;
   pragma Import (C, initialize_QString_QChar, "__QtAda_inititialize_QString_QChar");

   function adjust_QString
    (Storage : System.Address;
     From    : Internals.QString_Access)
       return Internals.QString_Access;
   pragma Import (C, adjust_QString, "__QtAda_adjust_QString");

   procedure finalize_QString (Object : Internals.QString_Access);
   pragma Import (C, finalize_QString, "__QtAda_finalize_QString");

   procedure QString_append_QStringCR
    (Self : Internals.QString_Access;
     S : Internals.QString_Access);
   pragma Import (C, QString_append_QStringCR, "__QtAda_QString_append_QStringCR");

   procedure QString_append_QChar
    (Self : Internals.QString_Access;
     C : Internals.QChar_Access);
   pragma Import (C, QString_append_QChar, "__QtAda_QString_append_QChar");

   procedure QString_at_int
    (Returns : Internals.QChar_Access;
     Self : Internals.QString_Access;
     I : Qt4.Q_Integer);
   pragma Import (C, QString_at_int, "__QtAda_QString_at_int_Q");

   function QString_capacity
    (Self : Internals.QString_Access)
       return Qt4.Q_Integer;
   pragma Import (C, QString_capacity, "__QtAda_QString_capacity_Q");

   procedure QString_chop_int
    (Self : Internals.QString_Access;
     N : Qt4.Q_Integer);
   pragma Import (C, QString_chop_int, "__QtAda_QString_chop_int");

   procedure QString_clear
    (Self : Internals.QString_Access);
   pragma Import (C, QString_clear, "__QtAda_QString_clear");

   function QString_compare_QStringCR
    (Self : Internals.QString_Access;
     S : Internals.QString_Access)
       return Qt4.Q_Integer;
   pragma Import (C, QString_compare_QStringCR, "__QtAda_QString_compare_QStringCR_Q");

   function QString_compare_QStringCR_CaseSensitivity
    (Self : Internals.QString_Access;
     S : Internals.QString_Access;
     Cs : Qt4.Case_Sensitivity)
       return Qt4.Q_Integer;
   pragma Import (C, QString_compare_QStringCR_CaseSensitivity, "__QtAda_QString_compare_QStringCR_CaseSensitivity_Q");

   function QString_contains_QStringCR_CaseSensitivity
    (Self : Internals.QString_Access;
     S : in Internals.QString_Access;
     Cs : in Qt4.Case_Sensitivity)
       return Interfaces.C.unsigned;
   pragma Import (C, QString_contains_QStringCR_CaseSensitivity, "__QtAda_QString_contains_QStringCR_CaseSensitivity_Q");

   function QString_contains_QChar_CaseSensitivity
    (Self : Internals.QString_Access;
     C : in Internals.QChar_Access;
     Cs : in Qt4.Case_Sensitivity)
       return Interfaces.C.unsigned;
   pragma Import (C, QString_contains_QChar_CaseSensitivity, "__QtAda_QString_contains_QChar_CaseSensitivity_Q");

   function QString_contains_QRegExpCR
    (Self : Internals.QString_Access;
     S : in Qt4.Reg_Exps.Internals.QRegExp_Access)
       return Interfaces.C.unsigned;
   pragma Import (C, QString_contains_QRegExpCR, "__QtAda_QString_contains_QRegExpCR_Q");

   function QString_count_QStringCR_CaseSensitivity
    (Self : Internals.QString_Access;
     S : Internals.QString_Access;
     Cs : Qt4.Case_Sensitivity)
       return Qt4.Q_Integer;
   pragma Import (C, QString_count_QStringCR_CaseSensitivity, "__QtAda_QString_count_QStringCR_CaseSensitivity_Q");

   function QString_count_QChar_CaseSensitivity
    (Self : Internals.QString_Access;
     C : Internals.QChar_Access;
     Cs : Qt4.Case_Sensitivity)
       return Qt4.Q_Integer;
   pragma Import (C, QString_count_QChar_CaseSensitivity, "__QtAda_QString_count_QChar_CaseSensitivity_Q");

   function QString_count_QRegExpCR
    (Self : Internals.QString_Access;
     S : Qt4.Reg_Exps.Internals.QRegExp_Access)
       return Qt4.Q_Integer;
   pragma Import (C, QString_count_QRegExpCR, "__QtAda_QString_count_QRegExpCR_Q");

   function QString_count
    (Self : Internals.QString_Access)
       return Qt4.Q_Integer;
   pragma Import (C, QString_count, "__QtAda_QString_count_Q");

   function QString_endsWith_QStringCR_CaseSensitivity
    (Self : Internals.QString_Access;
     S : Internals.QString_Access;
     Cs : Qt4.Case_Sensitivity)
       return Interfaces.C.unsigned;
   pragma Import (C, QString_endsWith_QStringCR_CaseSensitivity, "__QtAda_QString_endsWith_QStringCR_CaseSensitivity_Q");

   function QString_endsWith_QCharCR_CaseSensitivity
    (Self : Internals.QString_Access;
     C : Internals.QChar_Access;
     Cs : Qt4.Case_Sensitivity)
       return Interfaces.C.unsigned;
   pragma Import (C, QString_endsWith_QCharCR_CaseSensitivity, "__QtAda_QString_endsWith_QCharCR_CaseSensitivity_Q");

   procedure QString_fill_QChar_int
    (Self : Internals.QString_Access;
     C : Internals.QChar_Access;
     Size : Qt4.Q_Integer);
   pragma Import (C, QString_fill_QChar_int, "__QtAda_QString_fill_QChar_int");

   function QString_indexOf_QStringCR_int_CaseSensitivity
    (Self : Internals.QString_Access;
     S : Internals.QString_Access;
     From : Qt4.Q_Integer;
     Cs : Qt4.Case_Sensitivity)
       return Qt4.Q_Integer;
   pragma Import (C, QString_indexOf_QStringCR_int_CaseSensitivity, "__QtAda_QString_indexOf_QStringCR_int_CaseSensitivity_Q");

   function QString_indexOf_QChar_int_CaseSensitivity
    (Self : Internals.QString_Access;
     C : Internals.QChar_Access;
     From : Qt4.Q_Integer;
     Cs : Qt4.Case_Sensitivity)
       return Qt4.Q_Integer;
   pragma Import (C, QString_indexOf_QChar_int_CaseSensitivity, "__QtAda_QString_indexOf_QChar_int_CaseSensitivity_Q");

   function QString_indexOf_QRegExpCR_int
    (Self : Internals.QString_Access;
     Rx : Qt4.Reg_Exps.Internals.QRegExp_Access;
     From : Qt4.Q_Integer)
       return Qt4.Q_Integer;
   pragma Import (C, QString_indexOf_QRegExpCR_int, "__QtAda_QString_indexOf_QRegExpCR_int_Q");

   procedure QString_insert_int_QStringCR
    (Self : Internals.QString_Access;
     I : Qt4.Q_Integer;
     S : Internals.QString_Access);
   pragma Import (C, QString_insert_int_QStringCR, "__QtAda_QString_insert_int_QStringCR");

   procedure QString_insert_int_QChar
    (Self : Internals.QString_Access;
     I : Qt4.Q_Integer;
     C : Internals.QChar_Access);
   pragma Import (C, QString_insert_int_QChar, "__QtAda_QString_insert_int_QChar");

   function QString_isEmpty
    (Self : Internals.QString_Access)
       return Interfaces.C.unsigned;
   pragma Import (C, QString_isEmpty, "__QtAda_QString_isEmpty_Q");

   function QString_isNull
    (Self : Internals.QString_Access)
       return Interfaces.C.unsigned;
   pragma Import (C, QString_isNull, "__QtAda_QString_isNull_Q");

   function QString_lastIndexOf_QStringCR_int_CaseSensitivity
    (Self : Internals.QString_Access;
     S : Internals.QString_Access;
     From : Qt4.Q_Integer;
     Cs : Qt4.Case_Sensitivity)
       return Qt4.Q_Integer;
   pragma Import (C, QString_lastIndexOf_QStringCR_int_CaseSensitivity, "__QtAda_QString_lastIndexOf_QStringCR_int_CaseSensitivity_Q");

   function QString_lastIndexOf_QChar_int_CaseSensitivity
    (Self : Internals.QString_Access;
     C : Internals.QChar_Access;
     From : Qt4.Q_Integer;
     Cs : Qt4.Case_Sensitivity)
       return Qt4.Q_Integer;
   pragma Import (C, QString_lastIndexOf_QChar_int_CaseSensitivity, "__QtAda_QString_lastIndexOf_QChar_int_CaseSensitivity_Q");

   function QString_lastIndexOf_QRegExpCR_int
    (Self : Internals.QString_Access;
     Rx : Qt4.Reg_Exps.Internals.QRegExp_Access;
     From : Qt4.Q_Integer)
       return Qt4.Q_Integer;
   pragma Import (C, QString_lastIndexOf_QRegExpCR_int, "__QtAda_QString_lastIndexOf_QRegExpCR_int_Q");

   procedure QString_left_int
    (Returns : Internals.QString_Access;
     Self : Internals.QString_Access;
     N : Qt4.Q_Integer);
   pragma Import (C, QString_left_int, "__QtAda_QString_left_int_Q");

   procedure QString_leftJustified_int_QChar_bool
    (Returns : Internals.QString_Access;
     Self : Internals.QString_Access;
     Width : Qt4.Q_Integer;
     Fill : Internals.QChar_Access;
     Trunc : Interfaces.C.unsigned);
   pragma Import (C, QString_leftJustified_int_QChar_bool, "__QtAda_QString_leftJustified_int_QChar_bool_Q");

   function QString_length
    (Self : Internals.QString_Access)
       return Qt4.Q_Integer;
   pragma Import (C, QString_length, "__QtAda_QString_length_Q");

   function QString_localeAwareCompare_QStringCR
    (Self : Internals.QString_Access;
     S : Internals.QString_Access)
       return Qt4.Q_Integer;
   pragma Import (C, QString_localeAwareCompare_QStringCR, "__QtAda_QString_localeAwareCompare_QStringCR_Q");

   procedure QString_mid_int_int
    (Returns : Internals.QString_Access;
     Self : Internals.QString_Access;
     Position : Qt4.Q_Integer;
     N : Qt4.Q_Integer);
   pragma Import (C, QString_mid_int_int, "__QtAda_QString_mid_int_int_Q");

   procedure QString_normalized_NormalizationForm
    (Returns : Internals.QString_Access;
     Self : Internals.QString_Access;
     Mode : Normalization_Form);
   pragma Import (C, QString_normalized_NormalizationForm, "__QtAda_QString_normalized_NormalizationForm_Q");

   procedure QString_normalized_NormalizationForm_UnicodeVersion
    (Returns : Internals.QString_Access;
     Self : Internals.QString_Access;
     Mode : Normalization_Form;
     Version : Character_Unicode_Version);
   pragma Import (C, QString_normalized_NormalizationForm_UnicodeVersion, "__QtAda_QString_normalized_NormalizationForm_UnicodeVersion_Q");

   procedure QString_prepend_QStringCR
    (Self : Internals.QString_Access;
     S : Internals.QString_Access);
   pragma Import (C, QString_prepend_QStringCR, "__QtAda_QString_prepend_QStringCR");

   procedure QString_prepend_QChar
    (Self : Internals.QString_Access;
     C : Internals.QChar_Access);
   pragma Import (C, QString_prepend_QChar, "__QtAda_QString_prepend_QChar");

   procedure QString_remove_int_int
    (Self : Internals.QString_Access;
     I : Qt4.Q_Integer;
     Len : Qt4.Q_Integer);
   pragma Import (C, QString_remove_int_int, "__QtAda_QString_remove_int_int");

   procedure QString_remove_QStringCR_CaseSensitivity
    (Self : Internals.QString_Access;
     S : Internals.QString_Access;
     Cs : Qt4.Case_Sensitivity);
   pragma Import (C, QString_remove_QStringCR_CaseSensitivity, "__QtAda_QString_remove_QStringCR_CaseSensitivity");

   procedure QString_remove_QChar_CaseSensitivity
    (Self : Internals.QString_Access;
     C : Internals.QChar_Access;
     Cs : Qt4.Case_Sensitivity);
   pragma Import (C, QString_remove_QChar_CaseSensitivity, "__QtAda_QString_remove_QChar_CaseSensitivity");

   procedure QString_remove_QRegExpCR
    (Self : Internals.QString_Access;
     S : Qt4.Reg_Exps.Internals.QRegExp_Access);
   pragma Import (C, QString_remove_QRegExpCR, "__QtAda_QString_remove_QRegExpCR");

   procedure QString_replace_int_int_QStringCR
    (Self : Internals.QString_Access;
     I : Qt4.Q_Integer;
     Len : Qt4.Q_Integer;
     After : Internals.QString_Access);
   pragma Import (C, QString_replace_int_int_QStringCR, "__QtAda_QString_replace_int_int_QStringCR");

   procedure QString_replace_int_int_QChar
    (Self : Internals.QString_Access;
     I : Qt4.Q_Integer;
     Len : Qt4.Q_Integer;
     After : Internals.QChar_Access);
   pragma Import (C, QString_replace_int_int_QChar, "__QtAda_QString_replace_int_int_QChar");

   procedure QString_replace_QStringCR_QStringCR_CaseSensitivity
    (Self : Internals.QString_Access;
     Before : Internals.QString_Access;
     After : Internals.QString_Access;
     Cs : Qt4.Case_Sensitivity);
   pragma Import (C, QString_replace_QStringCR_QStringCR_CaseSensitivity, "__QtAda_QString_replace_QStringCR_QStringCR_CaseSensitivity");

   procedure QString_replace_QChar_QStringCR_CaseSensitivity
    (Self : Internals.QString_Access;
     Ch : Internals.QChar_Access;
     After : Internals.QString_Access;
     Cs : Qt4.Case_Sensitivity);
   pragma Import (C, QString_replace_QChar_QStringCR_CaseSensitivity, "__QtAda_QString_replace_QChar_QStringCR_CaseSensitivity");

   procedure QString_replace_QChar_QChar_CaseSensitivity
    (Self : Internals.QString_Access;
     Before : Internals.QChar_Access;
     After : Internals.QChar_Access;
     Cs : Qt4.Case_Sensitivity);
   pragma Import (C, QString_replace_QChar_QChar_CaseSensitivity, "__QtAda_QString_replace_QChar_QChar_CaseSensitivity");

   procedure QString_replace_QRegExpCR_QStringCR
    (Self : Internals.QString_Access;
     Rx : Qt4.Reg_Exps.Internals.QRegExp_Access;
     After : Internals.QString_Access);
   pragma Import (C, QString_replace_QRegExpCR_QStringCR, "__QtAda_QString_replace_QRegExpCR_QStringCR");

   procedure QString_reserve_int
    (Self : Internals.QString_Access;
     Size : Qt4.Q_Integer);
   pragma Import (C, QString_reserve_int, "__QtAda_QString_reserve_int");

   procedure QString_resize_int
    (Self : Internals.QString_Access;
     Size : Qt4.Q_Integer);
   pragma Import (C, QString_resize_int, "__QtAda_QString_resize_int");

   procedure QString_right_int
    (Returns : Internals.QString_Access;
     Self : Internals.QString_Access;
     N : Qt4.Q_Integer);
   pragma Import (C, QString_right_int, "__QtAda_QString_right_int_Q");

   procedure QString_rightJustified_int_QChar_bool
    (Returns : Internals.QString_Access;
     Self : Internals.QString_Access;
     Width : Qt4.Q_Integer;
     Fill : Internals.QChar_Access;
     Trunc : Interfaces.C.unsigned);
   pragma Import (C, QString_rightJustified_int_QChar_bool, "__QtAda_QString_rightJustified_int_QChar_bool_Q");

   procedure QString_simplified
    (Returns : Internals.QString_Access;
     Self : Internals.QString_Access);
   pragma Import (C, QString_simplified, "__QtAda_QString_simplified_Q");

   function QString_size
    (Self : Internals.QString_Access)
       return Qt4.Q_Integer;
   pragma Import (C, QString_size, "__QtAda_QString_size_Q");

   procedure QString_split_QStringCR_SplitBehavior_CaseSensitivity
    (Returns : Internals.QStringList_Access;
     Self : Internals.QString_Access;
     Sep : Internals.QString_Access;
     Behavior : Split_Behavior;
     Cs : Qt4.Case_Sensitivity);
   pragma Import (C, QString_split_QStringCR_SplitBehavior_CaseSensitivity, "__QtAda_QString_split_QStringCR_SplitBehavior_CaseSensitivity_Q");

   procedure QString_split_QCharCR_SplitBehavior_CaseSensitivity
    (Returns : Internals.QStringList_Access;
     Self : Internals.QString_Access;
     Sep : Internals.QChar_Access;
     Behavior : Split_Behavior;
     Cs : Qt4.Case_Sensitivity);
   pragma Import (C, QString_split_QCharCR_SplitBehavior_CaseSensitivity, "__QtAda_QString_split_QCharCR_SplitBehavior_CaseSensitivity_Q");

   procedure QString_split_QRegExpCR_SplitBehavior
    (Returns : Internals.QStringList_Access;
     Self : Internals.QString_Access;
     Sep : Qt4.Reg_Exps.Internals.QRegExp_Access;
     Behavior : Split_Behavior);
   pragma Import (C, QString_split_QRegExpCR_SplitBehavior, "__QtAda_QString_split_QRegExpCR_SplitBehavior_Q");

   procedure QString_squeeze
    (Self : Internals.QString_Access);
   pragma Import (C, QString_squeeze, "__QtAda_QString_squeeze");

   function QString_startsWith_QStringCR_CaseSensitivity
    (Self : Internals.QString_Access;
     S : Internals.QString_Access;
     Cs : Qt4.Case_Sensitivity)
       return Interfaces.C.unsigned;
   pragma Import (C, QString_startsWith_QStringCR_CaseSensitivity, "__QtAda_QString_startsWith_QStringCR_CaseSensitivity_Q");

   function QString_startsWith_QCharCR_CaseSensitivity
    (Self : Internals.QString_Access;
     S : Internals.QChar_Access;
     Cs : Qt4.Case_Sensitivity)
       return Interfaces.C.unsigned;
   pragma Import (C, QString_startsWith_QCharCR_CaseSensitivity, "__QtAda_QString_startsWith_QCharCR_CaseSensitivity_Q");

   procedure QString_toCaseFolded
    (Returns : Internals.QString_Access;
     Self : Internals.QString_Access);
   pragma Import (C, QString_toCaseFolded, "__QtAda_QString_toCaseFolded_Q");

   procedure QString_toLatin1
    (Returns : Qt4.Byte_Arrays.Internals.QByteArray_Access;
     Self : Internals.QString_Access);
   pragma Import (C, QString_toLatin1, "__QtAda_QString_toLatin1_Q");

   procedure QString_toLocal8Bit
    (Returns : Qt4.Byte_Arrays.Internals.QByteArray_Access;
     Self : Internals.QString_Access);
   pragma Import (C, QString_toLocal8Bit, "__QtAda_QString_toLocal8Bit_Q");

   procedure QString_toLower
    (Returns : Internals.QString_Access;
     Self : Internals.QString_Access);
   pragma Import (C, QString_toLower, "__QtAda_QString_toLower_Q");

   procedure QString_toUpper
    (Returns : Internals.QString_Access;
     Self : Internals.QString_Access);
   pragma Import (C, QString_toUpper, "__QtAda_QString_toUpper_Q");

   procedure QString_toUtf8
    (Returns : Qt4.Byte_Arrays.Internals.QByteArray_Access;
     Self : Internals.QString_Access);
   pragma Import (C, QString_toUtf8, "__QtAda_QString_toUtf8_Q");

   procedure QString_trimmed
    (Returns : Internals.QString_Access;
     Self : Internals.QString_Access);
   pragma Import (C, QString_trimmed, "__QtAda_QString_trimmed_Q");

   procedure QString_truncate_int
    (Self : Internals.QString_Access;
     Size : Qt4.Q_Integer);
   pragma Import (C, QString_truncate_int, "__QtAda_QString_truncate_int");

   function eq_QStringCR
    (Self : Internals.QString_Access;
     S : Internals.QString_Access)
       return Interfaces.C.unsigned;
   pragma Import (C, eq_QStringCR, "__QtAda_QString_eq_QStringCR_Q");

   function lt_QStringCR
    (Self : Internals.QString_Access;
     S : Internals.QString_Access)
       return Interfaces.C.unsigned;
   pragma Import (C, lt_QStringCR, "__QtAda_QString_lt_QStringCR_Q");

   function gt_QStringCR
    (Self : Internals.QString_Access;
     S : Internals.QString_Access)
       return Interfaces.C.unsigned;
   pragma Import (C, gt_QStringCR, "__QtAda_QString_gt_QStringCR_Q");

   function le_QStringCR
    (Self : Internals.QString_Access;
     S : Internals.QString_Access)
       return Interfaces.C.unsigned;
   pragma Import (C, le_QStringCR, "__QtAda_QString_le_QStringCR_Q");

   function ge_QStringCR
    (Self : Internals.QString_Access;
     S : Internals.QString_Access)
       return Interfaces.C.unsigned;
   pragma Import (C, ge_QStringCR, "__QtAda_QString_ge_QStringCR_Q");

   type unsigned_short_Array is
     array (Positive range <>) of aliased Interfaces.C.unsigned_short;

   type unsigned_Array is
     array (Positive range <>) of aliased Interfaces.C.unsigned;

   procedure QString_fromUtf8
    (Returns : Internals.QString_Access;
     Str     : Interfaces.C.char_array);
   pragma Import (C, QString_fromUtf8, "__QtAda_QString_fromUtf8_S");

   procedure QString_fromUtf16
    (Returns : Internals.QString_Access;
     Str     : unsigned_short_Array);
   pragma Import (C, QString_fromUtf16, "__QtAda_QString_fromUtf16_S");

   procedure QString_fromUcs4
    (Returns : Internals.QString_Access;
     Str     : unsigned_Array);
   pragma Import (C, QString_fromUcs4, "__QtAda_QString_fromUcs4_S");

   procedure QString_fromLocal8Bit
    (Returns : Internals.QString_Access;
     Str     : Interfaces.C.char_array);
   pragma Import (C, QString_fromLocal8Bit, "__QtAda_QString_fromLocal8Bit_S");

   procedure QString_toUtf8_1
    (Returns : Interfaces.C.char_array;
     Self    : Internals.QString_Access);
   pragma Import (C, QString_toUtf8_1, "__QtAda_QString_toUtf8_Q_1");

   procedure QString_utf16
    (Returns : unsigned_short_Array;
     Self    : Internals.QString_Access);
   pragma Import (C, QString_utf16, "__QtAda_QString_utf16_Q");

   procedure QString_toUcs4
    (Returns : unsigned_Array;
     Self    : Internals.QString_Access);
   pragma Import (C, QString_toUcs4, "__QtAda_QString_toUcs4_Q");

   procedure QString_toLocal8Bit_1
    (Returns : Interfaces.C.char_array;
     Self    : Internals.QString_Access);
   pragma Import (C, QString_toLocal8Bit_1, "__QtAda_QString_toLocal8Bit_Q_1");

   procedure plus_QStringCR_QStringCR
    (Returns : Internals.QString_Access;
     Left : Internals.QString_Access;
     Right : Internals.QString_Access);
   pragma Import (C, plus_QStringCR_QStringCR, "__QtAda_plus_QStringCR_QStringCR");

   ------------
   -- Adjust --
   ------------

   overriding
   procedure Adjust (Self : in out Q_String) is
   begin
      Self.Object := adjust_QString (Self.Storage'Address, Self.Object);
      Self.Wrapper := False;
   end Adjust;

   --------------
   -- Finalize --
   --------------

   overriding
   procedure Finalize (Self : in out Q_String) is
   begin
      if not Self.Wrapper then
         finalize_QString (Self.Object);
      end if;
   end Finalize;

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

   overriding
   procedure Initialize (Self : in out Q_String) is
      use type Internals.QString_Access;

   begin
      if Self.Object = null then
         Self.Object := initialize_QString (Self.Storage'Address);
      end if;
   end Initialize;

   ------------
   -- Create --
   ------------

   function Create return Q_String is
   begin
      return Self : Q_String
        := (Ada.Finalization.Controlled with others => <>)
      do
         Self.Object := initialize_QString (Self.Storage'Address);
      end return;
   end Create;

   ------------
   -- Create --
   ------------

   function Create
    (C : Q_Char'Class)
       return Q_String
   is
   begin
      return Self : Q_String
        := (Ada.Finalization.Controlled with others => <>)
      do
         Self.Object := initialize_QString_QChar (Self.Storage'Address, C.Object);
      end return;
   end Create;

   ------------
   -- Append --
   ------------

   procedure Append
    (Self : in out Q_String'Class;
     S : Q_String'Class)
   is
   begin
      QString_append_QStringCR (Self.Object, S.Object);
   end Append;

   ------------
   -- Append --
   ------------

   procedure Append
    (Self : in out Q_String'Class;
     C : Q_Char'Class)
   is
   begin
      QString_append_QChar (Self.Object, C.Object);
   end Append;

   ------------------
   -- Character_At --
   ------------------

   function Character_At
    (Self : Q_String'Class;
     I : Qt4.Q_Integer)
       return Q_Char
   is
   begin
      return Returns : Q_Char do
         QString_at_int (Returns.Object, Self.Object, I);
      end return;
   end Character_At;

   --------------
   -- Capacity --
   --------------

   function Capacity
    (Self : Q_String'Class)
       return Qt4.Q_Integer
   is
   begin
      return QString_capacity (Self.Object);
   end Capacity;

   ----------
   -- Chop --
   ----------

   procedure Chop
    (Self : in out Q_String'Class;
     N : Qt4.Q_Integer)
   is
   begin
      QString_chop_int (Self.Object, N);
   end Chop;

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

   procedure Clear
    (Self : in out Q_String'Class)
   is
   begin
      QString_clear (Self.Object);
   end Clear;

   -------------
   -- Compare --
   -------------

   function Compare
    (Self : Q_String'Class;
     S : Q_String'Class)
       return Qt4.Q_Integer
   is
   begin
      return QString_compare_QStringCR (Self.Object, S.Object);
   end Compare;

   -------------
   -- Compare --
   -------------

   function Compare
    (Self : Q_String'Class;
     S : Q_String'Class;
     Cs : Qt4.Case_Sensitivity)
       return Qt4.Q_Integer
   is
   begin
      return QString_compare_QStringCR_CaseSensitivity (Self.Object, S.Object, Cs);
   end Compare;

   --------------
   -- Contains --
   --------------

   function Contains
    (Self : Q_String'Class;
     S : in Q_String'Class;
     Cs : in Qt4.Case_Sensitivity
       := Case_Sensitive)
       return Boolean
   is
   begin
      return Interfaces.C."/=" (QString_contains_QStringCR_CaseSensitivity (Self.Object, S.Object, Cs), 0);
   end Contains;

   --------------
   -- Contains --
   --------------

   function Contains
    (Self : Q_String'Class;
     C : in Q_Char'Class;
     Cs : in Qt4.Case_Sensitivity
       := Case_Sensitive)
       return Boolean
   is
   begin
      return Interfaces.C."/=" (QString_contains_QChar_CaseSensitivity (Self.Object, C.Object, Cs), 0);
   end Contains;

   --------------
   -- Contains --
   --------------

   function Contains
    (Self : Q_String'Class;
     S : in Qt4.Reg_Exps.Q_Reg_Exp'Class)
       return Boolean
   is
   begin
      return Interfaces.C."/=" (QString_contains_QRegExpCR (Self.Object, Qt4.Reg_Exps.Internals.QRegExp_View (S)), 0);
   end Contains;

   -----------
   -- Count --
   -----------

   function Count
    (Self : Q_String'Class;
     S : Q_String'Class;
     Cs : Qt4.Case_Sensitivity
       := Case_Sensitive)
       return Qt4.Q_Integer
   is
   begin
      return QString_count_QStringCR_CaseSensitivity (Self.Object, S.Object, Cs);
   end Count;

   -----------
   -- Count --
   -----------

   function Count
    (Self : Q_String'Class;
     C : Q_Char'Class;
     Cs : Qt4.Case_Sensitivity
       := Case_Sensitive)
       return Qt4.Q_Integer
   is
   begin
      return QString_count_QChar_CaseSensitivity (Self.Object, C.Object, Cs);
   end Count;

   -----------
   -- Count --
   -----------

   function Count
    (Self : Q_String'Class;
     S : Qt4.Reg_Exps.Q_Reg_Exp'Class)
       return Qt4.Q_Integer
   is
   begin
      return QString_count_QRegExpCR (Self.Object, Qt4.Reg_Exps.Internals.QRegExp_View (S));
   end Count;

   -----------
   -- Count --
   -----------

   function Count
    (Self : Q_String'Class)
       return Qt4.Q_Integer
   is
   begin
      return QString_count (Self.Object);
   end Count;

   ---------------
   -- Ends_With --
   ---------------

   function Ends_With
    (Self : Q_String'Class;
     S : Q_String'Class;
     Cs : Qt4.Case_Sensitivity
       := Case_Sensitive)
       return Boolean
   is
   begin
      return Interfaces.C."/=" (QString_endsWith_QStringCR_CaseSensitivity (Self.Object, S.Object, Cs), 0);
   end Ends_With;

   ---------------
   -- Ends_With --
   ---------------

   function Ends_With
    (Self : Q_String'Class;
     C : Q_Char'Class;
     Cs : Qt4.Case_Sensitivity
       := Case_Sensitive)
       return Boolean
   is
   begin
      return Interfaces.C."/=" (QString_endsWith_QCharCR_CaseSensitivity (Self.Object, C.Object, Cs), 0);
   end Ends_With;

   ----------
   -- Fill --
   ----------

   procedure Fill
    (Self : in out Q_String'Class;
     C : Q_Char'Class;
     Size : Qt4.Q_Integer
       := -1)
   is
   begin
      QString_fill_QChar_int (Self.Object, C.Object, Size);
   end Fill;

   --------------
   -- Index_Of --
   --------------

   function Index_Of
    (Self : Q_String'Class;
     S : Q_String'Class;
     From : Qt4.Q_Integer
       := 0;
     Cs : Qt4.Case_Sensitivity
       := Case_Sensitive)
       return Qt4.Q_Integer
   is
   begin
      return QString_indexOf_QStringCR_int_CaseSensitivity (Self.Object, S.Object, From, Cs);
   end Index_Of;

   --------------
   -- Index_Of --
   --------------

   function Index_Of
    (Self : Q_String'Class;
     C : Q_Char'Class;
     From : Qt4.Q_Integer
       := 0;
     Cs : Qt4.Case_Sensitivity
       := Case_Sensitive)
       return Qt4.Q_Integer
   is
   begin
      return QString_indexOf_QChar_int_CaseSensitivity (Self.Object, C.Object, From, Cs);
   end Index_Of;

   --------------
   -- Index_Of --
   --------------

   function Index_Of
    (Self : Q_String'Class;
     Rx : Qt4.Reg_Exps.Q_Reg_Exp'Class;
     From : Qt4.Q_Integer
       := 0)
       return Qt4.Q_Integer
   is
   begin
      return QString_indexOf_QRegExpCR_int (Self.Object, Qt4.Reg_Exps.Internals.QRegExp_View (Rx), From);
   end Index_Of;

   ------------
   -- Insert --
   ------------

   procedure Insert
    (Self : in out Q_String'Class;
     I : Qt4.Q_Integer;
     S : Q_String'Class)
   is
   begin
      QString_insert_int_QStringCR (Self.Object, I, S.Object);
   end Insert;

   ------------
   -- Insert --
   ------------

   procedure Insert
    (Self : in out Q_String'Class;
     I : Qt4.Q_Integer;
     C : Q_Char'Class)
   is
   begin
      QString_insert_int_QChar (Self.Object, I, C.Object);
   end Insert;

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

   function Is_Empty
    (Self : Q_String'Class)
       return Boolean
   is
   begin
      return Interfaces.C."/=" (QString_isEmpty (Self.Object), 0);
   end Is_Empty;

   -------------
   -- Is_Null --
   -------------

   function Is_Null
    (Self : Q_String'Class)
       return Boolean
   is
   begin
      return Interfaces.C."/=" (QString_isNull (Self.Object), 0);
   end Is_Null;

   -------------------
   -- Last_Index_Of --
   -------------------

   function Last_Index_Of
    (Self : Q_String'Class;
     S : Q_String'Class;
     From : Qt4.Q_Integer
       := -1;
     Cs : Qt4.Case_Sensitivity
       := Case_Sensitive)
       return Qt4.Q_Integer
   is
   begin
      return QString_lastIndexOf_QStringCR_int_CaseSensitivity (Self.Object, S.Object, From, Cs);
   end Last_Index_Of;

   -------------------
   -- Last_Index_Of --
   -------------------

   function Last_Index_Of
    (Self : Q_String'Class;
     C : Q_Char'Class;
     From : Qt4.Q_Integer
       := -1;
     Cs : Qt4.Case_Sensitivity
       := Case_Sensitive)
       return Qt4.Q_Integer
   is
   begin
      return QString_lastIndexOf_QChar_int_CaseSensitivity (Self.Object, C.Object, From, Cs);
   end Last_Index_Of;

   -------------------
   -- Last_Index_Of --
   -------------------

   function Last_Index_Of
    (Self : Q_String'Class;
     Rx : Qt4.Reg_Exps.Q_Reg_Exp'Class;
     From : Qt4.Q_Integer
       := -1)
       return Qt4.Q_Integer
   is
   begin
      return QString_lastIndexOf_QRegExpCR_int (Self.Object, Qt4.Reg_Exps.Internals.QRegExp_View (Rx), From);
   end Last_Index_Of;

   ----------
   -- Left --
   ----------

   function Left
    (Self : Q_String'Class;
     N : Qt4.Q_Integer)
       return Q_String
   is
   begin
      return Returns : Q_String do
         QString_left_int (Returns.Object, Self.Object, N);
      end return;
   end Left;

   --------------------
   -- Left_Justified --
   --------------------

   function Left_Justified
    (Self : Q_String'Class;
     Width : Qt4.Q_Integer;
     Fill : Q_Char'Class;
     Trunc : Boolean
       := False)
       return Q_String
   is
   begin
      return Returns : Q_String do
         QString_leftJustified_int_QChar_bool (Returns.Object, Self.Object, Width, Fill.Object, Qt_Ada.Internals.Boolean_Conversions.To_unsigned (Trunc));
      end return;
   end Left_Justified;

   ------------
   -- Length --
   ------------

   function Length
    (Self : Q_String'Class)
       return Qt4.Q_Integer
   is
   begin
      return QString_length (Self.Object);
   end Length;

   --------------------------
   -- Locale_Aware_Compare --
   --------------------------

   function Locale_Aware_Compare
    (Self : Q_String'Class;
     S : Q_String'Class)
       return Qt4.Q_Integer
   is
   begin
      return QString_localeAwareCompare_QStringCR (Self.Object, S.Object);
   end Locale_Aware_Compare;

   ---------
   -- Mid --
   ---------

   function Mid
    (Self : Q_String'Class;
     Position : Qt4.Q_Integer;
     N : Qt4.Q_Integer
       := -1)
       return Q_String
   is
   begin
      return Returns : Q_String do
         QString_mid_int_int (Returns.Object, Self.Object, Position, N);
      end return;
   end Mid;

   ----------------
   -- Normalized --
   ----------------

   function Normalized
    (Self : Q_String'Class;
     Mode : Normalization_Form)
       return Q_String
   is
   begin
      return Returns : Q_String do
         QString_normalized_NormalizationForm (Returns.Object, Self.Object, Mode);
      end return;
   end Normalized;

   ----------------
   -- Normalized --
   ----------------

   function Normalized
    (Self : Q_String'Class;
     Mode : Normalization_Form;
     Version : Character_Unicode_Version)
       return Q_String
   is
   begin
      return Returns : Q_String do
         QString_normalized_NormalizationForm_UnicodeVersion (Returns.Object, Self.Object, Mode, Version);
      end return;
   end Normalized;

   -------------
   -- Prepend --
   -------------

   procedure Prepend
    (Self : in out Q_String'Class;
     S : Q_String'Class)
   is
   begin
      QString_prepend_QStringCR (Self.Object, S.Object);
   end Prepend;

   -------------
   -- Prepend --
   -------------

   procedure Prepend
    (Self : in out Q_String'Class;
     C : Q_Char'Class)
   is
   begin
      QString_prepend_QChar (Self.Object, C.Object);
   end Prepend;

   ------------
   -- Remove --
   ------------

   procedure Remove
    (Self : in out Q_String'Class;
     I : Qt4.Q_Integer;
     Len : Qt4.Q_Integer)
   is
   begin
      QString_remove_int_int (Self.Object, I, Len);
   end Remove;

   ------------
   -- Remove --
   ------------

   procedure Remove
    (Self : in out Q_String'Class;
     S : Q_String'Class;
     Cs : Qt4.Case_Sensitivity
       := Case_Sensitive)
   is
   begin
      QString_remove_QStringCR_CaseSensitivity (Self.Object, S.Object, Cs);
   end Remove;

   ------------
   -- Remove --
   ------------

   procedure Remove
    (Self : in out Q_String'Class;
     C : Q_Char'Class;
     Cs : Qt4.Case_Sensitivity
       := Case_Sensitive)
   is
   begin
      QString_remove_QChar_CaseSensitivity (Self.Object, C.Object, Cs);
   end Remove;

   ------------
   -- Remove --
   ------------

   procedure Remove
    (Self : in out Q_String'Class;
     S : Qt4.Reg_Exps.Q_Reg_Exp'Class)
   is
   begin
      QString_remove_QRegExpCR (Self.Object, Qt4.Reg_Exps.Internals.QRegExp_View (S));
   end Remove;

   -------------
   -- Replace --
   -------------

   procedure Replace
    (Self : in out Q_String'Class;
     I : Qt4.Q_Integer;
     Len : Qt4.Q_Integer;
     After : Q_String'Class)
   is
   begin
      QString_replace_int_int_QStringCR (Self.Object, I, Len, After.Object);
   end Replace;

   -------------
   -- Replace --
   -------------

   procedure Replace
    (Self : in out Q_String'Class;
     I : Qt4.Q_Integer;
     Len : Qt4.Q_Integer;
     After : Q_Char'Class)
   is
   begin
      QString_replace_int_int_QChar (Self.Object, I, Len, After.Object);
   end Replace;

   -------------
   -- Replace --
   -------------

   procedure Replace
    (Self : in out Q_String'Class;
     Before : Q_String'Class;
     After : Q_String'Class;
     Cs : Qt4.Case_Sensitivity
       := Case_Sensitive)
   is
   begin
      QString_replace_QStringCR_QStringCR_CaseSensitivity (Self.Object, Before.Object, After.Object, Cs);
   end Replace;

   -------------
   -- Replace --
   -------------

   procedure Replace
    (Self : in out Q_String'Class;
     Ch : Q_Char'Class;
     After : Q_String'Class;
     Cs : Qt4.Case_Sensitivity
       := Case_Sensitive)
   is
   begin
      QString_replace_QChar_QStringCR_CaseSensitivity (Self.Object, Ch.Object, After.Object, Cs);
   end Replace;

   -------------
   -- Replace --
   -------------

   procedure Replace
    (Self : in out Q_String'Class;
     Before : Q_Char'Class;
     After : Q_Char'Class;
     Cs : Qt4.Case_Sensitivity
       := Case_Sensitive)
   is
   begin
      QString_replace_QChar_QChar_CaseSensitivity (Self.Object, Before.Object, After.Object, Cs);
   end Replace;

   -------------
   -- Replace --
   -------------

   procedure Replace
    (Self : in out Q_String'Class;
     Rx : Qt4.Reg_Exps.Q_Reg_Exp'Class;
     After : Q_String'Class)
   is
   begin
      QString_replace_QRegExpCR_QStringCR (Self.Object, Qt4.Reg_Exps.Internals.QRegExp_View (Rx), After.Object);
   end Replace;

   -------------
   -- Reserve --
   -------------

   procedure Reserve
    (Self : in out Q_String'Class;
     Size : Qt4.Q_Integer)
   is
   begin
      QString_reserve_int (Self.Object, Size);
   end Reserve;

   ------------
   -- Resize --
   ------------

   procedure Resize
    (Self : in out Q_String'Class;
     Size : Qt4.Q_Integer)
   is
   begin
      QString_resize_int (Self.Object, Size);
   end Resize;

   -----------
   -- Right --
   -----------

   function Right
    (Self : Q_String'Class;
     N : Qt4.Q_Integer)
       return Q_String
   is
   begin
      return Returns : Q_String do
         QString_right_int (Returns.Object, Self.Object, N);
      end return;
   end Right;

   ---------------------
   -- Right_Justified --
   ---------------------

   function Right_Justified
    (Self : Q_String'Class;
     Width : Qt4.Q_Integer;
     Fill : Q_Char'Class;
     Trunc : Boolean
       := False)
       return Q_String
   is
   begin
      return Returns : Q_String do
         QString_rightJustified_int_QChar_bool (Returns.Object, Self.Object, Width, Fill.Object, Qt_Ada.Internals.Boolean_Conversions.To_unsigned (Trunc));
      end return;
   end Right_Justified;

   ----------------
   -- Simplified --
   ----------------

   function Simplified
    (Self : Q_String'Class)
       return Q_String
   is
   begin
      return Returns : Q_String do
         QString_simplified (Returns.Object, Self.Object);
      end return;
   end Simplified;

   ----------
   -- Size --
   ----------

   function Size
    (Self : Q_String'Class)
       return Qt4.Q_Integer
   is
   begin
      return QString_size (Self.Object);
   end Size;

   -----------
   -- Split --
   -----------

   function Split
    (Self : Q_String'Class;
     Sep : Q_String'Class;
     Behavior : Split_Behavior
       := Keep_Empty_Parts;
     Cs : Qt4.Case_Sensitivity
       := Case_Sensitive)
       return Q_String_List
   is
   begin
      return Returns : Q_String_List do
         QString_split_QStringCR_SplitBehavior_CaseSensitivity (Returns.Object, Self.Object, Sep.Object, Behavior, Cs);
      end return;
   end Split;

   -----------
   -- Split --
   -----------

   function Split
    (Self : Q_String'Class;
     Sep : Q_Char'Class;
     Behavior : Split_Behavior
       := Keep_Empty_Parts;
     Cs : Qt4.Case_Sensitivity
       := Case_Sensitive)
       return Q_String_List
   is
   begin
      return Returns : Q_String_List do
         QString_split_QCharCR_SplitBehavior_CaseSensitivity (Returns.Object, Self.Object, Sep.Object, Behavior, Cs);
      end return;
   end Split;

   -----------
   -- Split --
   -----------

   function Split
    (Self : Q_String'Class;
     Sep : Qt4.Reg_Exps.Q_Reg_Exp'Class;
     Behavior : Split_Behavior
       := Keep_Empty_Parts)
       return Q_String_List
   is
   begin
      return Returns : Q_String_List do
         QString_split_QRegExpCR_SplitBehavior (Returns.Object, Self.Object, Qt4.Reg_Exps.Internals.QRegExp_View (Sep), Behavior);
      end return;
   end Split;

   -------------
   -- Squeeze --
   -------------

   procedure Squeeze
    (Self : in out Q_String'Class)
   is
   begin
      QString_squeeze (Self.Object);
   end Squeeze;

   -----------------
   -- Starts_With --
   -----------------

   function Starts_With
    (Self : Q_String'Class;
     S : Q_String'Class;
     Cs : Qt4.Case_Sensitivity
       := Case_Sensitive)
       return Boolean
   is
   begin
      return Interfaces.C."/=" (QString_startsWith_QStringCR_CaseSensitivity (Self.Object, S.Object, Cs), 0);
   end Starts_With;

   -----------------
   -- Starts_With --
   -----------------

   function Starts_With
    (Self : Q_String'Class;
     S : Q_Char'Class;
     Cs : Qt4.Case_Sensitivity
       := Case_Sensitive)
       return Boolean
   is
   begin
      return Interfaces.C."/=" (QString_startsWith_QCharCR_CaseSensitivity (Self.Object, S.Object, Cs), 0);
   end Starts_With;

   --------------------
   -- To_Case_Folded --
   --------------------

   function To_Case_Folded
    (Self : Q_String'Class)
       return Q_String
   is
   begin
      return Returns : Q_String do
         QString_toCaseFolded (Returns.Object, Self.Object);
      end return;
   end To_Case_Folded;

   ----------------
   -- To_Latin_1 --
   ----------------

   function To_Latin_1
    (Self : Q_String'Class)
       return Qt4.Byte_Arrays.Q_Byte_Array
   is
   begin
      return Returns : Qt4.Byte_Arrays.Q_Byte_Array do
         QString_toLatin1 (Qt4.Byte_Arrays.Internals.QByteArray_View (Returns), Self.Object);
      end return;
   end To_Latin_1;

   --------------------
   -- To_Local_8_Bit --
   --------------------

   function To_Local_8_Bit
    (Self : Q_String'Class)
       return Qt4.Byte_Arrays.Q_Byte_Array
   is
   begin
      return Returns : Qt4.Byte_Arrays.Q_Byte_Array do
         QString_toLocal8Bit (Qt4.Byte_Arrays.Internals.QByteArray_View (Returns), Self.Object);
      end return;
   end To_Local_8_Bit;

   --------------
   -- To_Lower --
   --------------

   function To_Lower
    (Self : Q_String'Class)
       return Q_String
   is
   begin
      return Returns : Q_String do
         QString_toLower (Returns.Object, Self.Object);
      end return;
   end To_Lower;

   --------------
   -- To_Upper --
   --------------

   function To_Upper
    (Self : Q_String'Class)
       return Q_String
   is
   begin
      return Returns : Q_String do
         QString_toUpper (Returns.Object, Self.Object);
      end return;
   end To_Upper;

   --------------
   -- To_Utf_8 --
   --------------

   function To_Utf_8
    (Self : Q_String'Class)
       return Qt4.Byte_Arrays.Q_Byte_Array
   is
   begin
      return Returns : Qt4.Byte_Arrays.Q_Byte_Array do
         QString_toUtf8 (Qt4.Byte_Arrays.Internals.QByteArray_View (Returns), Self.Object);
      end return;
   end To_Utf_8;

   -------------
   -- Trimmed --
   -------------

   function Trimmed
    (Self : Q_String'Class)
       return Q_String
   is
   begin
      return Returns : Q_String do
         QString_trimmed (Returns.Object, Self.Object);
      end return;
   end Trimmed;

   --------------
   -- Truncate --
   --------------

   procedure Truncate
    (Self : in out Q_String'Class;
     Size : Qt4.Q_Integer)
   is
   begin
      QString_truncate_int (Self.Object, Size);
   end Truncate;

   ---------
   -- "=" --
   ---------

   function "="
    (Self : Q_String;
     S : Q_String)
       return Boolean
   is
   begin
      return Interfaces.C."/=" (eq_QStringCR (Self.Object, S.Object), 0);
   end "=";

   ---------
   -- "<" --
   ---------

   function "<"
    (Self : Q_String;
     S : Q_String)
       return Boolean
   is
   begin
      return Interfaces.C."/=" (lt_QStringCR (Self.Object, S.Object), 0);
   end "<";

   ---------
   -- ">" --
   ---------

   function ">"
    (Self : Q_String;
     S : Q_String)
       return Boolean
   is
   begin
      return Interfaces.C."/=" (gt_QStringCR (Self.Object, S.Object), 0);
   end ">";

   ----------
   -- "<=" --
   ----------

   function "<="
    (Self : Q_String;
     S : Q_String)
       return Boolean
   is
   begin
      return Interfaces.C."/=" (le_QStringCR (Self.Object, S.Object), 0);
   end "<=";

   ----------
   -- ">=" --
   ----------

   function ">="
    (Self : Q_String;
     S : Q_String)
       return Boolean
   is
   begin
      return Interfaces.C."/=" (ge_QStringCR (Self.Object, S.Object), 0);
   end ">=";

   ----------------
   -- From_Utf_8 --
   ----------------

   function From_Utf_8
    (Str : String)
       return Q_String
   is
   begin
      return Returns : Q_String do
         QString_fromUtf8 (Returns.Object, Interfaces.C.To_C (Str));
      end return;
   end From_Utf_8;

   -----------------
   -- From_Utf_16 --
   -----------------

   function From_Utf_16
    (Str : Wide_String)
       return Q_String
   is
      Aux : unsigned_short_Array (Str'First .. Str'Last + 1);

   begin
      for J in Str'Range loop
         Aux (J) := Wide_Character'Pos (Str (J));
      end loop;

      Aux (Aux'Last) := 0;

      return Returns : Q_String do
         QString_fromUtf16 (Returns.Object, Aux);
      end return;
   end From_Utf_16;

   ----------------
   -- From_Ucs_4 --
   ----------------

   function From_Ucs_4
    (Str : Wide_Wide_String)
       return Q_String
   is
      Aux : unsigned_Array (Str'First .. Str'Last + 1);

   begin
      for J in Str'Range loop
         Aux (J) := Wide_Wide_Character'Pos (Str (J));
      end loop;

      Aux (Aux'Last) := 0;

      return Returns : Q_String do
         QString_fromUcs4 (Returns.Object, Aux);
      end return;
   end From_Ucs_4;

   ----------------------
   -- From_Local_8_Bit --
   ----------------------

   function From_Local_8_Bit
    (Str : String)
       return Q_String
   is
   begin
      return Returns : Q_String do
         QString_fromLocal8Bit (Returns.Object, Interfaces.C.To_C (Str));
      end return;
   end From_Local_8_Bit;

   --------------
   -- To_Utf_8 --
   --------------

   function To_Utf_8
    (Self : Q_String'Class)
       return String
   is
      Aux : Interfaces.C.char_array
             (1 .. Interfaces.C.size_t (Self.Size * 6 + 1));
      pragma Warnings (Off, Aux);

   begin
      QString_toUtf8_1 (Aux, Self.Object);

      return Interfaces.C.To_Ada (Aux);
   end To_Utf_8;

   ---------------
   -- To_Utf_16 --
   ---------------

   function To_Utf_16
    (Self : Q_String'Class)
       return Wide_String
   is
      Aux     : unsigned_short_array (1 .. Integer (Self.Size) + 1);
      pragma Warnings (Off, Aux);
      Returns : Wide_String (1 .. Integer (Self.Size));

   begin
      QString_utf16 (Aux, Self.Object);

      for J in Returns'Range loop
         Returns (J) := Wide_Character'Val (Aux (J));
      end loop;

      return Returns;
   end To_Utf_16;

   --------------
   -- To_Ucs_4 --
   --------------

   function To_Ucs_4
    (Self : Q_String'Class)
       return Wide_Wide_String
   is
      use type Interfaces.C.unsigned;

      Aux     : unsigned_Array (1 .. Integer (Self.Size) + 1);
      pragma Warnings (Off, Aux);
      Returns : Wide_Wide_String (1 .. Integer (Self.Size));
      Last    : Natural := 0;

   begin
      QString_toUcs4 (Aux, Self.Object);

      for J in Returns'Range loop
         exit when Aux (J) = 0;

         Returns (J) := Wide_Wide_Character'Val (Aux (J));
         Last := J;
      end loop;

      return Returns (Returns'First .. Last);
   end To_Ucs_4;

   --------------------
   -- To_Local_8_Bit --
   --------------------

   function To_Local_8_Bit
    (Self : Q_String'Class)
       return String
   is
      Aux : Interfaces.C.char_array
             (1 .. Interfaces.C.size_t (Self.Size * 6 + 1));
      pragma Warnings (Off, Aux);

   begin
      QString_toLocal8Bit_1 (Aux, Self.Object);

      return Interfaces.C.To_Ada (Aux);
   end To_Local_8_Bit;

   ---------
   -- "&" --
   ---------

   function "&"
    (Left : Q_String'Class;
     Right : Q_String'Class)
       return Q_String
   is
   begin
      return Returns : Q_String do
         plus_QStringCR_QStringCR (Returns.Object, Left.Object, Right.Object);
      end return;
   end "&";

   ---------------
   -- Internals --
   ---------------

   package body Internals is

      package QChar_Conversions is
        new System.Address_To_Access_Conversions
             (QChar);

      package QStringList_Conversions is
        new System.Address_To_Access_Conversions
             (QStringList);

      package QString_Conversions is
        new System.Address_To_Access_Conversions
             (QString);

      ----------------
      -- QChar_View --
      ----------------

      function QChar_View
       (Item : Q_Char'Class)
          return QChar_Access
      is
      begin
         return Item.Object;
      end QChar_View;

      ----------------
      -- To_Pointer --
      ----------------

      function To_Pointer
       (Address : System.Address)
          return QChar_Access
      is
      begin
         return
           QChar_Access
            (QChar_Conversions.To_Pointer
            (Address));
      end To_Pointer;

      ----------------
      -- To_Address --
      ----------------

      function To_Address
       (Pointer : QChar_Access)
          return System.Address
      is
      begin
         return
           QChar_Conversions.To_Address
            (QChar_Conversions.Object_Pointer
              (Pointer));
      end To_Address;

      --------------------
      -- Create_Wrapper --
      --------------------

      function Create_Wrapper
       (Item : Internals.QChar_Access)
          return Q_Char
      is
      begin
         return Q_Char'
          (Ada.Finalization.Controlled with
             Object  => Item,
             Wrapper => True,
             others  => <>);
      end Create_Wrapper;

      ----------------------
      -- QStringList_View --
      ----------------------

      function QStringList_View
       (Item : Q_String_List'Class)
          return QStringList_Access
      is
      begin
         return Item.Object;
      end QStringList_View;

      ----------------
      -- To_Pointer --
      ----------------

      function To_Pointer
       (Address : System.Address)
          return QStringList_Access
      is
      begin
         return
           QStringList_Access
            (QStringList_Conversions.To_Pointer
            (Address));
      end To_Pointer;

      ----------------
      -- To_Address --
      ----------------

      function To_Address
       (Pointer : QStringList_Access)
          return System.Address
      is
      begin
         return
           QStringList_Conversions.To_Address
            (QStringList_Conversions.Object_Pointer
              (Pointer));
      end To_Address;

      --------------------
      -- Create_Wrapper --
      --------------------

      function Create_Wrapper
       (Item : Internals.QStringList_Access)
          return Q_String_List
      is
      begin
         return Q_String_List'
          (Ada.Finalization.Controlled with
             Object  => Item,
             Wrapper => True,
             others  => <>);
      end Create_Wrapper;

      ------------------
      -- QString_View --
      ------------------

      function QString_View
       (Item : Q_String'Class)
          return QString_Access
      is
      begin
         return Item.Object;
      end QString_View;

      ----------------
      -- To_Pointer --
      ----------------

      function To_Pointer
       (Address : System.Address)
          return QString_Access
      is
      begin
         return
           QString_Access
            (QString_Conversions.To_Pointer
            (Address));
      end To_Pointer;

      ----------------
      -- To_Address --
      ----------------

      function To_Address
       (Pointer : QString_Access)
          return System.Address
      is
      begin
         return
           QString_Conversions.To_Address
            (QString_Conversions.Object_Pointer
              (Pointer));
      end To_Address;

      --------------------
      -- Create_Wrapper --
      --------------------

      function Create_Wrapper
       (Item : Internals.QString_Access)
          return Q_String
      is
      begin
         return Q_String'
          (Ada.Finalization.Controlled with
             Object  => Item,
             Wrapper => True,
             others  => <>);
      end Create_Wrapper;

   end Internals;

end Qt4.Strings;
