------------------------------------------------------------------------------
--                                                                          --
--                An Ada2005 binding to the Qt C++ framework                --
--                                                                          --
------------------------------------------------------------------------------
--                                                                          --
-- Copyright © 2009-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.                                      --
--                                                                          --
------------------------------------------------------------------------------
--    This file has been generated automatically. Please don't edit it.     --
------------------------------------------------------------------------------
with Qt_Ada.Internals.Boolean_Conversions;
with System.Address_To_Access_Conversions;

package body Qt4.Text_Formats is

   function initialize_QTextBlockFormat
    (Storage : System.Address)
      return Internals.QTextFormat_Access;
   pragma Import (C, initialize_QTextBlockFormat, "__QtAda_inititialize_QTextBlockFormat");

   function adjust_QTextBlockFormat
    (Storage : System.Address;
     From    : Internals.QTextFormat_Access)
       return Internals.QTextFormat_Access;
   pragma Import (C, adjust_QTextBlockFormat, "__QtAda_adjust_QTextBlockFormat");

   procedure finalize_QTextBlockFormat (Object : Internals.QTextFormat_Access);
   pragma Import (C, finalize_QTextBlockFormat, "__QtAda_finalize_QTextBlockFormat");

   function QTextBlockFormat_bottomMargin
    (Self : Internals.QTextFormat_Access)
       return Qt4.Q_Real;
   pragma Import (C, QTextBlockFormat_bottomMargin, "__QtAda_QTextBlockFormat_bottomMargin_Q");

   function QTextBlockFormat_indent
    (Self : Internals.QTextFormat_Access)
       return Qt4.Q_Integer;
   pragma Import (C, QTextBlockFormat_indent, "__QtAda_QTextBlockFormat_indent_Q");

   function QTextBlockFormat_isValid
    (Self : Internals.QTextFormat_Access)
       return Interfaces.C.unsigned;
   pragma Import (C, QTextBlockFormat_isValid, "__QtAda_QTextBlockFormat_isValid_Q");

   function QTextBlockFormat_leftMargin
    (Self : Internals.QTextFormat_Access)
       return Qt4.Q_Real;
   pragma Import (C, QTextBlockFormat_leftMargin, "__QtAda_QTextBlockFormat_leftMargin_Q");

   function QTextBlockFormat_nonBreakableLines
    (Self : Internals.QTextFormat_Access)
       return Interfaces.C.unsigned;
   pragma Import (C, QTextBlockFormat_nonBreakableLines, "__QtAda_QTextBlockFormat_nonBreakableLines_Q");

   function QTextBlockFormat_rightMargin
    (Self : Internals.QTextFormat_Access)
       return Qt4.Q_Real;
   pragma Import (C, QTextBlockFormat_rightMargin, "__QtAda_QTextBlockFormat_rightMargin_Q");

   procedure QTextBlockFormat_setBottomMargin_qreal
    (Self : Internals.QTextFormat_Access;
     Margin : Qt4.Q_Real);
   pragma Import (C, QTextBlockFormat_setBottomMargin_qreal, "__QtAda_QTextBlockFormat_setBottomMargin_qreal");

   procedure QTextBlockFormat_setIndent_int
    (Self : Internals.QTextFormat_Access;
     Indent : Qt4.Q_Integer);
   pragma Import (C, QTextBlockFormat_setIndent_int, "__QtAda_QTextBlockFormat_setIndent_int");

   procedure QTextBlockFormat_setLeftMargin_qreal
    (Self : Internals.QTextFormat_Access;
     Margin : Qt4.Q_Real);
   pragma Import (C, QTextBlockFormat_setLeftMargin_qreal, "__QtAda_QTextBlockFormat_setLeftMargin_qreal");

   procedure QTextBlockFormat_setNonBreakableLines_bool
    (Self : Internals.QTextFormat_Access;
     B : Interfaces.C.unsigned);
   pragma Import (C, QTextBlockFormat_setNonBreakableLines_bool, "__QtAda_QTextBlockFormat_setNonBreakableLines_bool");

   procedure QTextBlockFormat_setRightMargin_qreal
    (Self : Internals.QTextFormat_Access;
     Margin : Qt4.Q_Real);
   pragma Import (C, QTextBlockFormat_setRightMargin_qreal, "__QtAda_QTextBlockFormat_setRightMargin_qreal");

   procedure QTextBlockFormat_setTextIndent_qreal
    (Self : Internals.QTextFormat_Access;
     Indent : Qt4.Q_Real);
   pragma Import (C, QTextBlockFormat_setTextIndent_qreal, "__QtAda_QTextBlockFormat_setTextIndent_qreal");

   procedure QTextBlockFormat_setTopMargin_qreal
    (Self : Internals.QTextFormat_Access;
     Margin : Qt4.Q_Real);
   pragma Import (C, QTextBlockFormat_setTopMargin_qreal, "__QtAda_QTextBlockFormat_setTopMargin_qreal");

   function QTextBlockFormat_textIndent
    (Self : Internals.QTextFormat_Access)
       return Qt4.Q_Real;
   pragma Import (C, QTextBlockFormat_textIndent, "__QtAda_QTextBlockFormat_textIndent_Q");

   function QTextBlockFormat_topMargin
    (Self : Internals.QTextFormat_Access)
       return Qt4.Q_Real;
   pragma Import (C, QTextBlockFormat_topMargin, "__QtAda_QTextBlockFormat_topMargin_Q");

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

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

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

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

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

   overriding
   procedure Initialize (Self : in out Q_Text_Block_Format) is
      use type Internals.QTextFormat_Access;

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

   -------------------
   -- Bottom_Margin --
   -------------------

   function Bottom_Margin
    (Self : Q_Text_Block_Format'Class)
       return Qt4.Q_Real
   is
   begin
      return QTextBlockFormat_bottomMargin (Self.Object);
   end Bottom_Margin;

   ------------
   -- Indent --
   ------------

   function Indent
    (Self : Q_Text_Block_Format'Class)
       return Qt4.Q_Integer
   is
   begin
      return QTextBlockFormat_indent (Self.Object);
   end Indent;

   --------------
   -- Is_Valid --
   --------------

   function Is_Valid
    (Self : Q_Text_Block_Format'Class)
       return Boolean
   is
   begin
      return Interfaces.C."/=" (QTextBlockFormat_isValid (Self.Object), 0);
   end Is_Valid;

   -----------------
   -- Left_Margin --
   -----------------

   function Left_Margin
    (Self : Q_Text_Block_Format'Class)
       return Qt4.Q_Real
   is
   begin
      return QTextBlockFormat_leftMargin (Self.Object);
   end Left_Margin;

   -------------------------
   -- Non_Breakable_Lines --
   -------------------------

   function Non_Breakable_Lines
    (Self : Q_Text_Block_Format'Class)
       return Boolean
   is
   begin
      return Interfaces.C."/=" (QTextBlockFormat_nonBreakableLines (Self.Object), 0);
   end Non_Breakable_Lines;

   ------------------
   -- Right_Margin --
   ------------------

   function Right_Margin
    (Self : Q_Text_Block_Format'Class)
       return Qt4.Q_Real
   is
   begin
      return QTextBlockFormat_rightMargin (Self.Object);
   end Right_Margin;

   -----------------------
   -- Set_Bottom_Margin --
   -----------------------

   procedure Set_Bottom_Margin
    (Self : in out Q_Text_Block_Format'Class;
     Margin : Qt4.Q_Real)
   is
   begin
      QTextBlockFormat_setBottomMargin_qreal (Self.Object, Margin);
   end Set_Bottom_Margin;

   ----------------
   -- Set_Indent --
   ----------------

   procedure Set_Indent
    (Self : in out Q_Text_Block_Format'Class;
     Indent : Qt4.Q_Integer)
   is
   begin
      QTextBlockFormat_setIndent_int (Self.Object, Indent);
   end Set_Indent;

   ---------------------
   -- Set_Left_Margin --
   ---------------------

   procedure Set_Left_Margin
    (Self : in out Q_Text_Block_Format'Class;
     Margin : Qt4.Q_Real)
   is
   begin
      QTextBlockFormat_setLeftMargin_qreal (Self.Object, Margin);
   end Set_Left_Margin;

   -----------------------------
   -- Set_Non_Breakable_Lines --
   -----------------------------

   procedure Set_Non_Breakable_Lines
    (Self : in out Q_Text_Block_Format'Class;
     B : Boolean)
   is
   begin
      QTextBlockFormat_setNonBreakableLines_bool (Self.Object, Qt_Ada.Internals.Boolean_Conversions.To_unsigned (B));
   end Set_Non_Breakable_Lines;

   ----------------------
   -- Set_Right_Margin --
   ----------------------

   procedure Set_Right_Margin
    (Self : in out Q_Text_Block_Format'Class;
     Margin : Qt4.Q_Real)
   is
   begin
      QTextBlockFormat_setRightMargin_qreal (Self.Object, Margin);
   end Set_Right_Margin;

   ---------------------
   -- Set_Text_Indent --
   ---------------------

   procedure Set_Text_Indent
    (Self : in out Q_Text_Block_Format'Class;
     Indent : Qt4.Q_Real)
   is
   begin
      QTextBlockFormat_setTextIndent_qreal (Self.Object, Indent);
   end Set_Text_Indent;

   --------------------
   -- Set_Top_Margin --
   --------------------

   procedure Set_Top_Margin
    (Self : in out Q_Text_Block_Format'Class;
     Margin : Qt4.Q_Real)
   is
   begin
      QTextBlockFormat_setTopMargin_qreal (Self.Object, Margin);
   end Set_Top_Margin;

   -----------------
   -- Text_Indent --
   -----------------

   function Text_Indent
    (Self : Q_Text_Block_Format'Class)
       return Qt4.Q_Real
   is
   begin
      return QTextBlockFormat_textIndent (Self.Object);
   end Text_Indent;

   ----------------
   -- Top_Margin --
   ----------------

   function Top_Margin
    (Self : Q_Text_Block_Format'Class)
       return Qt4.Q_Real
   is
   begin
      return QTextBlockFormat_topMargin (Self.Object);
   end Top_Margin;

   function initialize_QTextCharFormat
    (Storage : System.Address)
      return Internals.QTextFormat_Access;
   pragma Import (C, initialize_QTextCharFormat, "__QtAda_inititialize_QTextCharFormat");

   function adjust_QTextCharFormat
    (Storage : System.Address;
     From    : Internals.QTextFormat_Access)
       return Internals.QTextFormat_Access;
   pragma Import (C, adjust_QTextCharFormat, "__QtAda_adjust_QTextCharFormat");

   procedure finalize_QTextCharFormat (Object : Internals.QTextFormat_Access);
   pragma Import (C, finalize_QTextCharFormat, "__QtAda_finalize_QTextCharFormat");

   procedure QTextCharFormat_anchorHref
    (Returns : Qt4.Strings.Internals.QString_Access;
     Self : Internals.QTextFormat_Access);
   pragma Import (C, QTextCharFormat_anchorHref, "__QtAda_QTextCharFormat_anchorHref_Q");

   procedure QTextCharFormat_anchorNames
    (Returns : Qt4.String_Lists.Internals.QStringList_Access;
     Self : Internals.QTextFormat_Access);
   pragma Import (C, QTextCharFormat_anchorNames, "__QtAda_QTextCharFormat_anchorNames_Q");

   procedure QTextCharFormat_font
    (Returns : Qt4.Fonts.Internals.QFont_Access;
     Self : Internals.QTextFormat_Access);
   pragma Import (C, QTextCharFormat_font, "__QtAda_QTextCharFormat_font_Q");

   function QTextCharFormat_fontCapitalization
    (Self : Internals.QTextFormat_Access)
       return Qt4.Fonts.Capitalization;
   pragma Import (C, QTextCharFormat_fontCapitalization, "__QtAda_QTextCharFormat_fontCapitalization_Q");

   procedure QTextCharFormat_fontFamily
    (Returns : Qt4.Strings.Internals.QString_Access;
     Self : Internals.QTextFormat_Access);
   pragma Import (C, QTextCharFormat_fontFamily, "__QtAda_QTextCharFormat_fontFamily_Q");

   function QTextCharFormat_fontFixedPitch
    (Self : Internals.QTextFormat_Access)
       return Interfaces.C.unsigned;
   pragma Import (C, QTextCharFormat_fontFixedPitch, "__QtAda_QTextCharFormat_fontFixedPitch_Q");

   function QTextCharFormat_fontItalic
    (Self : Internals.QTextFormat_Access)
       return Interfaces.C.unsigned;
   pragma Import (C, QTextCharFormat_fontItalic, "__QtAda_QTextCharFormat_fontItalic_Q");

   function QTextCharFormat_fontLetterSpacing
    (Self : Internals.QTextFormat_Access)
       return Qt4.Q_Real;
   pragma Import (C, QTextCharFormat_fontLetterSpacing, "__QtAda_QTextCharFormat_fontLetterSpacing_Q");

   function QTextCharFormat_fontOverline
    (Self : Internals.QTextFormat_Access)
       return Interfaces.C.unsigned;
   pragma Import (C, QTextCharFormat_fontOverline, "__QtAda_QTextCharFormat_fontOverline_Q");

   function QTextCharFormat_fontPointSize
    (Self : Internals.QTextFormat_Access)
       return Qt4.Q_Real;
   pragma Import (C, QTextCharFormat_fontPointSize, "__QtAda_QTextCharFormat_fontPointSize_Q");

   function QTextCharFormat_fontStrikeOut
    (Self : Internals.QTextFormat_Access)
       return Interfaces.C.unsigned;
   pragma Import (C, QTextCharFormat_fontStrikeOut, "__QtAda_QTextCharFormat_fontStrikeOut_Q");

   function QTextCharFormat_fontUnderline
    (Self : Internals.QTextFormat_Access)
       return Interfaces.C.unsigned;
   pragma Import (C, QTextCharFormat_fontUnderline, "__QtAda_QTextCharFormat_fontUnderline_Q");

   function QTextCharFormat_fontWeight
    (Self : Internals.QTextFormat_Access)
       return Qt4.Fonts.Font_Weight;
   pragma Import (C, QTextCharFormat_fontWeight, "__QtAda_QTextCharFormat_fontWeight_Q");

   function QTextCharFormat_fontWordSpacing
    (Self : Internals.QTextFormat_Access)
       return Qt4.Q_Real;
   pragma Import (C, QTextCharFormat_fontWordSpacing, "__QtAda_QTextCharFormat_fontWordSpacing_Q");

   function QTextCharFormat_isAnchor
    (Self : Internals.QTextFormat_Access)
       return Interfaces.C.unsigned;
   pragma Import (C, QTextCharFormat_isAnchor, "__QtAda_QTextCharFormat_isAnchor_Q");

   function QTextCharFormat_isValid
    (Self : Internals.QTextFormat_Access)
       return Interfaces.C.unsigned;
   pragma Import (C, QTextCharFormat_isValid, "__QtAda_QTextCharFormat_isValid_Q");

   procedure QTextCharFormat_setAnchor_bool
    (Self : Internals.QTextFormat_Access;
     Anchor : Interfaces.C.unsigned);
   pragma Import (C, QTextCharFormat_setAnchor_bool, "__QtAda_QTextCharFormat_setAnchor_bool");

   procedure QTextCharFormat_setAnchorHref_QStringCR
    (Self : Internals.QTextFormat_Access;
     Anchor : Qt4.Strings.Internals.QString_Access);
   pragma Import (C, QTextCharFormat_setAnchorHref_QStringCR, "__QtAda_QTextCharFormat_setAnchorHref_QStringCR");

   procedure QTextCharFormat_setAnchorNames_QStringListCR
    (Self : Internals.QTextFormat_Access;
     Names : Qt4.String_Lists.Internals.QStringList_Access);
   pragma Import (C, QTextCharFormat_setAnchorNames_QStringListCR, "__QtAda_QTextCharFormat_setAnchorNames_QStringListCR");

   procedure QTextCharFormat_setFont_QFontCR
    (Self : Internals.QTextFormat_Access;
     Font : Qt4.Fonts.Internals.QFont_Access);
   pragma Import (C, QTextCharFormat_setFont_QFontCR, "__QtAda_QTextCharFormat_setFont_QFontCR");

   procedure QTextCharFormat_setFontCapitalization_Capitalization
    (Self : Internals.QTextFormat_Access;
     Capitalization : Qt4.Fonts.Capitalization);
   pragma Import (C, QTextCharFormat_setFontCapitalization_Capitalization, "__QtAda_QTextCharFormat_setFontCapitalization_Capitalization");

   procedure QTextCharFormat_setFontFamily_QStringCR
    (Self : Internals.QTextFormat_Access;
     Anchor : Qt4.Strings.Internals.QString_Access);
   pragma Import (C, QTextCharFormat_setFontFamily_QStringCR, "__QtAda_QTextCharFormat_setFontFamily_QStringCR");

   procedure QTextCharFormat_setFontFixedPitch_bool
    (Self : Internals.QTextFormat_Access;
     Fixed_Pitch : Interfaces.C.unsigned);
   pragma Import (C, QTextCharFormat_setFontFixedPitch_bool, "__QtAda_QTextCharFormat_setFontFixedPitch_bool");

   procedure QTextCharFormat_setFontItalic_bool
    (Self : Internals.QTextFormat_Access;
     Italic : Interfaces.C.unsigned);
   pragma Import (C, QTextCharFormat_setFontItalic_bool, "__QtAda_QTextCharFormat_setFontItalic_bool");

   procedure QTextCharFormat_setFontLetterSpacing_qreal
    (Self : Internals.QTextFormat_Access;
     Spacing : Qt4.Q_Real);
   pragma Import (C, QTextCharFormat_setFontLetterSpacing_qreal, "__QtAda_QTextCharFormat_setFontLetterSpacing_qreal");

   procedure QTextCharFormat_setFontOverline_bool
    (Self : Internals.QTextFormat_Access;
     Overline : Interfaces.C.unsigned);
   pragma Import (C, QTextCharFormat_setFontOverline_bool, "__QtAda_QTextCharFormat_setFontOverline_bool");

   procedure QTextCharFormat_setFontPointSize_qreal
    (Self : Internals.QTextFormat_Access;
     Size : Qt4.Q_Real);
   pragma Import (C, QTextCharFormat_setFontPointSize_qreal, "__QtAda_QTextCharFormat_setFontPointSize_qreal");

   procedure QTextCharFormat_setFontStrikeOut_bool
    (Self : Internals.QTextFormat_Access;
     Strike_Out : Interfaces.C.unsigned);
   pragma Import (C, QTextCharFormat_setFontStrikeOut_bool, "__QtAda_QTextCharFormat_setFontStrikeOut_bool");

   procedure QTextCharFormat_setFontUnderline_bool
    (Self : Internals.QTextFormat_Access;
     Underline : Interfaces.C.unsigned);
   pragma Import (C, QTextCharFormat_setFontUnderline_bool, "__QtAda_QTextCharFormat_setFontUnderline_bool");

   procedure QTextCharFormat_setFontWeight_int
    (Self : Internals.QTextFormat_Access;
     Weight : Qt4.Fonts.Font_Weight);
   pragma Import (C, QTextCharFormat_setFontWeight_int, "__QtAda_QTextCharFormat_setFontWeight_int");

   procedure QTextCharFormat_setFontWordSpacing_qreal
    (Self : Internals.QTextFormat_Access;
     Spacing : Qt4.Q_Real);
   pragma Import (C, QTextCharFormat_setFontWordSpacing_qreal, "__QtAda_QTextCharFormat_setFontWordSpacing_qreal");

   procedure QTextCharFormat_setTextOutline_QPenCR
    (Self : Internals.QTextFormat_Access;
     Pen : Qt4.Pens.Internals.QPen_Access);
   pragma Import (C, QTextCharFormat_setTextOutline_QPenCR, "__QtAda_QTextCharFormat_setTextOutline_QPenCR");

   procedure QTextCharFormat_setToolTip_QStringCR
    (Self : Internals.QTextFormat_Access;
     Tip : Qt4.Strings.Internals.QString_Access);
   pragma Import (C, QTextCharFormat_setToolTip_QStringCR, "__QtAda_QTextCharFormat_setToolTip_QStringCR");

   procedure QTextCharFormat_setUnderlineColor_QColorCR
    (Self : Internals.QTextFormat_Access;
     Color : Qt4.Colors.Internals.QColor_Access);
   pragma Import (C, QTextCharFormat_setUnderlineColor_QColorCR, "__QtAda_QTextCharFormat_setUnderlineColor_QColorCR");

   procedure QTextCharFormat_setUnderlineStyle_UnderlineStyle
    (Self : Internals.QTextFormat_Access;
     Style : Text_Char_Underline_Style);
   pragma Import (C, QTextCharFormat_setUnderlineStyle_UnderlineStyle, "__QtAda_QTextCharFormat_setUnderlineStyle_UnderlineStyle");

   procedure QTextCharFormat_setVerticalAlignment_VerticalAlignment
    (Self : Internals.QTextFormat_Access;
     Alignment : Text_Char_Vertical_Alignment);
   pragma Import (C, QTextCharFormat_setVerticalAlignment_VerticalAlignment, "__QtAda_QTextCharFormat_setVerticalAlignment_VerticalAlignment");

   procedure QTextCharFormat_textOutline
    (Returns : Qt4.Pens.Internals.QPen_Access;
     Self : Internals.QTextFormat_Access);
   pragma Import (C, QTextCharFormat_textOutline, "__QtAda_QTextCharFormat_textOutline_Q");

   procedure QTextCharFormat_toolTip
    (Returns : Qt4.Strings.Internals.QString_Access;
     Self : Internals.QTextFormat_Access);
   pragma Import (C, QTextCharFormat_toolTip, "__QtAda_QTextCharFormat_toolTip_Q");

   procedure QTextCharFormat_underlineColor
    (Returns : Qt4.Colors.Internals.QColor_Access;
     Self : Internals.QTextFormat_Access);
   pragma Import (C, QTextCharFormat_underlineColor, "__QtAda_QTextCharFormat_underlineColor_Q");

   function QTextCharFormat_underlineStyle
    (Self : Internals.QTextFormat_Access)
       return Text_Char_Underline_Style;
   pragma Import (C, QTextCharFormat_underlineStyle, "__QtAda_QTextCharFormat_underlineStyle_Q");

   function QTextCharFormat_verticalAlignment
    (Self : Internals.QTextFormat_Access)
       return Text_Char_Vertical_Alignment;
   pragma Import (C, QTextCharFormat_verticalAlignment, "__QtAda_QTextCharFormat_verticalAlignment_Q");

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

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

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

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

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

   overriding
   procedure Initialize (Self : in out Q_Text_Char_Format) is
      use type Internals.QTextFormat_Access;

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

   -----------------
   -- Anchor_Href --
   -----------------

   function Anchor_Href
    (Self : Q_Text_Char_Format'Class)
       return Qt4.Strings.Q_String
   is
   begin
      return Returns : Qt4.Strings.Q_String do
         QTextCharFormat_anchorHref (Qt4.Strings.Internals.QString_View (Returns), Self.Object);
      end return;
   end Anchor_Href;

   ------------------
   -- Anchor_Names --
   ------------------

   function Anchor_Names
    (Self : Q_Text_Char_Format'Class)
       return Qt4.String_Lists.Q_String_List
   is
   begin
      return Returns : Qt4.String_Lists.Q_String_List do
         QTextCharFormat_anchorNames (Qt4.String_Lists.Internals.QStringList_View (Returns), Self.Object);
      end return;
   end Anchor_Names;

   ----------
   -- Font --
   ----------

   function Font
    (Self : Q_Text_Char_Format'Class)
       return Qt4.Fonts.Q_Font
   is
   begin
      return Returns : Qt4.Fonts.Q_Font do
         QTextCharFormat_font (Qt4.Fonts.Internals.QFont_View (Returns), Self.Object);
      end return;
   end Font;

   -------------------------
   -- Font_Capitalization --
   -------------------------

   function Font_Capitalization
    (Self : Q_Text_Char_Format'Class)
       return Qt4.Fonts.Capitalization
   is
   begin
      return QTextCharFormat_fontCapitalization (Self.Object);
   end Font_Capitalization;

   -----------------
   -- Font_Family --
   -----------------

   function Font_Family
    (Self : Q_Text_Char_Format'Class)
       return Qt4.Strings.Q_String
   is
   begin
      return Returns : Qt4.Strings.Q_String do
         QTextCharFormat_fontFamily (Qt4.Strings.Internals.QString_View (Returns), Self.Object);
      end return;
   end Font_Family;

   ----------------------
   -- Font_Fixed_Pitch --
   ----------------------

   function Font_Fixed_Pitch
    (Self : Q_Text_Char_Format'Class)
       return Boolean
   is
   begin
      return Interfaces.C."/=" (QTextCharFormat_fontFixedPitch (Self.Object), 0);
   end Font_Fixed_Pitch;

   -----------------
   -- Font_Italic --
   -----------------

   function Font_Italic
    (Self : Q_Text_Char_Format'Class)
       return Boolean
   is
   begin
      return Interfaces.C."/=" (QTextCharFormat_fontItalic (Self.Object), 0);
   end Font_Italic;

   -------------------------
   -- Font_Letter_Spacing --
   -------------------------

   function Font_Letter_Spacing
    (Self : Q_Text_Char_Format'Class)
       return Qt4.Q_Real
   is
   begin
      return QTextCharFormat_fontLetterSpacing (Self.Object);
   end Font_Letter_Spacing;

   -------------------
   -- Font_Overline --
   -------------------

   function Font_Overline
    (Self : Q_Text_Char_Format'Class)
       return Boolean
   is
   begin
      return Interfaces.C."/=" (QTextCharFormat_fontOverline (Self.Object), 0);
   end Font_Overline;

   ---------------------
   -- Font_Point_Size --
   ---------------------

   function Font_Point_Size
    (Self : Q_Text_Char_Format'Class)
       return Qt4.Q_Real
   is
   begin
      return QTextCharFormat_fontPointSize (Self.Object);
   end Font_Point_Size;

   ---------------------
   -- Font_Strike_Out --
   ---------------------

   function Font_Strike_Out
    (Self : Q_Text_Char_Format'Class)
       return Boolean
   is
   begin
      return Interfaces.C."/=" (QTextCharFormat_fontStrikeOut (Self.Object), 0);
   end Font_Strike_Out;

   --------------------
   -- Font_Underline --
   --------------------

   function Font_Underline
    (Self : Q_Text_Char_Format'Class)
       return Boolean
   is
   begin
      return Interfaces.C."/=" (QTextCharFormat_fontUnderline (Self.Object), 0);
   end Font_Underline;

   -----------------
   -- Font_Weight --
   -----------------

   function Font_Weight
    (Self : Q_Text_Char_Format'Class)
       return Qt4.Fonts.Font_Weight
   is
   begin
      return QTextCharFormat_fontWeight (Self.Object);
   end Font_Weight;

   -----------------------
   -- Font_Word_Spacing --
   -----------------------

   function Font_Word_Spacing
    (Self : Q_Text_Char_Format'Class)
       return Qt4.Q_Real
   is
   begin
      return QTextCharFormat_fontWordSpacing (Self.Object);
   end Font_Word_Spacing;

   ---------------
   -- Is_Anchor --
   ---------------

   function Is_Anchor
    (Self : Q_Text_Char_Format'Class)
       return Boolean
   is
   begin
      return Interfaces.C."/=" (QTextCharFormat_isAnchor (Self.Object), 0);
   end Is_Anchor;

   --------------
   -- Is_Valid --
   --------------

   function Is_Valid
    (Self : Q_Text_Char_Format'Class)
       return Boolean
   is
   begin
      return Interfaces.C."/=" (QTextCharFormat_isValid (Self.Object), 0);
   end Is_Valid;

   ----------------
   -- Set_Anchor --
   ----------------

   procedure Set_Anchor
    (Self : in out Q_Text_Char_Format'Class;
     Anchor : Boolean)
   is
   begin
      QTextCharFormat_setAnchor_bool (Self.Object, Qt_Ada.Internals.Boolean_Conversions.To_unsigned (Anchor));
   end Set_Anchor;

   ---------------------
   -- Set_Anchor_Href --
   ---------------------

   procedure Set_Anchor_Href
    (Self : in out Q_Text_Char_Format'Class;
     Anchor : Qt4.Strings.Q_String'Class)
   is
   begin
      QTextCharFormat_setAnchorHref_QStringCR (Self.Object, Qt4.Strings.Internals.QString_View (Anchor));
   end Set_Anchor_Href;

   ----------------------
   -- Set_Anchor_Names --
   ----------------------

   procedure Set_Anchor_Names
    (Self : in out Q_Text_Char_Format'Class;
     Names : Qt4.String_Lists.Q_String_List'Class)
   is
   begin
      QTextCharFormat_setAnchorNames_QStringListCR (Self.Object, Qt4.String_Lists.Internals.QStringList_View (Names));
   end Set_Anchor_Names;

   --------------
   -- Set_Font --
   --------------

   procedure Set_Font
    (Self : in out Q_Text_Char_Format'Class;
     Font : Qt4.Fonts.Q_Font'Class)
   is
   begin
      QTextCharFormat_setFont_QFontCR (Self.Object, Qt4.Fonts.Internals.QFont_View (Font));
   end Set_Font;

   -----------------------------
   -- Set_Font_Capitalization --
   -----------------------------

   procedure Set_Font_Capitalization
    (Self : in out Q_Text_Char_Format'Class;
     Capitalization : Qt4.Fonts.Capitalization)
   is
   begin
      QTextCharFormat_setFontCapitalization_Capitalization (Self.Object, Capitalization);
   end Set_Font_Capitalization;

   ---------------------
   -- Set_Font_Family --
   ---------------------

   procedure Set_Font_Family
    (Self : in out Q_Text_Char_Format'Class;
     Anchor : Qt4.Strings.Q_String'Class)
   is
   begin
      QTextCharFormat_setFontFamily_QStringCR (Self.Object, Qt4.Strings.Internals.QString_View (Anchor));
   end Set_Font_Family;

   --------------------------
   -- Set_Font_Fixed_Pitch --
   --------------------------

   procedure Set_Font_Fixed_Pitch
    (Self : in out Q_Text_Char_Format'Class;
     Fixed_Pitch : Boolean)
   is
   begin
      QTextCharFormat_setFontFixedPitch_bool (Self.Object, Qt_Ada.Internals.Boolean_Conversions.To_unsigned (Fixed_Pitch));
   end Set_Font_Fixed_Pitch;

   ---------------------
   -- Set_Font_Italic --
   ---------------------

   procedure Set_Font_Italic
    (Self : in out Q_Text_Char_Format'Class;
     Italic : Boolean)
   is
   begin
      QTextCharFormat_setFontItalic_bool (Self.Object, Qt_Ada.Internals.Boolean_Conversions.To_unsigned (Italic));
   end Set_Font_Italic;

   -----------------------------
   -- Set_Font_Letter_Spacing --
   -----------------------------

   procedure Set_Font_Letter_Spacing
    (Self : in out Q_Text_Char_Format'Class;
     Spacing : Qt4.Q_Real)
   is
   begin
      QTextCharFormat_setFontLetterSpacing_qreal (Self.Object, Spacing);
   end Set_Font_Letter_Spacing;

   -----------------------
   -- Set_Font_Overline --
   -----------------------

   procedure Set_Font_Overline
    (Self : in out Q_Text_Char_Format'Class;
     Overline : Boolean)
   is
   begin
      QTextCharFormat_setFontOverline_bool (Self.Object, Qt_Ada.Internals.Boolean_Conversions.To_unsigned (Overline));
   end Set_Font_Overline;

   -------------------------
   -- Set_Font_Point_Size --
   -------------------------

   procedure Set_Font_Point_Size
    (Self : in out Q_Text_Char_Format'Class;
     Size : Qt4.Q_Real)
   is
   begin
      QTextCharFormat_setFontPointSize_qreal (Self.Object, Size);
   end Set_Font_Point_Size;

   -------------------------
   -- Set_Font_Strike_Out --
   -------------------------

   procedure Set_Font_Strike_Out
    (Self : in out Q_Text_Char_Format'Class;
     Strike_Out : Boolean)
   is
   begin
      QTextCharFormat_setFontStrikeOut_bool (Self.Object, Qt_Ada.Internals.Boolean_Conversions.To_unsigned (Strike_Out));
   end Set_Font_Strike_Out;

   ------------------------
   -- Set_Font_Underline --
   ------------------------

   procedure Set_Font_Underline
    (Self : in out Q_Text_Char_Format'Class;
     Underline : Boolean)
   is
   begin
      QTextCharFormat_setFontUnderline_bool (Self.Object, Qt_Ada.Internals.Boolean_Conversions.To_unsigned (Underline));
   end Set_Font_Underline;

   ---------------------
   -- Set_Font_Weight --
   ---------------------

   procedure Set_Font_Weight
    (Self : in out Q_Text_Char_Format'Class;
     Weight : Qt4.Fonts.Font_Weight)
   is
   begin
      QTextCharFormat_setFontWeight_int (Self.Object, Weight);
   end Set_Font_Weight;

   ---------------------------
   -- Set_Font_Word_Spacing --
   ---------------------------

   procedure Set_Font_Word_Spacing
    (Self : in out Q_Text_Char_Format'Class;
     Spacing : Qt4.Q_Real)
   is
   begin
      QTextCharFormat_setFontWordSpacing_qreal (Self.Object, Spacing);
   end Set_Font_Word_Spacing;

   ----------------------
   -- Set_Text_Outline --
   ----------------------

   procedure Set_Text_Outline
    (Self : in out Q_Text_Char_Format'Class;
     Pen : Qt4.Pens.Q_Pen'Class)
   is
   begin
      QTextCharFormat_setTextOutline_QPenCR (Self.Object, Qt4.Pens.Internals.QPen_View (Pen));
   end Set_Text_Outline;

   ------------------
   -- Set_Tool_Tip --
   ------------------

   procedure Set_Tool_Tip
    (Self : in out Q_Text_Char_Format'Class;
     Tip : Qt4.Strings.Q_String'Class)
   is
   begin
      QTextCharFormat_setToolTip_QStringCR (Self.Object, Qt4.Strings.Internals.QString_View (Tip));
   end Set_Tool_Tip;

   -------------------------
   -- Set_Underline_Color --
   -------------------------

   procedure Set_Underline_Color
    (Self : in out Q_Text_Char_Format'Class;
     Color : Qt4.Colors.Q_Color'Class)
   is
   begin
      QTextCharFormat_setUnderlineColor_QColorCR (Self.Object, Qt4.Colors.Internals.QColor_View (Color));
   end Set_Underline_Color;

   -------------------------
   -- Set_Underline_Style --
   -------------------------

   procedure Set_Underline_Style
    (Self : in out Q_Text_Char_Format'Class;
     Style : Text_Char_Underline_Style)
   is
   begin
      QTextCharFormat_setUnderlineStyle_UnderlineStyle (Self.Object, Style);
   end Set_Underline_Style;

   ----------------------------
   -- Set_Vertical_Alignment --
   ----------------------------

   procedure Set_Vertical_Alignment
    (Self : in out Q_Text_Char_Format'Class;
     Alignment : Text_Char_Vertical_Alignment)
   is
   begin
      QTextCharFormat_setVerticalAlignment_VerticalAlignment (Self.Object, Alignment);
   end Set_Vertical_Alignment;

   ------------------
   -- Text_Outline --
   ------------------

   function Text_Outline
    (Self : Q_Text_Char_Format'Class)
       return Qt4.Pens.Q_Pen
   is
   begin
      return Returns : Qt4.Pens.Q_Pen do
         QTextCharFormat_textOutline (Qt4.Pens.Internals.QPen_View (Returns), Self.Object);
      end return;
   end Text_Outline;

   --------------
   -- Tool_Tip --
   --------------

   function Tool_Tip
    (Self : Q_Text_Char_Format'Class)
       return Qt4.Strings.Q_String
   is
   begin
      return Returns : Qt4.Strings.Q_String do
         QTextCharFormat_toolTip (Qt4.Strings.Internals.QString_View (Returns), Self.Object);
      end return;
   end Tool_Tip;

   ---------------------
   -- Underline_Color --
   ---------------------

   function Underline_Color
    (Self : Q_Text_Char_Format'Class)
       return Qt4.Colors.Q_Color
   is
   begin
      return Returns : Qt4.Colors.Q_Color do
         QTextCharFormat_underlineColor (Qt4.Colors.Internals.QColor_View (Returns), Self.Object);
      end return;
   end Underline_Color;

   ---------------------
   -- Underline_Style --
   ---------------------

   function Underline_Style
    (Self : Q_Text_Char_Format'Class)
       return Text_Char_Underline_Style
   is
   begin
      return QTextCharFormat_underlineStyle (Self.Object);
   end Underline_Style;

   ------------------------
   -- Vertical_Alignment --
   ------------------------

   function Vertical_Alignment
    (Self : Q_Text_Char_Format'Class)
       return Text_Char_Vertical_Alignment
   is
   begin
      return QTextCharFormat_verticalAlignment (Self.Object);
   end Vertical_Alignment;

   function initialize_QTextImageFormat
    (Storage : System.Address)
      return Internals.QTextFormat_Access;
   pragma Import (C, initialize_QTextImageFormat, "__QtAda_inititialize_QTextImageFormat");

   function adjust_QTextImageFormat
    (Storage : System.Address;
     From    : Internals.QTextFormat_Access)
       return Internals.QTextFormat_Access;
   pragma Import (C, adjust_QTextImageFormat, "__QtAda_adjust_QTextImageFormat");

   procedure finalize_QTextImageFormat (Object : Internals.QTextFormat_Access);
   pragma Import (C, finalize_QTextImageFormat, "__QtAda_finalize_QTextImageFormat");

   function QTextImageFormat_height
    (Self : Internals.QTextFormat_Access)
       return Qt4.Q_Real;
   pragma Import (C, QTextImageFormat_height, "__QtAda_QTextImageFormat_height_Q");

   function QTextImageFormat_isValid
    (Self : Internals.QTextFormat_Access)
       return Interfaces.C.unsigned;
   pragma Import (C, QTextImageFormat_isValid, "__QtAda_QTextImageFormat_isValid_Q");

   procedure QTextImageFormat_name
    (Returns : Qt4.Strings.Internals.QString_Access;
     Self : Internals.QTextFormat_Access);
   pragma Import (C, QTextImageFormat_name, "__QtAda_QTextImageFormat_name_Q");

   procedure QTextImageFormat_setHeight_qreal
    (Self : Internals.QTextFormat_Access;
     Height : Qt4.Q_Real);
   pragma Import (C, QTextImageFormat_setHeight_qreal, "__QtAda_QTextImageFormat_setHeight_qreal");

   procedure QTextImageFormat_setName_QStringCR
    (Self : Internals.QTextFormat_Access;
     Height : Qt4.Strings.Internals.QString_Access);
   pragma Import (C, QTextImageFormat_setName_QStringCR, "__QtAda_QTextImageFormat_setName_QStringCR");

   procedure QTextImageFormat_setWidth_qreal
    (Self : Internals.QTextFormat_Access;
     Width : Qt4.Q_Real);
   pragma Import (C, QTextImageFormat_setWidth_qreal, "__QtAda_QTextImageFormat_setWidth_qreal");

   function QTextImageFormat_width
    (Self : Internals.QTextFormat_Access)
       return Qt4.Q_Real;
   pragma Import (C, QTextImageFormat_width, "__QtAda_QTextImageFormat_width_Q");

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

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

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

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

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

   overriding
   procedure Initialize (Self : in out Q_Text_Image_Format) is
      use type Internals.QTextFormat_Access;

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

   ------------
   -- Height --
   ------------

   function Height
    (Self : Q_Text_Image_Format'Class)
       return Qt4.Q_Real
   is
   begin
      return QTextImageFormat_height (Self.Object);
   end Height;

   --------------
   -- Is_Valid --
   --------------

   function Is_Valid
    (Self : Q_Text_Image_Format'Class)
       return Boolean
   is
   begin
      return Interfaces.C."/=" (QTextImageFormat_isValid (Self.Object), 0);
   end Is_Valid;

   ----------
   -- Name --
   ----------

   function Name
    (Self : Q_Text_Image_Format'Class)
       return Qt4.Strings.Q_String
   is
   begin
      return Returns : Qt4.Strings.Q_String do
         QTextImageFormat_name (Qt4.Strings.Internals.QString_View (Returns), Self.Object);
      end return;
   end Name;

   ----------------
   -- Set_Height --
   ----------------

   procedure Set_Height
    (Self : in out Q_Text_Image_Format'Class;
     Height : Qt4.Q_Real)
   is
   begin
      QTextImageFormat_setHeight_qreal (Self.Object, Height);
   end Set_Height;

   --------------
   -- Set_Name --
   --------------

   procedure Set_Name
    (Self : in out Q_Text_Image_Format'Class;
     Height : Qt4.Strings.Q_String'Class)
   is
   begin
      QTextImageFormat_setName_QStringCR (Self.Object, Qt4.Strings.Internals.QString_View (Height));
   end Set_Name;

   ---------------
   -- Set_Width --
   ---------------

   procedure Set_Width
    (Self : in out Q_Text_Image_Format'Class;
     Width : Qt4.Q_Real)
   is
   begin
      QTextImageFormat_setWidth_qreal (Self.Object, Width);
   end Set_Width;

   -----------
   -- Width --
   -----------

   function Width
    (Self : Q_Text_Image_Format'Class)
       return Qt4.Q_Real
   is
   begin
      return QTextImageFormat_width (Self.Object);
   end Width;

   function initialize_QTextTableCellFormat
    (Storage : System.Address)
      return Internals.QTextFormat_Access;
   pragma Import (C, initialize_QTextTableCellFormat, "__QtAda_inititialize_QTextTableCellFormat");

   function adjust_QTextTableCellFormat
    (Storage : System.Address;
     From    : Internals.QTextFormat_Access)
       return Internals.QTextFormat_Access;
   pragma Import (C, adjust_QTextTableCellFormat, "__QtAda_adjust_QTextTableCellFormat");

   procedure finalize_QTextTableCellFormat (Object : Internals.QTextFormat_Access);
   pragma Import (C, finalize_QTextTableCellFormat, "__QtAda_finalize_QTextTableCellFormat");

   function QTextTableCellFormat_bottomPadding
    (Self : Internals.QTextFormat_Access)
       return Qt4.Q_Real;
   pragma Import (C, QTextTableCellFormat_bottomPadding, "__QtAda_QTextTableCellFormat_bottomPadding_Q");

   function QTextTableCellFormat_isValid
    (Self : Internals.QTextFormat_Access)
       return Interfaces.C.unsigned;
   pragma Import (C, QTextTableCellFormat_isValid, "__QtAda_QTextTableCellFormat_isValid_Q");

   function QTextTableCellFormat_leftPadding
    (Self : Internals.QTextFormat_Access)
       return Qt4.Q_Real;
   pragma Import (C, QTextTableCellFormat_leftPadding, "__QtAda_QTextTableCellFormat_leftPadding_Q");

   function QTextTableCellFormat_rightPadding
    (Self : Internals.QTextFormat_Access)
       return Qt4.Q_Real;
   pragma Import (C, QTextTableCellFormat_rightPadding, "__QtAda_QTextTableCellFormat_rightPadding_Q");

   procedure QTextTableCellFormat_setBottomPadding_qreal
    (Self : Internals.QTextFormat_Access;
     Padding : Qt4.Q_Real);
   pragma Import (C, QTextTableCellFormat_setBottomPadding_qreal, "__QtAda_QTextTableCellFormat_setBottomPadding_qreal");

   procedure QTextTableCellFormat_setLeftPadding_qreal
    (Self : Internals.QTextFormat_Access;
     Padding : Qt4.Q_Real);
   pragma Import (C, QTextTableCellFormat_setLeftPadding_qreal, "__QtAda_QTextTableCellFormat_setLeftPadding_qreal");

   procedure QTextTableCellFormat_setPadding_qreal
    (Self : Internals.QTextFormat_Access;
     Padding : Qt4.Q_Real);
   pragma Import (C, QTextTableCellFormat_setPadding_qreal, "__QtAda_QTextTableCellFormat_setPadding_qreal");

   procedure QTextTableCellFormat_setRightPadding_qreal
    (Self : Internals.QTextFormat_Access;
     Padding : Qt4.Q_Real);
   pragma Import (C, QTextTableCellFormat_setRightPadding_qreal, "__QtAda_QTextTableCellFormat_setRightPadding_qreal");

   procedure QTextTableCellFormat_setTopPadding_qreal
    (Self : Internals.QTextFormat_Access;
     Padding : Qt4.Q_Real);
   pragma Import (C, QTextTableCellFormat_setTopPadding_qreal, "__QtAda_QTextTableCellFormat_setTopPadding_qreal");

   function QTextTableCellFormat_topPadding
    (Self : Internals.QTextFormat_Access)
       return Qt4.Q_Real;
   pragma Import (C, QTextTableCellFormat_topPadding, "__QtAda_QTextTableCellFormat_topPadding_Q");

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

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

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

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

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

   overriding
   procedure Initialize (Self : in out Q_Text_Table_Cell_Format) is
      use type Internals.QTextFormat_Access;

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

   --------------------
   -- Bottom_Padding --
   --------------------

   function Bottom_Padding
    (Self : Q_Text_Table_Cell_Format'Class)
       return Qt4.Q_Real
   is
   begin
      return QTextTableCellFormat_bottomPadding (Self.Object);
   end Bottom_Padding;

   --------------
   -- Is_Valid --
   --------------

   function Is_Valid
    (Self : Q_Text_Table_Cell_Format'Class)
       return Boolean
   is
   begin
      return Interfaces.C."/=" (QTextTableCellFormat_isValid (Self.Object), 0);
   end Is_Valid;

   ------------------
   -- Left_Padding --
   ------------------

   function Left_Padding
    (Self : Q_Text_Table_Cell_Format'Class)
       return Qt4.Q_Real
   is
   begin
      return QTextTableCellFormat_leftPadding (Self.Object);
   end Left_Padding;

   -------------------
   -- Right_Padding --
   -------------------

   function Right_Padding
    (Self : Q_Text_Table_Cell_Format'Class)
       return Qt4.Q_Real
   is
   begin
      return QTextTableCellFormat_rightPadding (Self.Object);
   end Right_Padding;

   ------------------------
   -- Set_Bottom_Padding --
   ------------------------

   procedure Set_Bottom_Padding
    (Self : in out Q_Text_Table_Cell_Format'Class;
     Padding : Qt4.Q_Real)
   is
   begin
      QTextTableCellFormat_setBottomPadding_qreal (Self.Object, Padding);
   end Set_Bottom_Padding;

   ----------------------
   -- Set_Left_Padding --
   ----------------------

   procedure Set_Left_Padding
    (Self : in out Q_Text_Table_Cell_Format'Class;
     Padding : Qt4.Q_Real)
   is
   begin
      QTextTableCellFormat_setLeftPadding_qreal (Self.Object, Padding);
   end Set_Left_Padding;

   -----------------
   -- Set_Padding --
   -----------------

   procedure Set_Padding
    (Self : in out Q_Text_Table_Cell_Format'Class;
     Padding : Qt4.Q_Real)
   is
   begin
      QTextTableCellFormat_setPadding_qreal (Self.Object, Padding);
   end Set_Padding;

   -----------------------
   -- Set_Right_Padding --
   -----------------------

   procedure Set_Right_Padding
    (Self : in out Q_Text_Table_Cell_Format'Class;
     Padding : Qt4.Q_Real)
   is
   begin
      QTextTableCellFormat_setRightPadding_qreal (Self.Object, Padding);
   end Set_Right_Padding;

   ---------------------
   -- Set_Top_Padding --
   ---------------------

   procedure Set_Top_Padding
    (Self : in out Q_Text_Table_Cell_Format'Class;
     Padding : Qt4.Q_Real)
   is
   begin
      QTextTableCellFormat_setTopPadding_qreal (Self.Object, Padding);
   end Set_Top_Padding;

   -----------------
   -- Top_Padding --
   -----------------

   function Top_Padding
    (Self : Q_Text_Table_Cell_Format'Class)
       return Qt4.Q_Real
   is
   begin
      return QTextTableCellFormat_topPadding (Self.Object);
   end Top_Padding;

   function initialize_QTextFrameFormat
    (Storage : System.Address)
      return Internals.QTextFormat_Access;
   pragma Import (C, initialize_QTextFrameFormat, "__QtAda_inititialize_QTextFrameFormat");

   function adjust_QTextFrameFormat
    (Storage : System.Address;
     From    : Internals.QTextFormat_Access)
       return Internals.QTextFormat_Access;
   pragma Import (C, adjust_QTextFrameFormat, "__QtAda_adjust_QTextFrameFormat");

   procedure finalize_QTextFrameFormat (Object : Internals.QTextFormat_Access);
   pragma Import (C, finalize_QTextFrameFormat, "__QtAda_finalize_QTextFrameFormat");

   function QTextFrameFormat_border
    (Self : Internals.QTextFormat_Access)
       return Qt4.Q_Real;
   pragma Import (C, QTextFrameFormat_border, "__QtAda_QTextFrameFormat_border_Q");

   procedure QTextFrameFormat_borderBrush
    (Returns : Qt4.Brushes.Internals.QBrush_Access;
     Self : Internals.QTextFormat_Access);
   pragma Import (C, QTextFrameFormat_borderBrush, "__QtAda_QTextFrameFormat_borderBrush_Q");

   function QTextFrameFormat_borderStyle
    (Self : Internals.QTextFormat_Access)
       return Text_Frame_Border_Style;
   pragma Import (C, QTextFrameFormat_borderStyle, "__QtAda_QTextFrameFormat_borderStyle_Q");

   function QTextFrameFormat_bottomMargin
    (Self : Internals.QTextFormat_Access)
       return Qt4.Q_Real;
   pragma Import (C, QTextFrameFormat_bottomMargin, "__QtAda_QTextFrameFormat_bottomMargin_Q");

   procedure QTextFrameFormat_height
    (Returns : Qt4.Text_Lengths.Internals.QTextLength_Access;
     Self : Internals.QTextFormat_Access);
   pragma Import (C, QTextFrameFormat_height, "__QtAda_QTextFrameFormat_height_Q");

   function QTextFrameFormat_isValid
    (Self : Internals.QTextFormat_Access)
       return Interfaces.C.unsigned;
   pragma Import (C, QTextFrameFormat_isValid, "__QtAda_QTextFrameFormat_isValid_Q");

   function QTextFrameFormat_leftMargin
    (Self : Internals.QTextFormat_Access)
       return Qt4.Q_Real;
   pragma Import (C, QTextFrameFormat_leftMargin, "__QtAda_QTextFrameFormat_leftMargin_Q");

   function QTextFrameFormat_margin
    (Self : Internals.QTextFormat_Access)
       return Qt4.Q_Real;
   pragma Import (C, QTextFrameFormat_margin, "__QtAda_QTextFrameFormat_margin_Q");

   function QTextFrameFormat_padding
    (Self : Internals.QTextFormat_Access)
       return Qt4.Q_Real;
   pragma Import (C, QTextFrameFormat_padding, "__QtAda_QTextFrameFormat_padding_Q");

   function QTextFrameFormat_position
    (Self : Internals.QTextFormat_Access)
       return Text_Frame_Position;
   pragma Import (C, QTextFrameFormat_position, "__QtAda_QTextFrameFormat_position_Q");

   function QTextFrameFormat_rightMargin
    (Self : Internals.QTextFormat_Access)
       return Qt4.Q_Real;
   pragma Import (C, QTextFrameFormat_rightMargin, "__QtAda_QTextFrameFormat_rightMargin_Q");

   procedure QTextFrameFormat_setBorder_qreal
    (Self : Internals.QTextFormat_Access;
     Width : Qt4.Q_Real);
   pragma Import (C, QTextFrameFormat_setBorder_qreal, "__QtAda_QTextFrameFormat_setBorder_qreal");

   procedure QTextFrameFormat_setBorderBrush_QBrushCR
    (Self : Internals.QTextFormat_Access;
     Brush : Qt4.Brushes.Internals.QBrush_Access);
   pragma Import (C, QTextFrameFormat_setBorderBrush_QBrushCR, "__QtAda_QTextFrameFormat_setBorderBrush_QBrushCR");

   procedure QTextFrameFormat_setBorderStyle_BorderStyle
    (Self : Internals.QTextFormat_Access;
     Style : Text_Frame_Border_Style);
   pragma Import (C, QTextFrameFormat_setBorderStyle_BorderStyle, "__QtAda_QTextFrameFormat_setBorderStyle_BorderStyle");

   procedure QTextFrameFormat_setBottomMargin_qreal
    (Self : Internals.QTextFormat_Access;
     Margin : Qt4.Q_Real);
   pragma Import (C, QTextFrameFormat_setBottomMargin_qreal, "__QtAda_QTextFrameFormat_setBottomMargin_qreal");

   procedure QTextFrameFormat_setHeight_QTextLengthCR
    (Self : Internals.QTextFormat_Access;
     Height : Qt4.Text_Lengths.Internals.QTextLength_Access);
   pragma Import (C, QTextFrameFormat_setHeight_QTextLengthCR, "__QtAda_QTextFrameFormat_setHeight_QTextLengthCR");

   procedure QTextFrameFormat_setHeight_qreal
    (Self : Internals.QTextFormat_Access;
     Height : Qt4.Q_Real);
   pragma Import (C, QTextFrameFormat_setHeight_qreal, "__QtAda_QTextFrameFormat_setHeight_qreal");

   procedure QTextFrameFormat_setLeftMargin_qreal
    (Self : Internals.QTextFormat_Access;
     Margin : Qt4.Q_Real);
   pragma Import (C, QTextFrameFormat_setLeftMargin_qreal, "__QtAda_QTextFrameFormat_setLeftMargin_qreal");

   procedure QTextFrameFormat_setMargin_qreal
    (Self : Internals.QTextFormat_Access;
     Margin : Qt4.Q_Real);
   pragma Import (C, QTextFrameFormat_setMargin_qreal, "__QtAda_QTextFrameFormat_setMargin_qreal");

   procedure QTextFrameFormat_setPadding_qreal
    (Self : Internals.QTextFormat_Access;
     Padding : Qt4.Q_Real);
   pragma Import (C, QTextFrameFormat_setPadding_qreal, "__QtAda_QTextFrameFormat_setPadding_qreal");

   procedure QTextFrameFormat_setPosition_Position
    (Self : Internals.QTextFormat_Access;
     F : Text_Frame_Position);
   pragma Import (C, QTextFrameFormat_setPosition_Position, "__QtAda_QTextFrameFormat_setPosition_Position");

   procedure QTextFrameFormat_setRightMargin_qreal
    (Self : Internals.QTextFormat_Access;
     Margin : Qt4.Q_Real);
   pragma Import (C, QTextFrameFormat_setRightMargin_qreal, "__QtAda_QTextFrameFormat_setRightMargin_qreal");

   procedure QTextFrameFormat_setTopMargin_qreal
    (Self : Internals.QTextFormat_Access;
     Margin : Qt4.Q_Real);
   pragma Import (C, QTextFrameFormat_setTopMargin_qreal, "__QtAda_QTextFrameFormat_setTopMargin_qreal");

   procedure QTextFrameFormat_setWidth_QTextLengthCR
    (Self : Internals.QTextFormat_Access;
     Width : Qt4.Text_Lengths.Internals.QTextLength_Access);
   pragma Import (C, QTextFrameFormat_setWidth_QTextLengthCR, "__QtAda_QTextFrameFormat_setWidth_QTextLengthCR");

   procedure QTextFrameFormat_setWidth_qreal
    (Self : Internals.QTextFormat_Access;
     Width : Qt4.Q_Real);
   pragma Import (C, QTextFrameFormat_setWidth_qreal, "__QtAda_QTextFrameFormat_setWidth_qreal");

   function QTextFrameFormat_topMargin
    (Self : Internals.QTextFormat_Access)
       return Qt4.Q_Real;
   pragma Import (C, QTextFrameFormat_topMargin, "__QtAda_QTextFrameFormat_topMargin_Q");

   procedure QTextFrameFormat_width
    (Returns : Qt4.Text_Lengths.Internals.QTextLength_Access;
     Self : Internals.QTextFormat_Access);
   pragma Import (C, QTextFrameFormat_width, "__QtAda_QTextFrameFormat_width_Q");

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

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

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

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

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

   overriding
   procedure Initialize (Self : in out Q_Text_Frame_Format) is
      use type Internals.QTextFormat_Access;

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

   ------------
   -- Border --
   ------------

   function Border
    (Self : Q_Text_Frame_Format'Class)
       return Qt4.Q_Real
   is
   begin
      return QTextFrameFormat_border (Self.Object);
   end Border;

   ------------------
   -- Border_Brush --
   ------------------

   function Border_Brush
    (Self : Q_Text_Frame_Format'Class)
       return Qt4.Brushes.Q_Brush
   is
   begin
      return Returns : Qt4.Brushes.Q_Brush do
         QTextFrameFormat_borderBrush (Qt4.Brushes.Internals.QBrush_View (Returns), Self.Object);
      end return;
   end Border_Brush;

   ------------------
   -- Border_Style --
   ------------------

   function Border_Style
    (Self : Q_Text_Frame_Format'Class)
       return Text_Frame_Border_Style
   is
   begin
      return QTextFrameFormat_borderStyle (Self.Object);
   end Border_Style;

   -------------------
   -- Bottom_Margin --
   -------------------

   function Bottom_Margin
    (Self : Q_Text_Frame_Format'Class)
       return Qt4.Q_Real
   is
   begin
      return QTextFrameFormat_bottomMargin (Self.Object);
   end Bottom_Margin;

   ------------
   -- Height --
   ------------

   function Height
    (Self : Q_Text_Frame_Format'Class)
       return Qt4.Text_Lengths.Q_Text_Length
   is
   begin
      return Returns : Qt4.Text_Lengths.Q_Text_Length do
         QTextFrameFormat_height (Qt4.Text_Lengths.Internals.QTextLength_View (Returns), Self.Object);
      end return;
   end Height;

   --------------
   -- Is_Valid --
   --------------

   function Is_Valid
    (Self : Q_Text_Frame_Format'Class)
       return Boolean
   is
   begin
      return Interfaces.C."/=" (QTextFrameFormat_isValid (Self.Object), 0);
   end Is_Valid;

   -----------------
   -- Left_Margin --
   -----------------

   function Left_Margin
    (Self : Q_Text_Frame_Format'Class)
       return Qt4.Q_Real
   is
   begin
      return QTextFrameFormat_leftMargin (Self.Object);
   end Left_Margin;

   ------------
   -- Margin --
   ------------

   function Margin
    (Self : Q_Text_Frame_Format'Class)
       return Qt4.Q_Real
   is
   begin
      return QTextFrameFormat_margin (Self.Object);
   end Margin;

   -------------
   -- Padding --
   -------------

   function Padding
    (Self : Q_Text_Frame_Format'Class)
       return Qt4.Q_Real
   is
   begin
      return QTextFrameFormat_padding (Self.Object);
   end Padding;

   --------------
   -- Position --
   --------------

   function Position
    (Self : Q_Text_Frame_Format'Class)
       return Text_Frame_Position
   is
   begin
      return QTextFrameFormat_position (Self.Object);
   end Position;

   ------------------
   -- Right_Margin --
   ------------------

   function Right_Margin
    (Self : Q_Text_Frame_Format'Class)
       return Qt4.Q_Real
   is
   begin
      return QTextFrameFormat_rightMargin (Self.Object);
   end Right_Margin;

   ----------------
   -- Set_Border --
   ----------------

   procedure Set_Border
    (Self : in out Q_Text_Frame_Format'Class;
     Width : Qt4.Q_Real)
   is
   begin
      QTextFrameFormat_setBorder_qreal (Self.Object, Width);
   end Set_Border;

   ----------------------
   -- Set_Border_Brush --
   ----------------------

   procedure Set_Border_Brush
    (Self : in out Q_Text_Frame_Format'Class;
     Brush : Qt4.Brushes.Q_Brush'Class)
   is
   begin
      QTextFrameFormat_setBorderBrush_QBrushCR (Self.Object, Qt4.Brushes.Internals.QBrush_View (Brush));
   end Set_Border_Brush;

   ----------------------
   -- Set_Border_Style --
   ----------------------

   procedure Set_Border_Style
    (Self : in out Q_Text_Frame_Format'Class;
     Style : Text_Frame_Border_Style)
   is
   begin
      QTextFrameFormat_setBorderStyle_BorderStyle (Self.Object, Style);
   end Set_Border_Style;

   -----------------------
   -- Set_Bottom_Margin --
   -----------------------

   procedure Set_Bottom_Margin
    (Self : in out Q_Text_Frame_Format'Class;
     Margin : Qt4.Q_Real)
   is
   begin
      QTextFrameFormat_setBottomMargin_qreal (Self.Object, Margin);
   end Set_Bottom_Margin;

   ----------------
   -- Set_Height --
   ----------------

   procedure Set_Height
    (Self : in out Q_Text_Frame_Format'Class;
     Height : Qt4.Text_Lengths.Q_Text_Length'Class)
   is
   begin
      QTextFrameFormat_setHeight_QTextLengthCR (Self.Object, Qt4.Text_Lengths.Internals.QTextLength_View (Height));
   end Set_Height;

   ----------------
   -- Set_Height --
   ----------------

   procedure Set_Height
    (Self : in out Q_Text_Frame_Format'Class;
     Height : Qt4.Q_Real)
   is
   begin
      QTextFrameFormat_setHeight_qreal (Self.Object, Height);
   end Set_Height;

   ---------------------
   -- Set_Left_Margin --
   ---------------------

   procedure Set_Left_Margin
    (Self : in out Q_Text_Frame_Format'Class;
     Margin : Qt4.Q_Real)
   is
   begin
      QTextFrameFormat_setLeftMargin_qreal (Self.Object, Margin);
   end Set_Left_Margin;

   ----------------
   -- Set_Margin --
   ----------------

   procedure Set_Margin
    (Self : in out Q_Text_Frame_Format'Class;
     Margin : Qt4.Q_Real)
   is
   begin
      QTextFrameFormat_setMargin_qreal (Self.Object, Margin);
   end Set_Margin;

   -----------------
   -- Set_Padding --
   -----------------

   procedure Set_Padding
    (Self : in out Q_Text_Frame_Format'Class;
     Padding : Qt4.Q_Real)
   is
   begin
      QTextFrameFormat_setPadding_qreal (Self.Object, Padding);
   end Set_Padding;

   ------------------
   -- Set_Position --
   ------------------

   procedure Set_Position
    (Self : in out Q_Text_Frame_Format'Class;
     F : Text_Frame_Position)
   is
   begin
      QTextFrameFormat_setPosition_Position (Self.Object, F);
   end Set_Position;

   ----------------------
   -- Set_Right_Margin --
   ----------------------

   procedure Set_Right_Margin
    (Self : in out Q_Text_Frame_Format'Class;
     Margin : Qt4.Q_Real)
   is
   begin
      QTextFrameFormat_setRightMargin_qreal (Self.Object, Margin);
   end Set_Right_Margin;

   --------------------
   -- Set_Top_Margin --
   --------------------

   procedure Set_Top_Margin
    (Self : in out Q_Text_Frame_Format'Class;
     Margin : Qt4.Q_Real)
   is
   begin
      QTextFrameFormat_setTopMargin_qreal (Self.Object, Margin);
   end Set_Top_Margin;

   ---------------
   -- Set_Width --
   ---------------

   procedure Set_Width
    (Self : in out Q_Text_Frame_Format'Class;
     Width : Qt4.Text_Lengths.Q_Text_Length'Class)
   is
   begin
      QTextFrameFormat_setWidth_QTextLengthCR (Self.Object, Qt4.Text_Lengths.Internals.QTextLength_View (Width));
   end Set_Width;

   ---------------
   -- Set_Width --
   ---------------

   procedure Set_Width
    (Self : in out Q_Text_Frame_Format'Class;
     Width : Qt4.Q_Real)
   is
   begin
      QTextFrameFormat_setWidth_qreal (Self.Object, Width);
   end Set_Width;

   ----------------
   -- Top_Margin --
   ----------------

   function Top_Margin
    (Self : Q_Text_Frame_Format'Class)
       return Qt4.Q_Real
   is
   begin
      return QTextFrameFormat_topMargin (Self.Object);
   end Top_Margin;

   -----------
   -- Width --
   -----------

   function Width
    (Self : Q_Text_Frame_Format'Class)
       return Qt4.Text_Lengths.Q_Text_Length
   is
   begin
      return Returns : Qt4.Text_Lengths.Q_Text_Length do
         QTextFrameFormat_width (Qt4.Text_Lengths.Internals.QTextLength_View (Returns), Self.Object);
      end return;
   end Width;

   function initialize_QTextTableFormat
    (Storage : System.Address)
      return Internals.QTextFormat_Access;
   pragma Import (C, initialize_QTextTableFormat, "__QtAda_inititialize_QTextTableFormat");

   function adjust_QTextTableFormat
    (Storage : System.Address;
     From    : Internals.QTextFormat_Access)
       return Internals.QTextFormat_Access;
   pragma Import (C, adjust_QTextTableFormat, "__QtAda_adjust_QTextTableFormat");

   procedure finalize_QTextTableFormat (Object : Internals.QTextFormat_Access);
   pragma Import (C, finalize_QTextTableFormat, "__QtAda_finalize_QTextTableFormat");

   function QTextTableFormat_cellPadding
    (Self : Internals.QTextFormat_Access)
       return Qt4.Q_Real;
   pragma Import (C, QTextTableFormat_cellPadding, "__QtAda_QTextTableFormat_cellPadding_Q");

   function QTextTableFormat_cellSpacing
    (Self : Internals.QTextFormat_Access)
       return Qt4.Q_Real;
   pragma Import (C, QTextTableFormat_cellSpacing, "__QtAda_QTextTableFormat_cellSpacing_Q");

   procedure QTextTableFormat_clearColumnWidthConstraints
    (Self : Internals.QTextFormat_Access);
   pragma Import (C, QTextTableFormat_clearColumnWidthConstraints, "__QtAda_QTextTableFormat_clearColumnWidthConstraints");

   function QTextTableFormat_columns
    (Self : Internals.QTextFormat_Access)
       return Qt4.Q_Integer;
   pragma Import (C, QTextTableFormat_columns, "__QtAda_QTextTableFormat_columns_Q");

   function QTextTableFormat_headerRowCount
    (Self : Internals.QTextFormat_Access)
       return Qt4.Q_Integer;
   pragma Import (C, QTextTableFormat_headerRowCount, "__QtAda_QTextTableFormat_headerRowCount_Q");

   function QTextTableFormat_isValid
    (Self : Internals.QTextFormat_Access)
       return Interfaces.C.unsigned;
   pragma Import (C, QTextTableFormat_isValid, "__QtAda_QTextTableFormat_isValid_Q");

   procedure QTextTableFormat_setAligment_unsigned
    (Self   : Qt4.Text_Formats.Internals.QTextFormat_Access;
     Weight : Qt4.Alignment);
   pragma Import
    (C, QTextTableFormat_setAligment_unsigned, "__Qt4Ada_QTextTableFormat_setAlignment_wrapper");

   procedure QTextTableFormat_setCellPadding_qreal
    (Self : Internals.QTextFormat_Access;
     Padding : Qt4.Q_Real);
   pragma Import (C, QTextTableFormat_setCellPadding_qreal, "__QtAda_QTextTableFormat_setCellPadding_qreal");

   procedure QTextTableFormat_setCellSpacing_qreal
    (Self : Internals.QTextFormat_Access;
     Spacing : Qt4.Q_Real);
   pragma Import (C, QTextTableFormat_setCellSpacing_qreal, "__QtAda_QTextTableFormat_setCellSpacing_qreal");

   procedure QTextTableFormat_setColumns_int
    (Self : Internals.QTextFormat_Access;
     Columns : Qt4.Q_Integer);
   pragma Import (C, QTextTableFormat_setColumns_int, "__QtAda_QTextTableFormat_setColumns_int");

   procedure QTextTableFormat_setHeaderRowCount_int
    (Self : Internals.QTextFormat_Access;
     Count : Qt4.Q_Integer);
   pragma Import (C, QTextTableFormat_setHeaderRowCount_int, "__QtAda_QTextTableFormat_setHeaderRowCount_int");

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

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

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

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

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

   overriding
   procedure Initialize (Self : in out Q_Text_Table_Format) is
      use type Internals.QTextFormat_Access;

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

   ------------------
   -- Cell_Padding --
   ------------------

   function Cell_Padding
    (Self : Q_Text_Table_Format'Class)
       return Qt4.Q_Real
   is
   begin
      return QTextTableFormat_cellPadding (Self.Object);
   end Cell_Padding;

   ------------------
   -- Cell_Spacing --
   ------------------

   function Cell_Spacing
    (Self : Q_Text_Table_Format'Class)
       return Qt4.Q_Real
   is
   begin
      return QTextTableFormat_cellSpacing (Self.Object);
   end Cell_Spacing;

   ------------------------------------
   -- Clear_Column_Width_Constraints --
   ------------------------------------

   procedure Clear_Column_Width_Constraints
    (Self : in out Q_Text_Table_Format'Class)
   is
   begin
      QTextTableFormat_clearColumnWidthConstraints (Self.Object);
   end Clear_Column_Width_Constraints;

   -------------
   -- Columns --
   -------------

   function Columns
    (Self : Q_Text_Table_Format'Class)
       return Qt4.Q_Integer
   is
   begin
      return QTextTableFormat_columns (Self.Object);
   end Columns;

   ----------------------
   -- Header_Row_Count --
   ----------------------

   function Header_Row_Count
    (Self : Q_Text_Table_Format'Class)
       return Qt4.Q_Integer
   is
   begin
      return QTextTableFormat_headerRowCount (Self.Object);
   end Header_Row_Count;

   --------------
   -- Is_Valid --
   --------------

   function Is_Valid
    (Self : Q_Text_Table_Format'Class)
       return Boolean
   is
   begin
      return Interfaces.C."/=" (QTextTableFormat_isValid (Self.Object), 0);
   end Is_Valid;

   -------------------
   -- Set_Alignment --
   -------------------

   procedure Set_Alignment
    (Self      : in out Q_Text_Table_Format'Class;
     Alignment : Qt4.Alignment)
   is
   begin
      QTextTableFormat_setAligment_unsigned (Self.Object, Alignment);
   end Set_Alignment;

   ----------------------
   -- Set_Cell_Padding --
   ----------------------

   procedure Set_Cell_Padding
    (Self : in out Q_Text_Table_Format'Class;
     Padding : Qt4.Q_Real)
   is
   begin
      QTextTableFormat_setCellPadding_qreal (Self.Object, Padding);
   end Set_Cell_Padding;

   ----------------------
   -- Set_Cell_Spacing --
   ----------------------

   procedure Set_Cell_Spacing
    (Self : in out Q_Text_Table_Format'Class;
     Spacing : Qt4.Q_Real)
   is
   begin
      QTextTableFormat_setCellSpacing_qreal (Self.Object, Spacing);
   end Set_Cell_Spacing;

   -----------------
   -- Set_Columns --
   -----------------

   procedure Set_Columns
    (Self : in out Q_Text_Table_Format'Class;
     Columns : Qt4.Q_Integer)
   is
   begin
      QTextTableFormat_setColumns_int (Self.Object, Columns);
   end Set_Columns;

   --------------------------
   -- Set_Header_Row_Count --
   --------------------------

   procedure Set_Header_Row_Count
    (Self : in out Q_Text_Table_Format'Class;
     Count : Qt4.Q_Integer)
   is
   begin
      QTextTableFormat_setHeaderRowCount_int (Self.Object, Count);
   end Set_Header_Row_Count;

   function initialize_QTextListFormat
    (Storage : System.Address)
      return Internals.QTextFormat_Access;
   pragma Import (C, initialize_QTextListFormat, "__QtAda_inititialize_QTextListFormat");

   function adjust_QTextListFormat
    (Storage : System.Address;
     From    : Internals.QTextFormat_Access)
       return Internals.QTextFormat_Access;
   pragma Import (C, adjust_QTextListFormat, "__QtAda_adjust_QTextListFormat");

   procedure finalize_QTextListFormat (Object : Internals.QTextFormat_Access);
   pragma Import (C, finalize_QTextListFormat, "__QtAda_finalize_QTextListFormat");

   function QTextListFormat_indent
    (Self : Internals.QTextFormat_Access)
       return Interfaces.C.unsigned;
   pragma Import (C, QTextListFormat_indent, "__QtAda_QTextListFormat_indent_Q");

   function QTextListFormat_isValid
    (Self : Internals.QTextFormat_Access)
       return Interfaces.C.unsigned;
   pragma Import (C, QTextListFormat_isValid, "__QtAda_QTextListFormat_isValid_Q");

   procedure QTextListFormat_setIndent_int
    (Self : Internals.QTextFormat_Access;
     Indent : Qt4.Q_Integer);
   pragma Import (C, QTextListFormat_setIndent_int, "__QtAda_QTextListFormat_setIndent_int");

   procedure QTextListFormat_setStyle_Style
    (Self : Internals.QTextFormat_Access;
     Style : Text_List_Style);
   pragma Import (C, QTextListFormat_setStyle_Style, "__QtAda_QTextListFormat_setStyle_Style");

   function QTextListFormat_style
    (Self : Internals.QTextFormat_Access)
       return Text_List_Style;
   pragma Import (C, QTextListFormat_style, "__QtAda_QTextListFormat_style_Q");

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

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

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

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

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

   overriding
   procedure Initialize (Self : in out Q_Text_List_Format) is
      use type Internals.QTextFormat_Access;

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

   ------------
   -- Indent --
   ------------

   function Indent
    (Self : Q_Text_List_Format'Class)
       return Boolean
   is
   begin
      return Interfaces.C."/=" (QTextListFormat_indent (Self.Object), 0);
   end Indent;

   --------------
   -- Is_Valid --
   --------------

   function Is_Valid
    (Self : Q_Text_List_Format'Class)
       return Boolean
   is
   begin
      return Interfaces.C."/=" (QTextListFormat_isValid (Self.Object), 0);
   end Is_Valid;

   ----------------
   -- Set_Indent --
   ----------------

   procedure Set_Indent
    (Self : in out Q_Text_List_Format'Class;
     Indent : Qt4.Q_Integer)
   is
   begin
      QTextListFormat_setIndent_int (Self.Object, Indent);
   end Set_Indent;

   ---------------
   -- Set_Style --
   ---------------

   procedure Set_Style
    (Self : in out Q_Text_List_Format'Class;
     Style : Text_List_Style)
   is
   begin
      QTextListFormat_setStyle_Style (Self.Object, Style);
   end Set_Style;

   -----------
   -- Style --
   -----------

   function Style
    (Self : Q_Text_List_Format'Class)
       return Text_List_Style
   is
   begin
      return QTextListFormat_style (Self.Object);
   end Style;

   function initialize_QTextFormat
    (Storage : System.Address)
      return Internals.QTextFormat_Access;
   pragma Import (C, initialize_QTextFormat, "__QtAda_inititialize_QTextFormat");

   function adjust_QTextFormat
    (Storage : System.Address;
     From    : Internals.QTextFormat_Access)
       return Internals.QTextFormat_Access;
   pragma Import (C, adjust_QTextFormat, "__QtAda_adjust_QTextFormat");

   procedure finalize_QTextFormat (Object : Internals.QTextFormat_Access);
   pragma Import (C, finalize_QTextFormat, "__QtAda_finalize_QTextFormat");

   procedure QTextFormat_background
    (Returns : Qt4.Brushes.Internals.QBrush_Access;
     Self : Internals.QTextFormat_Access);
   pragma Import (C, QTextFormat_background, "__QtAda_QTextFormat_background_Q");

   function QTextFormat_boolProperty_int
    (Self : Internals.QTextFormat_Access;
     Property_Id : Qt4.Q_Integer)
       return Interfaces.C.unsigned;
   pragma Import (C, QTextFormat_boolProperty_int, "__QtAda_QTextFormat_boolProperty_int_Q");

   procedure QTextFormat_brushProperty_int
    (Returns : Qt4.Brushes.Internals.QBrush_Access;
     Self : Internals.QTextFormat_Access;
     Property_Id : Qt4.Q_Integer);
   pragma Import (C, QTextFormat_brushProperty_int, "__QtAda_QTextFormat_brushProperty_int_Q");

   procedure QTextFormat_clearBackground
    (Self : Internals.QTextFormat_Access);
   pragma Import (C, QTextFormat_clearBackground, "__QtAda_QTextFormat_clearBackground");

   procedure QTextFormat_clearForeground
    (Self : Internals.QTextFormat_Access);
   pragma Import (C, QTextFormat_clearForeground, "__QtAda_QTextFormat_clearForeground");

   procedure QTextFormat_clearProperty_int
    (Self : Internals.QTextFormat_Access;
     Property_Id : Qt4.Q_Integer);
   pragma Import (C, QTextFormat_clearProperty_int, "__QtAda_QTextFormat_clearProperty_int");

   procedure QTextFormat_colorProperty_int
    (Returns : Qt4.Colors.Internals.QColor_Access;
     Self : Internals.QTextFormat_Access;
     Property_Id : Qt4.Q_Integer);
   pragma Import (C, QTextFormat_colorProperty_int, "__QtAda_QTextFormat_colorProperty_int_Q");

   function QTextFormat_doubleProperty_int
    (Self : Internals.QTextFormat_Access;
     Property_Id : Qt4.Q_Integer)
       return Qt4.Q_Real;
   pragma Import (C, QTextFormat_doubleProperty_int, "__QtAda_QTextFormat_doubleProperty_int_Q");

   procedure QTextFormat_foreground
    (Returns : Qt4.Brushes.Internals.QBrush_Access;
     Self : Internals.QTextFormat_Access);
   pragma Import (C, QTextFormat_foreground, "__QtAda_QTextFormat_foreground_Q");

   function QTextFormat_intProperty_int
    (Self : Internals.QTextFormat_Access;
     Property_Id : Qt4.Q_Integer)
       return Qt4.Q_Integer;
   pragma Import (C, QTextFormat_intProperty_int, "__QtAda_QTextFormat_intProperty_int_Q");

   function QTextFormat_isBlockFormat
    (Self : Internals.QTextFormat_Access)
       return Interfaces.C.unsigned;
   pragma Import (C, QTextFormat_isBlockFormat, "__QtAda_QTextFormat_isBlockFormat_Q");

   function QTextFormat_isCharFormat
    (Self : Internals.QTextFormat_Access)
       return Interfaces.C.unsigned;
   pragma Import (C, QTextFormat_isCharFormat, "__QtAda_QTextFormat_isCharFormat_Q");

   function QTextFormat_isFrameFormat
    (Self : Internals.QTextFormat_Access)
       return Interfaces.C.unsigned;
   pragma Import (C, QTextFormat_isFrameFormat, "__QtAda_QTextFormat_isFrameFormat_Q");

   function QTextFormat_isImageFormat
    (Self : Internals.QTextFormat_Access)
       return Interfaces.C.unsigned;
   pragma Import (C, QTextFormat_isImageFormat, "__QtAda_QTextFormat_isImageFormat_Q");

   function QTextFormat_isListFormat
    (Self : Internals.QTextFormat_Access)
       return Interfaces.C.unsigned;
   pragma Import (C, QTextFormat_isListFormat, "__QtAda_QTextFormat_isListFormat_Q");

   function QTextFormat_isTableCellFormat
    (Self : Internals.QTextFormat_Access)
       return Interfaces.C.unsigned;
   pragma Import (C, QTextFormat_isTableCellFormat, "__QtAda_QTextFormat_isTableCellFormat_Q");

   function QTextFormat_isTableFormat
    (Self : Internals.QTextFormat_Access)
       return Interfaces.C.unsigned;
   pragma Import (C, QTextFormat_isTableFormat, "__QtAda_QTextFormat_isTableFormat_Q");

   function QTextFormat_isValid
    (Self : Internals.QTextFormat_Access)
       return Interfaces.C.unsigned;
   pragma Import (C, QTextFormat_isValid, "__QtAda_QTextFormat_isValid_Q");

   function QTextFormat_layoutDirection
    (Self : Internals.QTextFormat_Access)
       return Qt4.Layout_Direction;
   pragma Import (C, QTextFormat_layoutDirection, "__QtAda_QTextFormat_layoutDirection_Q");

   procedure QTextFormat_lengthProperty_int
    (Returns : Qt4.Text_Lengths.Internals.QTextLength_Access;
     Self : Internals.QTextFormat_Access;
     Property_Id : Qt4.Q_Integer);
   pragma Import (C, QTextFormat_lengthProperty_int, "__QtAda_QTextFormat_lengthProperty_int_Q");

   procedure QTextFormat_merge_QTextFormatCR
    (Self : Internals.QTextFormat_Access;
     Other : Internals.QTextFormat_Access);
   pragma Import (C, QTextFormat_merge_QTextFormatCR, "__QtAda_QTextFormat_merge_QTextFormatCR");

   function QTextFormat_objectIndex
    (Self : Internals.QTextFormat_Access)
       return Qt4.Q_Integer;
   pragma Import (C, QTextFormat_objectIndex, "__QtAda_QTextFormat_objectIndex_Q");

   function QTextFormat_objectType
    (Self : Internals.QTextFormat_Access)
       return Qt4.Q_Integer;
   pragma Import (C, QTextFormat_objectType, "__QtAda_QTextFormat_objectType_Q");

   procedure QTextFormat_penProperty_int
    (Returns : Qt4.Pens.Internals.QPen_Access;
     Self : Internals.QTextFormat_Access;
     Property_Id : Qt4.Q_Integer);
   pragma Import (C, QTextFormat_penProperty_int, "__QtAda_QTextFormat_penProperty_int_Q");

   procedure QTextFormat_property_int
    (Returns : Qt4.Variants.Internals.QVariant_Access;
     Self : Internals.QTextFormat_Access;
     Property_Id : Qt4.Q_Integer);
   pragma Import (C, QTextFormat_property_int, "__QtAda_QTextFormat_property_int_Q");

   function QTextFormat_propertyCount
    (Self : Internals.QTextFormat_Access)
       return Qt4.Q_Integer;
   pragma Import (C, QTextFormat_propertyCount, "__QtAda_QTextFormat_propertyCount_Q");

   procedure QTextFormat_setBackground_QBrushCR
    (Self : Internals.QTextFormat_Access;
     Brush : Qt4.Brushes.Internals.QBrush_Access);
   pragma Import (C, QTextFormat_setBackground_QBrushCR, "__QtAda_QTextFormat_setBackground_QBrushCR");

   procedure QTextFormat_setForeground_QBrushCR
    (Self : Internals.QTextFormat_Access;
     Brush : Qt4.Brushes.Internals.QBrush_Access);
   pragma Import (C, QTextFormat_setForeground_QBrushCR, "__QtAda_QTextFormat_setForeground_QBrushCR");

   procedure QTextFormat_setLayoutDirection_LayoutDirection
    (Self : Internals.QTextFormat_Access;
     Direction : Qt4.Layout_Direction);
   pragma Import (C, QTextFormat_setLayoutDirection_LayoutDirection, "__QtAda_QTextFormat_setLayoutDirection_LayoutDirection");

   procedure QTextFormat_setObjectIndex_int
    (Self : Internals.QTextFormat_Access;
     Object : Qt4.Q_Integer);
   pragma Import (C, QTextFormat_setObjectIndex_int, "__QtAda_QTextFormat_setObjectIndex_int");

   procedure QTextFormat_setObjectType_int
    (Self : Internals.QTextFormat_Access;
     Object_Type : Qt4.Q_Integer);
   pragma Import (C, QTextFormat_setObjectType_int, "__QtAda_QTextFormat_setObjectType_int");

   procedure QTextFormat_setProperty_int_QVariantCR
    (Self : Internals.QTextFormat_Access;
     Property_Id : Qt4.Q_Integer;
     Value : Qt4.Variants.Internals.QVariant_Access);
   pragma Import (C, QTextFormat_setProperty_int_QVariantCR, "__QtAda_QTextFormat_setProperty_int_QVariantCR");

   procedure QTextFormat_stringProperty_int
    (Returns : Qt4.Strings.Internals.QString_Access;
     Self : Internals.QTextFormat_Access;
     Property_Id : Qt4.Q_Integer);
   pragma Import (C, QTextFormat_stringProperty_int, "__QtAda_QTextFormat_stringProperty_int_Q");

   procedure QTextFormat_toBlockFormat
    (Returns : Internals.QTextFormat_Access;
     Self : Internals.QTextFormat_Access);
   pragma Import (C, QTextFormat_toBlockFormat, "__QtAda_QTextFormat_toBlockFormat_Q");

   procedure QTextFormat_toCharFormat
    (Returns : Internals.QTextFormat_Access;
     Self : Internals.QTextFormat_Access);
   pragma Import (C, QTextFormat_toCharFormat, "__QtAda_QTextFormat_toCharFormat_Q");

   procedure QTextFormat_toFrameFormat
    (Returns : Internals.QTextFormat_Access;
     Self : Internals.QTextFormat_Access);
   pragma Import (C, QTextFormat_toFrameFormat, "__QtAda_QTextFormat_toFrameFormat_Q");

   procedure QTextFormat_toImageFormat
    (Returns : Internals.QTextFormat_Access;
     Self : Internals.QTextFormat_Access);
   pragma Import (C, QTextFormat_toImageFormat, "__QtAda_QTextFormat_toImageFormat_Q");

   procedure QTextFormat_toListFormat
    (Returns : Internals.QTextFormat_Access;
     Self : Internals.QTextFormat_Access);
   pragma Import (C, QTextFormat_toListFormat, "__QtAda_QTextFormat_toListFormat_Q");

   procedure QTextFormat_toTableCellFormat
    (Returns : Internals.QTextFormat_Access;
     Self : Internals.QTextFormat_Access);
   pragma Import (C, QTextFormat_toTableCellFormat, "__QtAda_QTextFormat_toTableCellFormat_Q");

   procedure QTextFormat_toTableFormat
    (Returns : Internals.QTextFormat_Access;
     Self : Internals.QTextFormat_Access);
   pragma Import (C, QTextFormat_toTableFormat, "__QtAda_QTextFormat_toTableFormat_Q");

   function QTextFormat_type
    (Self : Internals.QTextFormat_Access)
       return Qt4.Q_Integer;
   pragma Import (C, QTextFormat_type, "__QtAda_QTextFormat_type_Q");

   function eq_QTextFormatCR
    (Self : Internals.QTextFormat_Access;
     Other : Internals.QTextFormat_Access)
       return Interfaces.C.unsigned;
   pragma Import (C, eq_QTextFormatCR, "__QtAda_QTextFormat_eq_QTextFormatCR_Q");

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

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

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

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

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

   overriding
   procedure Initialize (Self : in out Q_Text_Format) is
      use type Internals.QTextFormat_Access;

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

   ----------------
   -- Background --
   ----------------

   function Background
    (Self : Q_Text_Format'Class)
       return Qt4.Brushes.Q_Brush
   is
   begin
      return Returns : Qt4.Brushes.Q_Brush do
         QTextFormat_background (Qt4.Brushes.Internals.QBrush_View (Returns), Self.Object);
      end return;
   end Background;

   -------------------
   -- Bool_Property --
   -------------------

   function Bool_Property
    (Self : Q_Text_Format'Class;
     Property_Id : Qt4.Text_Formats.Text_Property)
       return Boolean
   is
   begin
      return Interfaces.C."/=" (QTextFormat_boolProperty_int (Self.Object, Qt4.Q_Integer (Property_Id)), 0);
   end Bool_Property;

   --------------------
   -- Brush_Property --
   --------------------

   function Brush_Property
    (Self : Q_Text_Format'Class;
     Property_Id : Qt4.Text_Formats.Text_Property)
       return Qt4.Brushes.Q_Brush
   is
   begin
      return Returns : Qt4.Brushes.Q_Brush do
         QTextFormat_brushProperty_int (Qt4.Brushes.Internals.QBrush_View (Returns), Self.Object, Qt4.Q_Integer (Property_Id));
      end return;
   end Brush_Property;

   ----------------------
   -- Clear_Background --
   ----------------------

   procedure Clear_Background
    (Self : in out Q_Text_Format'Class)
   is
   begin
      QTextFormat_clearBackground (Self.Object);
   end Clear_Background;

   ----------------------
   -- Clear_Foreground --
   ----------------------

   procedure Clear_Foreground
    (Self : in out Q_Text_Format'Class)
   is
   begin
      QTextFormat_clearForeground (Self.Object);
   end Clear_Foreground;

   --------------------
   -- Clear_Property --
   --------------------

   procedure Clear_Property
    (Self : in out Q_Text_Format'Class;
     Property_Id : Qt4.Text_Formats.Text_Property)
   is
   begin
      QTextFormat_clearProperty_int (Self.Object, Qt4.Q_Integer (Property_Id));
   end Clear_Property;

   --------------------
   -- Color_Property --
   --------------------

   function Color_Property
    (Self : Q_Text_Format'Class;
     Property_Id : Qt4.Text_Formats.Text_Property)
       return Qt4.Colors.Q_Color
   is
   begin
      return Returns : Qt4.Colors.Q_Color do
         QTextFormat_colorProperty_int (Qt4.Colors.Internals.QColor_View (Returns), Self.Object, Qt4.Q_Integer (Property_Id));
      end return;
   end Color_Property;

   ---------------------
   -- Double_Property --
   ---------------------

   function Double_Property
    (Self : Q_Text_Format'Class;
     Property_Id : Qt4.Text_Formats.Text_Property)
       return Qt4.Q_Real
   is
   begin
      return QTextFormat_doubleProperty_int (Self.Object, Qt4.Q_Integer (Property_Id));
   end Double_Property;

   ----------------
   -- Foreground --
   ----------------

   function Foreground
    (Self : Q_Text_Format'Class)
       return Qt4.Brushes.Q_Brush
   is
   begin
      return Returns : Qt4.Brushes.Q_Brush do
         QTextFormat_foreground (Qt4.Brushes.Internals.QBrush_View (Returns), Self.Object);
      end return;
   end Foreground;

   ------------------
   -- Int_Property --
   ------------------

   function Int_Property
    (Self : Q_Text_Format'Class;
     Property_Id : Qt4.Text_Formats.Text_Property)
       return Qt4.Q_Integer
   is
   begin
      return QTextFormat_intProperty_int (Self.Object, Qt4.Q_Integer (Property_Id));
   end Int_Property;

   ---------------------
   -- Is_Block_Format --
   ---------------------

   function Is_Block_Format
    (Self : Q_Text_Format'Class)
       return Boolean
   is
   begin
      return Interfaces.C."/=" (QTextFormat_isBlockFormat (Self.Object), 0);
   end Is_Block_Format;

   --------------------
   -- Is_Char_Format --
   --------------------

   function Is_Char_Format
    (Self : Q_Text_Format'Class)
       return Boolean
   is
   begin
      return Interfaces.C."/=" (QTextFormat_isCharFormat (Self.Object), 0);
   end Is_Char_Format;

   ---------------------
   -- Is_Frame_Format --
   ---------------------

   function Is_Frame_Format
    (Self : Q_Text_Format'Class)
       return Boolean
   is
   begin
      return Interfaces.C."/=" (QTextFormat_isFrameFormat (Self.Object), 0);
   end Is_Frame_Format;

   ---------------------
   -- Is_Image_Format --
   ---------------------

   function Is_Image_Format
    (Self : Q_Text_Format'Class)
       return Boolean
   is
   begin
      return Interfaces.C."/=" (QTextFormat_isImageFormat (Self.Object), 0);
   end Is_Image_Format;

   --------------------
   -- Is_List_Format --
   --------------------

   function Is_List_Format
    (Self : Q_Text_Format'Class)
       return Boolean
   is
   begin
      return Interfaces.C."/=" (QTextFormat_isListFormat (Self.Object), 0);
   end Is_List_Format;

   --------------------------
   -- Is_Table_Cell_Format --
   --------------------------

   function Is_Table_Cell_Format
    (Self : Q_Text_Format'Class)
       return Boolean
   is
   begin
      return Interfaces.C."/=" (QTextFormat_isTableCellFormat (Self.Object), 0);
   end Is_Table_Cell_Format;

   ---------------------
   -- Is_Table_Format --
   ---------------------

   function Is_Table_Format
    (Self : Q_Text_Format'Class)
       return Boolean
   is
   begin
      return Interfaces.C."/=" (QTextFormat_isTableFormat (Self.Object), 0);
   end Is_Table_Format;

   --------------
   -- Is_Valid --
   --------------

   function Is_Valid
    (Self : Q_Text_Format'Class)
       return Boolean
   is
   begin
      return Interfaces.C."/=" (QTextFormat_isValid (Self.Object), 0);
   end Is_Valid;

   ----------------------
   -- Layout_Direction --
   ----------------------

   function Layout_Direction
    (Self : Q_Text_Format'Class)
       return Qt4.Layout_Direction
   is
   begin
      return QTextFormat_layoutDirection (Self.Object);
   end Layout_Direction;

   ---------------------
   -- Length_Property --
   ---------------------

   function Length_Property
    (Self : Q_Text_Format'Class;
     Property_Id : Qt4.Text_Formats.Text_Property)
       return Qt4.Text_Lengths.Q_Text_Length
   is
   begin
      return Returns : Qt4.Text_Lengths.Q_Text_Length do
         QTextFormat_lengthProperty_int (Qt4.Text_Lengths.Internals.QTextLength_View (Returns), Self.Object, Qt4.Q_Integer (Property_Id));
      end return;
   end Length_Property;

   -----------
   -- Merge --
   -----------

   procedure Merge
    (Self : in out Q_Text_Format'Class;
     Other : Q_Text_Format'Class)
   is
   begin
      QTextFormat_merge_QTextFormatCR (Self.Object, Other.Object);
   end Merge;

   ------------------
   -- Object_Index --
   ------------------

   function Object_Index
    (Self : Q_Text_Format'Class)
       return Qt4.Q_Integer
   is
   begin
      return QTextFormat_objectIndex (Self.Object);
   end Object_Index;

   -----------------
   -- Object_Type --
   -----------------

   function Object_Type
    (Self : Q_Text_Format'Class)
       return Qt4.Q_Integer
   is
   begin
      return QTextFormat_objectType (Self.Object);
   end Object_Type;

   ------------------
   -- Pen_Property --
   ------------------

   function Pen_Property
    (Self : Q_Text_Format'Class;
     Property_Id : Qt4.Text_Formats.Text_Property)
       return Qt4.Pens.Q_Pen
   is
   begin
      return Returns : Qt4.Pens.Q_Pen do
         QTextFormat_penProperty_int (Qt4.Pens.Internals.QPen_View (Returns), Self.Object, Qt4.Q_Integer (Property_Id));
      end return;
   end Pen_Property;

   --------------
   -- Property --
   --------------

   function Property
    (Self : Q_Text_Format'Class;
     Property_Id : Qt4.Text_Formats.Text_Property)
       return Qt4.Variants.Q_Variant
   is
   begin
      return Returns : Qt4.Variants.Q_Variant do
         QTextFormat_property_int (Qt4.Variants.Internals.QVariant_View (Returns), Self.Object, Qt4.Q_Integer (Property_Id));
      end return;
   end Property;

   --------------------
   -- Property_Count --
   --------------------

   function Property_Count
    (Self : Q_Text_Format'Class)
       return Qt4.Q_Integer
   is
   begin
      return QTextFormat_propertyCount (Self.Object);
   end Property_Count;

   --------------------
   -- Set_Background --
   --------------------

   procedure Set_Background
    (Self : in out Q_Text_Format'Class;
     Brush : Qt4.Brushes.Q_Brush'Class)
   is
   begin
      QTextFormat_setBackground_QBrushCR (Self.Object, Qt4.Brushes.Internals.QBrush_View (Brush));
   end Set_Background;

   --------------------
   -- Set_Foreground --
   --------------------

   procedure Set_Foreground
    (Self : in out Q_Text_Format'Class;
     Brush : Qt4.Brushes.Q_Brush'Class)
   is
   begin
      QTextFormat_setForeground_QBrushCR (Self.Object, Qt4.Brushes.Internals.QBrush_View (Brush));
   end Set_Foreground;

   --------------------------
   -- Set_Layout_Direction --
   --------------------------

   procedure Set_Layout_Direction
    (Self : in out Q_Text_Format'Class;
     Direction : Qt4.Layout_Direction)
   is
   begin
      QTextFormat_setLayoutDirection_LayoutDirection (Self.Object, Direction);
   end Set_Layout_Direction;

   ----------------------
   -- Set_Object_Index --
   ----------------------

   procedure Set_Object_Index
    (Self : in out Q_Text_Format'Class;
     Object : Qt4.Q_Integer)
   is
   begin
      QTextFormat_setObjectIndex_int (Self.Object, Object);
   end Set_Object_Index;

   ---------------------
   -- Set_Object_Type --
   ---------------------

   procedure Set_Object_Type
    (Self : in out Q_Text_Format'Class;
     Object_Type : Qt4.Q_Integer)
   is
   begin
      QTextFormat_setObjectType_int (Self.Object, Object_Type);
   end Set_Object_Type;

   ------------------
   -- Set_Property --
   ------------------

   procedure Set_Property
    (Self : in out Q_Text_Format'Class;
     Property_Id : Qt4.Text_Formats.Text_Property;
     Value : Qt4.Variants.Q_Variant'Class)
   is
   begin
      QTextFormat_setProperty_int_QVariantCR (Self.Object, Qt4.Q_Integer (Property_Id), Qt4.Variants.Internals.QVariant_View (Value));
   end Set_Property;

   ---------------------
   -- String_Property --
   ---------------------

   function String_Property
    (Self : Q_Text_Format'Class;
     Property_Id : Qt4.Text_Formats.Text_Property)
       return Qt4.Strings.Q_String
   is
   begin
      return Returns : Qt4.Strings.Q_String do
         QTextFormat_stringProperty_int (Qt4.Strings.Internals.QString_View (Returns), Self.Object, Qt4.Q_Integer (Property_Id));
      end return;
   end String_Property;

   ---------------------
   -- To_Block_Format --
   ---------------------

   function To_Block_Format
    (Self : Q_Text_Format'Class)
       return Q_Text_Block_Format
   is
   begin
      return Returns : Q_Text_Block_Format do
         QTextFormat_toBlockFormat (Returns.Object, Self.Object);
      end return;
   end To_Block_Format;

   --------------------
   -- To_Char_Format --
   --------------------

   function To_Char_Format
    (Self : Q_Text_Format'Class)
       return Q_Text_Char_Format
   is
   begin
      return Returns : Q_Text_Char_Format do
         QTextFormat_toCharFormat (Returns.Object, Self.Object);
      end return;
   end To_Char_Format;

   ---------------------
   -- To_Frame_Format --
   ---------------------

   function To_Frame_Format
    (Self : Q_Text_Format'Class)
       return Q_Text_Frame_Format
   is
   begin
      return Returns : Q_Text_Frame_Format do
         QTextFormat_toFrameFormat (Returns.Object, Self.Object);
      end return;
   end To_Frame_Format;

   ---------------------
   -- To_Image_Format --
   ---------------------

   function To_Image_Format
    (Self : Q_Text_Format'Class)
       return Q_Text_Image_Format
   is
   begin
      return Returns : Q_Text_Image_Format do
         QTextFormat_toImageFormat (Returns.Object, Self.Object);
      end return;
   end To_Image_Format;

   --------------------
   -- To_List_Format --
   --------------------

   function To_List_Format
    (Self : Q_Text_Format'Class)
       return Q_Text_List_Format
   is
   begin
      return Returns : Q_Text_List_Format do
         QTextFormat_toListFormat (Returns.Object, Self.Object);
      end return;
   end To_List_Format;

   --------------------------
   -- To_Table_Cell_Format --
   --------------------------

   function To_Table_Cell_Format
    (Self : Q_Text_Format'Class)
       return Q_Text_Table_Cell_Format
   is
   begin
      return Returns : Q_Text_Table_Cell_Format do
         QTextFormat_toTableCellFormat (Returns.Object, Self.Object);
      end return;
   end To_Table_Cell_Format;

   ---------------------
   -- To_Table_Format --
   ---------------------

   function To_Table_Format
    (Self : Q_Text_Format'Class)
       return Q_Text_Table_Format
   is
   begin
      return Returns : Q_Text_Table_Format do
         QTextFormat_toTableFormat (Returns.Object, Self.Object);
      end return;
   end To_Table_Format;

   -----------------
   -- Format_Type --
   -----------------

   function Format_Type
    (Self : Q_Text_Format'Class)
       return Qt4.Text_Formats.Text_Format_Type
   is
   begin
      return Qt4.Text_Formats.Text_Format_Type (QTextFormat_type (Self.Object));
   end Format_Type;

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

   overriding function "="
    (Self : Q_Text_Format;
     Other : Q_Text_Format)
       return Boolean
   is
   begin
      return Interfaces.C."/=" (eq_QTextFormatCR (Self.Object, Other.Object), 0);
   end "=";

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

   package body Internals is

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

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

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

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

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

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

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

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

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

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

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

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

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

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

   ----------------------
   -- QTextFormat_View --
   ----------------------

      function QTextFormat_View
       (Item : Q_Text_Format'Class)
          return QTextFormat_Access
      is
      begin
         return Item.Object;
      end QTextFormat_View;

      package QTextFormat_Conversions is
        new System.Address_To_Access_Conversions
             (QTextFormat);

   ---------------------------
   -- QTextFormatTo_Pointer --
   ---------------------------

      function To_Pointer
       (Address : System.Address)
          return QTextFormat_Access
      is
      begin
         return
           QTextFormat_Access
            (QTextFormat_Conversions.To_Pointer
            (Address));
      end To_Pointer;

   ---------------------------
   -- QTextFormatTo_Address --
   ---------------------------

      function To_Address
       (Pointer : QTextFormat_Access)
          return System.Address
      is
      begin
         return
           QTextFormat_Conversions.To_Address
            (QTextFormat_Conversions.Object_Pointer
              (Pointer));
      end To_Address;

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

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

   end Internals;

end Qt4.Text_Formats;
