with GNATCOM.IInterface;

with GNATCOM.Errors;

package body MSHTML.IHTMLControlElement_Interface is

   procedure Initialize (This : in out IHTMLControlElement_Type) is
   begin
      Set_IID (This, IID_IHTMLControlElement);
   end Initialize;

   function Pointer (This : IHTMLControlElement_Type)
     return Pointer_To_IHTMLControlElement
   is
   begin
      return To_Pointer_To_IHTMLControlElement (Address (This));
   end Pointer;

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

   procedure Put_tabIndex
     (This : IHTMLControlElement_Type;
      p    : Interfaces.C.short)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Put_tabIndex
         (Pointer (This),
          p));

   end Put_tabIndex;

   function Get_tabIndex
     (This : IHTMLControlElement_Type)
     return Interfaces.C.short
   is
       RetVal : aliased Interfaces.C.short;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Get_tabIndex
         (Pointer (This),
          RetVal'Unchecked_Access));

      return RetVal;
   end Get_tabIndex;

   procedure focus
     (This : IHTMLControlElement_Type)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.focus
         (Pointer (This)));

   end focus;

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

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

   end Put_accessKey;

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

      return RetVal;
   end Get_accessKey;

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

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

   end Put_onblur;

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

      return RetVal;
   end Get_onblur;

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

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

   end Put_onfocus;

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

      return RetVal;
   end Get_onfocus;

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

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

   end Put_onresize;

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

      return RetVal;
   end Get_onresize;

   procedure blur
     (This : IHTMLControlElement_Type)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.blur
         (Pointer (This)));

   end blur;

   procedure addFilter
     (This : IHTMLControlElement_Type;
      pUnk : GNATCOM.Types.Pointer_To_IUnknown)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.addFilter
         (Pointer (This),
          pUnk));

   end addFilter;

   procedure removeFilter
     (This : IHTMLControlElement_Type;
      pUnk : GNATCOM.Types.Pointer_To_IUnknown)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.removeFilter
         (Pointer (This),
          pUnk));

   end removeFilter;

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

      return RetVal;
   end Get_clientHeight;

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

      return RetVal;
   end Get_clientWidth;

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

      return RetVal;
   end Get_clientTop;

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

      return RetVal;
   end Get_clientLeft;

end MSHTML.IHTMLControlElement_Interface;

