with GNATCOM.IInterface;

with GNATCOM.Errors;

package body MSHTML.IHTMLFormElement_Interface is

   procedure Initialize (This : in out IHTMLFormElement_Type) is
   begin
      Set_IID (This, IID_IHTMLFormElement);
   end Initialize;

   function Pointer (This : IHTMLFormElement_Type)
     return Pointer_To_IHTMLFormElement
   is
   begin
      return To_Pointer_To_IHTMLFormElement (Address (This));
   end Pointer;

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

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

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

   end Put_action;

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

      return RetVal;
   end Get_action;

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

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

   end Put_dir;

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

      return RetVal;
   end Get_dir;

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

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

   end Put_encoding;

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

      return RetVal;
   end Get_encoding;

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

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

   end Put_method;

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

      return RetVal;
   end Get_method;

   function Get_elements
     (This : IHTMLFormElement_Type)
     return GNATCOM.Types.Pointer_To_IDispatch
   is
       RetVal : aliased GNATCOM.Types.Pointer_To_IDispatch;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Get_elements
         (Pointer (This),
          RetVal'Unchecked_Access));

      return RetVal;
   end Get_elements;

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

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

   end Put_target;

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

      return RetVal;
   end Get_target;

   procedure Put_name
     (This : IHTMLFormElement_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 : IHTMLFormElement_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;

   procedure Put_onsubmit
     (This : IHTMLFormElement_Type;
      p    : GNATCOM.Types.VARIANT;
      Free : Boolean := True)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Put_onsubmit
         (Pointer (This),
          p));

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

   end Put_onsubmit;

   function Get_onsubmit
     (This : IHTMLFormElement_Type)
     return GNATCOM.Types.VARIANT
   is
       RetVal : aliased GNATCOM.Types.VARIANT;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Get_onsubmit
         (Pointer (This),
          RetVal'Unchecked_Access));

      return RetVal;
   end Get_onsubmit;

   procedure Put_onreset
     (This : IHTMLFormElement_Type;
      p    : GNATCOM.Types.VARIANT;
      Free : Boolean := True)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Put_onreset
         (Pointer (This),
          p));

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

   end Put_onreset;

   function Get_onreset
     (This : IHTMLFormElement_Type)
     return GNATCOM.Types.VARIANT
   is
       RetVal : aliased GNATCOM.Types.VARIANT;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Get_onreset
         (Pointer (This),
          RetVal'Unchecked_Access));

      return RetVal;
   end Get_onreset;

   procedure submit
     (This : IHTMLFormElement_Type)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.submit
         (Pointer (This)));

   end submit;

   procedure reset
     (This : IHTMLFormElement_Type)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.reset
         (Pointer (This)));

   end reset;

   procedure Put_length
     (This : IHTMLFormElement_Type;
      p    : Interfaces.C.long)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Put_length
         (Pointer (This),
          p));

   end Put_length;

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

      return RetVal;
   end Get_length;

   function Getu_newEnum
     (This : IHTMLFormElement_Type)
     return GNATCOM.Types.Pointer_To_IUnknown
   is
       RetVal : aliased GNATCOM.Types.Pointer_To_IUnknown;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Getu_newEnum
         (Pointer (This),
          RetVal'Unchecked_Access));

      return RetVal;
   end Getu_newEnum;

   function item
     (This  : IHTMLFormElement_Type;
      name  : GNATCOM.Types.VARIANT  := GNATCOM.Types.VARIANT_MISSING;
      index : GNATCOM.Types.VARIANT  := GNATCOM.Types.VARIANT_MISSING;
      Free  : Boolean := True)
     return GNATCOM.Types.Pointer_To_IDispatch
   is
       RetVal : aliased GNATCOM.Types.Pointer_To_IDispatch;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.item
         (Pointer (This),
          name,
          index,
          RetVal'Unchecked_Access));

      if Free then
               GNATCOM.IInterface.Free (name);
               GNATCOM.IInterface.Free (index);
      
      end if;

      return RetVal;
   end item;

   function tags
     (This    : IHTMLFormElement_Type;
      tagName : GNATCOM.Types.VARIANT;
      Free    : Boolean := True)
     return GNATCOM.Types.Pointer_To_IDispatch
   is
       RetVal : aliased GNATCOM.Types.Pointer_To_IDispatch;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.tags
         (Pointer (This),
          tagName,
          RetVal'Unchecked_Access));

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

      return RetVal;
   end tags;

end MSHTML.IHTMLFormElement_Interface;

