------------------------------------------------------------------------------
--                                                                          --
--                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.String_Lists;
with Qt4.Strings;
private with Qt_Ada.Internals.Value_Class_Sizes;
with System;

package Qt4.Key_Sequences is

   --  QKeySequence::StandardKey

   type Standard_Key is
    (Unknown_Key,
     Help_Contents,
     Whats_This,
     Open,
     Close,
     Save,
     New_File,
     Delete,
     Cut,
     Copy,
     Paste,
     Undo,
     Redo,
     Back,
     Forward,
     Refresh,
     Zoom_In,
     Zoom_Out,
     Print,
     Add_Tab,
     Next_Child,
     Previous_Child,
     Find,
     Find_Next,
     Find_Previous,
     Replace,
     Select_All,
     Bold,
     Italic,
     Underline,
     Move_To_Next_Char,
     Move_To_Previous_Char,
     Move_To_Next_Word,
     Move_To_Previous_Word,
     Move_To_Next_Line,
     Move_To_Previous_Line,
     Move_To_Next_Page,
     Move_To_Previous_Page,
     Move_To_Start_Of_Line,
     Move_To_End_Of_Line,
     Move_To_Start_Of_Block,
     Move_To_End_Of_Block,
     Move_To_Start_Of_Document,
     Move_To_End_Of_Document,
     Select_Next_Char,
     Select_Previous_Char,
     Select_Next_Word,
     Select_Previous_Word,
     Select_Next_Line,
     Select_Previous_Line,
     Select_Next_Page,
     Select_Previous_Page,
     Select_Start_Of_Line,
     Select_End_Of_Line,
     Select_Start_Of_Block,
     Select_End_Of_Block,
     Select_Start_Of_Document,
     Select_End_Of_Document,
     Delete_Start_Of_Word,
     Delete_End_Of_Word,
     Delete_End_Of_Line);
   pragma Convention (C, Standard_Key);
   for Standard_Key'Size use Interfaces.C.unsigned'Size;

   --  QKeySequence::SequenceMatch

   type Sequence_Match is
    (No_Match,
     Partial_Match,
     Exact_Match);
   pragma Convention (C, Sequence_Match);
   for Sequence_Match'Size use Interfaces.C.unsigned'Size;

   --  QKeySequence::SequenceFormat

   type Sequence_Format is
    (Native_Text,
     Portable_Text);
   pragma Convention (C, Sequence_Format);
   for Sequence_Format'Size use Interfaces.C.unsigned'Size;

   type Q_List_Of_Q_Key_Sequence is tagged private;

   type Q_Key_Sequence is tagged private;

   function Create
    (Key : Qt4.Strings.Q_String'Class)
       return Q_Key_Sequence;

   function Create
    (K_1 : Qt4.Q_Integer;
     K_2 : Qt4.Q_Integer
       := 0;
     K_3 : Qt4.Q_Integer
       := 0;
     K_4 : Qt4.Q_Integer
       := 0)
       return Q_Key_Sequence;

   function Create
    (Key : Standard_Key)
       return Q_Key_Sequence;

   function Count
    (Self : Q_Key_Sequence'Class)
       return Qt4.Q_Unsigned_Integer;

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

   function Matches
    (Self : Q_Key_Sequence'Class;
     Seq : Q_Key_Sequence'Class)
       return Sequence_Match;

   function To_String
    (Self : Q_Key_Sequence'Class;
     Format : Sequence_Format
       := Portable_Text)
       return Qt4.Strings.Q_String;

   function "<"
    (Self : Q_Key_Sequence;
     Other : Q_Key_Sequence)
       return Boolean;

   function "<="
    (Self : Q_Key_Sequence;
     Other : Q_Key_Sequence)
       return Boolean;

   overriding function "="
    (Self : Q_Key_Sequence;
     Other : Q_Key_Sequence)
       return Boolean;

   function ">"
    (Self : Q_Key_Sequence;
     Other : Q_Key_Sequence)
       return Boolean;

   function ">="
    (Self : Q_Key_Sequence;
     Other : Q_Key_Sequence)
       return Boolean;

   function From_String
    (Str : Qt4.Strings.Q_String'Class;
     Format : Sequence_Format
       := Portable_Text)
       return Q_Key_Sequence;

   function Key_Bindings
    (Key : Standard_Key)
       return Qt4.String_Lists.Q_String_List;

   function Mnemonic
    (Text : Qt4.Strings.Q_String'Class)
       return Q_Key_Sequence;

   package Internals is

      type QListOfQKeySequence is private;

      type QListOfQKeySequence_Access is access all QListOfQKeySequence;
      pragma Convention (C, QListOfQKeySequence_Access);

      function QListOfQKeySequence_View
       (Item : Q_List_Of_Q_Key_Sequence'Class)
          return QListOfQKeySequence_Access;
      pragma Inline (QListOfQKeySequence_View);

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

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

      function Create_Wrapper
       (Item : Internals.QListOfQKeySequence_Access)
          return Q_List_Of_Q_Key_Sequence;

      type QKeySequence is private;

      type QKeySequence_Access is access all QKeySequence;
      pragma Convention (C, QKeySequence_Access);

      function QKeySequence_View
       (Item : Q_Key_Sequence'Class)
          return QKeySequence_Access;
      pragma Inline (QKeySequence_View);

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

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

      function Create_Wrapper
       (Item : Internals.QKeySequence_Access)
          return Q_Key_Sequence;

   private

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

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

   end Internals;

private

   type Q_List_Of_Q_Key_Sequence is new Ada.Finalization.Controlled with record
      Storage : aliased Internals.QListOfQKeySequence;
      Object  : Internals.QListOfQKeySequence_Access := null;
      Wrapper : Boolean := False;
   end record;

   overriding
   procedure Adjust (Self : in out Q_List_Of_Q_Key_Sequence);

   overriding
   procedure Finalize (Self : in out Q_List_Of_Q_Key_Sequence);

   overriding
   procedure Initialize (Self : in out Q_List_Of_Q_Key_Sequence);

   type Q_Key_Sequence is new Ada.Finalization.Controlled with record
      Storage : aliased Internals.QKeySequence;
      Object  : Internals.QKeySequence_Access := null;
      Wrapper : Boolean := False;
   end record;

   overriding
   procedure Adjust (Self : in out Q_Key_Sequence);

   overriding
   procedure Finalize (Self : in out Q_Key_Sequence);

   overriding
   procedure Initialize (Self : in out Q_Key_Sequence);

end Qt4.Key_Sequences;
