------------------------------------------------------------------------------
--                                                                          --
--                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.     --
------------------------------------------------------------------------------
private with Ada.Finalization;
with Interfaces.C;
with Qt4.Byte_Arrays;
with Qt4.String_Lists;
with Qt4.Strings;
with Qt_Ada.Internals.Generic_Q_Flags;
private with Qt_Ada.Internals.Value_Class_Sizes;
with System;

package Qt4.Urls is

   --  QUrl::ParsingMode

   type Parsing_Mode is
    (Tolerant_Mode,
     Strict_Mode);
   pragma Convention (C, Parsing_Mode);
   for Parsing_Mode'Size use Interfaces.C.unsigned'Size;

   --  QUrl::FormattingOption

   type Formatting_Option is
    (None,
     Remove_Scheme,
     Remove_Password,
     Remove_User_Info,
     Remove_Port,
     Remove_Authority,
     Remove_Path,
     Remove_Query,
     Remove_Fragment,
     Strip_Trailing_Slash);
   pragma Convention (C, Formatting_Option);
   for Formatting_Option'Size use Interfaces.C.unsigned'Size;
   for Formatting_Option use
    (None                 => 0,
     Remove_Scheme        => 1,
     Remove_Password      => 2,
     Remove_User_Info     => 6,
     Remove_Port          => 8,
     Remove_Authority     => 27,
     Remove_Path          => 32,
     Remove_Query         => 64,
     Remove_Fragment      => 128,
     Strip_Trailing_Slash => 65536);

   --  Qt::FormattingOptions

   package Q_Flags_Of_Formatting_Option is
     new Qt_Ada.Internals.Generic_Q_Flags (Formatting_Option);

   type Formatting_Options is new Q_Flags_Of_Formatting_Option.Flags;

   type Q_Url is tagged private;

   function Create
    (Url : Qt4.Strings.Q_String'Class)
       return Q_Url;

   function Create
    (Url : Qt4.Strings.Q_String'Class;
     Mode : Parsing_Mode)
       return Q_Url;

   procedure Add_Encoded_Query_Item
    (Self : in out Q_Url'Class;
     Key : Qt4.Byte_Arrays.Q_Byte_Array'Class;
     Value : Qt4.Byte_Arrays.Q_Byte_Array'Class);

   procedure Add_Query_Item
    (Self : in out Q_Url'Class;
     Key : Qt4.Strings.Q_String'Class;
     Value : Qt4.Strings.Q_String'Class);

   function All_Query_Item_Values
    (Self : Q_Url'Class;
     Key : Qt4.Strings.Q_String'Class)
       return Qt4.String_Lists.Q_String_List;

   function Authority
    (Self : Q_Url'Class)
       return Qt4.Strings.Q_String;

   procedure Clear
    (Self : in out Q_Url'Class);

   function Encoded_Fragment
    (Self : Q_Url'Class)
       return Qt4.Byte_Arrays.Q_Byte_Array;

   function Encoded_Host
    (Self : Q_Url'Class)
       return Qt4.Byte_Arrays.Q_Byte_Array;

   function Encoded_Password
    (Self : Q_Url'Class)
       return Qt4.Byte_Arrays.Q_Byte_Array;

   function Encoded_Path
    (Self : Q_Url'Class)
       return Qt4.Byte_Arrays.Q_Byte_Array;

   function Encoded_Query
    (Self : Q_Url'Class)
       return Qt4.Byte_Arrays.Q_Byte_Array;

   function Encoded_Query_Item_Value
    (Self : Q_Url'Class;
     Key : Qt4.Byte_Arrays.Q_Byte_Array'Class)
       return Qt4.Byte_Arrays.Q_Byte_Array;

   function Encoded_User_Name
    (Self : Q_Url'Class)
       return Qt4.Byte_Arrays.Q_Byte_Array;

   function Error_String
    (Self : Q_Url'Class)
       return Qt4.Strings.Q_String;

   function Fragment
    (Self : Q_Url'Class)
       return Qt4.Strings.Q_String;

   function Has_Encoded_Query_Item
    (Self : Q_Url'Class;
     Key : Qt4.Byte_Arrays.Q_Byte_Array'Class)
       return Boolean;

   function Has_Fragment
    (Self : Q_Url'Class)
       return Boolean;

   function Has_Query
    (Self : Q_Url'Class)
       return Boolean;

   function Has_Query_Item
    (Self : Q_Url'Class;
     Key : Qt4.Strings.Q_String'Class)
       return Boolean;

   function Host
    (Self : Q_Url'Class)
       return Qt4.Strings.Q_String;

   function Is_Empty
    (Self : Q_Url'Class)
       return Boolean;

   function Is_Parent_Of
    (Self : Q_Url'Class;
     Child_Url : Q_Url'Class)
       return Boolean;

   function Is_Relative
    (Self : Q_Url'Class)
       return Boolean;

   function Is_Valid
    (Self : Q_Url'Class)
       return Boolean;

   function Password
    (Self : Q_Url'Class)
       return Qt4.Strings.Q_String;

   function Path
    (Self : Q_Url'Class)
       return Qt4.Strings.Q_String;

   function Port
    (Self : Q_Url'Class)
       return Qt4.Q_Integer;

   function Port
    (Self : Q_Url'Class;
     Default_Port : Qt4.Q_Integer)
       return Qt4.Q_Integer;

   function Query_Item_Value
    (Self : Q_Url'Class;
     Key : Qt4.Strings.Q_String'Class)
       return Qt4.Strings.Q_String;

   procedure Remove_All_Encoded_Query_Items
    (Self : in out Q_Url'Class;
     Key : Qt4.Byte_Arrays.Q_Byte_Array'Class);

   procedure Remove_All_Query_Items
    (Self : in out Q_Url'Class;
     Key : Qt4.Strings.Q_String'Class);

   procedure Remove_Encoded_Query_Item
    (Self : in out Q_Url'Class;
     Key : Qt4.Byte_Arrays.Q_Byte_Array'Class);

   procedure Remove_Query_Item
    (Self : in out Q_Url'Class;
     Key : Qt4.Strings.Q_String'Class);

   function Resolved
    (Self : Q_Url'Class;
     Relative : Q_Url'Class)
       return Q_Url;

   function Scheme
    (Self : Q_Url'Class)
       return Qt4.Strings.Q_String;

   procedure Set_Authority
    (Self : in out Q_Url'Class;
     Authority : Qt4.Strings.Q_String'Class);

   procedure Set_Encoded_Fragment
    (Self : in out Q_Url'Class;
     Fragment : Qt4.Byte_Arrays.Q_Byte_Array'Class);

   procedure Set_Encoded_Host
    (Self : in out Q_Url'Class;
     Host : Qt4.Byte_Arrays.Q_Byte_Array'Class);

   procedure Set_Encoded_Password
    (Self : in out Q_Url'Class;
     Password : Qt4.Byte_Arrays.Q_Byte_Array'Class);

   procedure Set_Encoded_Path
    (Self : in out Q_Url'Class;
     Path : Qt4.Byte_Arrays.Q_Byte_Array'Class);

   procedure Set_Encoded_Query
    (Self : in out Q_Url'Class;
     Query : Qt4.Byte_Arrays.Q_Byte_Array'Class);

   procedure Set_Encoded_Url
    (Self : in out Q_Url'Class;
     Encoded_Url : Qt4.Byte_Arrays.Q_Byte_Array'Class);

   procedure Set_Encoded_Url
    (Self : in out Q_Url'Class;
     Encoded_Url : Qt4.Byte_Arrays.Q_Byte_Array'Class;
     Mode : Parsing_Mode);

   procedure Set_Encoded_User_Name
    (Self : in out Q_Url'Class;
     User_Name : Qt4.Byte_Arrays.Q_Byte_Array'Class);

   procedure Set_Fragment
    (Self : in out Q_Url'Class;
     Fragment : Qt4.Strings.Q_String'Class);

   procedure Set_Host
    (Self : in out Q_Url'Class;
     Host : Qt4.Strings.Q_String'Class);

   procedure Set_Password
    (Self : in out Q_Url'Class;
     Password : Qt4.Strings.Q_String'Class);

   procedure Set_Path
    (Self : in out Q_Url'Class;
     Path : Qt4.Strings.Q_String'Class);

   procedure Set_Port
    (Self : in out Q_Url'Class;
     Port : Qt4.Q_Integer);

   procedure Set_Scheme
    (Self : in out Q_Url'Class;
     Scheme : Qt4.Strings.Q_String'Class);

   procedure Set_Url
    (Self : in out Q_Url'Class;
     Url : Qt4.Strings.Q_String'Class);

   procedure Set_Url
    (Self : in out Q_Url'Class;
     Url : Qt4.Strings.Q_String'Class;
     Mode : Parsing_Mode);

   procedure Set_User_Info
    (Self : in out Q_Url'Class;
     User_Info : Qt4.Strings.Q_String'Class);

   procedure Set_User_Name
    (Self : in out Q_Url'Class;
     User_Name : Qt4.Strings.Q_String'Class);

   function To_Local_File
    (Self : Q_Url'Class)
       return Qt4.Strings.Q_String;

   function User_Info
    (Self : Q_Url'Class)
       return Qt4.Strings.Q_String;

   function User_Name
    (Self : Q_Url'Class)
       return Qt4.Strings.Q_String;

   overriding
   function "="
    (Self : Q_Url;
     Url : Q_Url)
       return Boolean;

   function From_Ace
    (Domain : Qt4.Byte_Arrays.Q_Byte_Array'Class)
       return Qt4.Strings.Q_String;

   function From_Encoded
    (Input : Qt4.Byte_Arrays.Q_Byte_Array'Class)
       return Q_Url;

   function From_Encoded
    (Input : Qt4.Byte_Arrays.Q_Byte_Array'Class;
     Mode : Parsing_Mode)
       return Q_Url;

   function From_Local_File
    (Local_File : Qt4.Strings.Q_String'Class)
       return Q_Url;

   function From_Percent_Encoding
    (Domain : Qt4.Byte_Arrays.Q_Byte_Array'Class)
       return Qt4.Strings.Q_String;

   function Idn_Whitelist
     return Qt4.String_Lists.Q_String_List;

   procedure Set_Idn_Whitelist
    (List : Qt4.String_Lists.Q_String_List'Class);

   function To_Ace
    (Domain : Qt4.Strings.Q_String'Class)
       return Qt4.Byte_Arrays.Q_Byte_Array;

   function To_Percent_Encoding
    (Input : Qt4.Strings.Q_String'Class;
     Exclude : Qt4.Byte_Arrays.Q_Byte_Array'Class;
     Include : Qt4.Byte_Arrays.Q_Byte_Array'Class)
       return Qt4.Byte_Arrays.Q_Byte_Array;

   package Internals is

      type QUrl is private;

      type QUrl_Access is access all QUrl;
      pragma Convention (C, QUrl_Access);

      function QUrl_View
       (Item : Q_Url'Class)
          return QUrl_Access;
      pragma Inline (QUrl_View);

      function To_Pointer
       (Address : System.Address)
          return QUrl_Access;
      pragma Inline (To_Pointer);

      function To_Address
       (Pointer : QUrl_Access)
          return System.Address;
      pragma Inline (To_Address);

      function Create_Wrapper
       (Item : Internals.QUrl_Access)
          return Q_Url;

   private

      type QUrl is record
         Placeholder : Interfaces.C.char_array (1 .. Qt_Ada.Internals.Value_Class_Sizes.QUrl_C_Size_Of);
      end record;
      pragma Convention (C, QUrl);

   end Internals;

private

   type Q_Url is new Ada.Finalization.Controlled with record
      Storage : aliased Internals.QUrl;
      Object  : Internals.QUrl_Access := null;
      Wrapper : Boolean := False;
   end record;

   overriding
   procedure Adjust (Self : in out Q_Url);

   overriding
   procedure Finalize (Self : in out Q_Url);

   overriding
   procedure Initialize (Self : in out Q_Url);

end Qt4.Urls;
