with GNATCOM.IInterface;

with GNATCOM.Errors;

package body MSHTML.IHTMLSelectElement_Interface is

   procedure Initialize (This : in out IHTMLSelectElement_Type) is
   begin
      Set_IID (This, IID_IHTMLSelectElement);
   end Initialize;

   function Pointer (This : IHTMLSelectElement_Type)
     return Pointer_To_IHTMLSelectElement
   is
   begin
      return To_Pointer_To_IHTMLSelectElement (Address (This));
   end Pointer;

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

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

   end Put_size;

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

      return RetVal;
   end Get_size;

   procedure Put_multiple
     (This : IHTMLSelectElement_Type;
      p    : GNATCOM.Types.VARIANT_BOOL)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Put_multiple
         (Pointer (This),
          p));

   end Put_multiple;

   function Get_multiple
     (This : IHTMLSelectElement_Type)
     return GNATCOM.Types.VARIANT_BOOL
   is
       RetVal : aliased GNATCOM.Types.VARIANT_BOOL;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Get_multiple
         (Pointer (This),
          RetVal'Unchecked_Access));

      return RetVal;
   end Get_multiple;

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

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

      return RetVal;
   end Get_options;

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

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

   end Put_onchange;

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

      return RetVal;
   end Get_onchange;

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

   end Put_selectedIndex;

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

      return RetVal;
   end Get_selectedIndex;

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

      return RetVal;
   end Get_type;

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

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

   end Put_value;

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

      return RetVal;
   end Get_value;

   procedure Put_disabled
     (This : IHTMLSelectElement_Type;
      p    : GNATCOM.Types.VARIANT_BOOL)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Put_disabled
         (Pointer (This),
          p));

   end Put_disabled;

   function Get_disabled
     (This : IHTMLSelectElement_Type)
     return GNATCOM.Types.VARIANT_BOOL
   is
       RetVal : aliased GNATCOM.Types.VARIANT_BOOL;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Get_disabled
         (Pointer (This),
          RetVal'Unchecked_Access));

      return RetVal;
   end Get_disabled;

   function Get_form
     (This : IHTMLSelectElement_Type)
     return Pointer_To_IHTMLFormElement
   is
       RetVal : aliased Pointer_To_IHTMLFormElement;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Get_form
         (Pointer (This),
          RetVal'Unchecked_Access));

      return RetVal;
   end Get_form;

   procedure add
     (This    : IHTMLSelectElement_Type;
      element : Pointer_To_IHTMLElement;
      before  : GNATCOM.Types.VARIANT  := GNATCOM.Types.VARIANT_MISSING;
      Free    : Boolean := True)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.add
         (Pointer (This),
          element,
          before));

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

   end add;

   procedure remove
     (This  : IHTMLSelectElement_Type;
      index : Interfaces.C.long)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.remove
         (Pointer (This),
          index));

   end remove;

   procedure Put_length
     (This : IHTMLSelectElement_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 : IHTMLSelectElement_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 : IHTMLSelectElement_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  : IHTMLSelectElement_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    : IHTMLSelectElement_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.IHTMLSelectElement_Interface;

