with GNATCOM.IInterface;

with GNATCOM.Errors;

package body MSHTML.IHTMLVideoElement_Interface is

   procedure Initialize (This : in out IHTMLVideoElement_Type) is
   begin
      Set_IID (This, IID_IHTMLVideoElement);
   end Initialize;

   function Pointer (This : IHTMLVideoElement_Type)
     return Pointer_To_IHTMLVideoElement
   is
   begin
      return To_Pointer_To_IHTMLVideoElement (Address (This));
   end Pointer;

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

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

   end Put_width;

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

      return RetVal;
   end Get_width;

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

   end Put_height;

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

      return RetVal;
   end Get_height;

   function Get_videoWidth
     (This : IHTMLVideoElement_Type)
     return Interfaces.C.unsigned_long
   is
       RetVal : aliased Interfaces.C.unsigned_long;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Get_videoWidth
         (Pointer (This),
          RetVal'Unchecked_Access));

      return RetVal;
   end Get_videoWidth;

   function Get_videoHeight
     (This : IHTMLVideoElement_Type)
     return Interfaces.C.unsigned_long
   is
       RetVal : aliased Interfaces.C.unsigned_long;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Get_videoHeight
         (Pointer (This),
          RetVal'Unchecked_Access));

      return RetVal;
   end Get_videoHeight;

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

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

   end Put_poster;

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

      return RetVal;
   end Get_poster;

end MSHTML.IHTMLVideoElement_Interface;

