with GNATCOM.IInterface;

with GNATCOM.Errors;

package body MSHTML.IElementTraversal_Interface is

   procedure Initialize (This : in out IElementTraversal_Type) is
   begin
      Set_IID (This, IID_IElementTraversal);
   end Initialize;

   function Pointer (This : IElementTraversal_Type)
     return Pointer_To_IElementTraversal
   is
   begin
      return To_Pointer_To_IElementTraversal (Address (This));
   end Pointer;

   procedure Attach (This    : in out IElementTraversal_Type;
                     Pointer : in     Pointer_To_IElementTraversal)
   is
   begin
      Attach (This, GNATCOM.IInterface.To_Pointer_To_IUnknown
              (Pointer.all'Address));
   end Attach;

   function Get_firstElementChild
     (This : IElementTraversal_Type)
     return Pointer_To_IHTMLElement
   is
       RetVal : aliased Pointer_To_IHTMLElement;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Get_firstElementChild
         (Pointer (This),
          RetVal'Unchecked_Access));

      return RetVal;
   end Get_firstElementChild;

   function Get_lastElementChild
     (This : IElementTraversal_Type)
     return Pointer_To_IHTMLElement
   is
       RetVal : aliased Pointer_To_IHTMLElement;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Get_lastElementChild
         (Pointer (This),
          RetVal'Unchecked_Access));

      return RetVal;
   end Get_lastElementChild;

   function Get_previousElementSibling
     (This : IElementTraversal_Type)
     return Pointer_To_IHTMLElement
   is
       RetVal : aliased Pointer_To_IHTMLElement;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Get_previousElementSibling
         (Pointer (This),
          RetVal'Unchecked_Access));

      return RetVal;
   end Get_previousElementSibling;

   function Get_nextElementSibling
     (This : IElementTraversal_Type)
     return Pointer_To_IHTMLElement
   is
       RetVal : aliased Pointer_To_IHTMLElement;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Get_nextElementSibling
         (Pointer (This),
          RetVal'Unchecked_Access));

      return RetVal;
   end Get_nextElementSibling;

   function Get_childElementCount
     (This : IElementTraversal_Type)
     return Interfaces.C.long
   is
       RetVal : aliased Interfaces.C.long;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Get_childElementCount
         (Pointer (This),
          RetVal'Unchecked_Access));

      return RetVal;
   end Get_childElementCount;

end MSHTML.IElementTraversal_Interface;

