with GNATCOM.IInterface;

with GNATCOM.Errors;

package body MSHTML.IHTMLMapElement_Interface is

   procedure Initialize (This : in out IHTMLMapElement_Type) is
   begin
      Set_IID (This, IID_IHTMLMapElement);
   end Initialize;

   function Pointer (This : IHTMLMapElement_Type)
     return Pointer_To_IHTMLMapElement
   is
   begin
      return To_Pointer_To_IHTMLMapElement (Address (This));
   end Pointer;

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

   function Get_areas
     (This : IHTMLMapElement_Type)
     return Pointer_To_IHTMLAreasCollection
   is
       RetVal : aliased Pointer_To_IHTMLAreasCollection;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Get_areas
         (Pointer (This),
          RetVal'Unchecked_Access));

      return RetVal;
   end Get_areas;

   procedure Put_name
     (This : IHTMLMapElement_Type;
      p    : GNATCOM.Types.BSTR;
      Free : Boolean := True)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Put_name
         (Pointer (This),
          p));

      if Free then
               GNATCOM.IInterface.Free (p);
      
      end if;

   end Put_name;

   function Get_name
     (This : IHTMLMapElement_Type)
     return GNATCOM.Types.BSTR
   is
       RetVal : aliased GNATCOM.Types.BSTR;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Get_name
         (Pointer (This),
          RetVal'Unchecked_Access));

      return RetVal;
   end Get_name;

end MSHTML.IHTMLMapElement_Interface;

