with GNATCOM.IInterface;

with GNATCOM.Errors;

package body MSHTML.IHTMLEmbedElement_Interface is

   procedure Initialize (This : in out IHTMLEmbedElement_Type) is
   begin
      Set_IID (This, IID_IHTMLEmbedElement);
   end Initialize;

   function Pointer (This : IHTMLEmbedElement_Type)
     return Pointer_To_IHTMLEmbedElement
   is
   begin
      return To_Pointer_To_IHTMLEmbedElement (Address (This));
   end Pointer;

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

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

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

   end Put_hidden;

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

      return RetVal;
   end Get_hidden;

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

      return RetVal;
   end Get_palette;

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

      return RetVal;
   end Get_pluginspage;

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

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

   end Put_src;

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

      return RetVal;
   end Get_src;

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

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

   end Put_units;

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

      return RetVal;
   end Get_units;

   procedure Put_name
     (This : IHTMLEmbedElement_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 : IHTMLEmbedElement_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_width
     (This : IHTMLEmbedElement_Type;
      p    : GNATCOM.Types.VARIANT;
      Free : Boolean := True)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Put_width
         (Pointer (This),
          p));

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

   end Put_width;

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

      return RetVal;
   end Get_width;

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

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

   end Put_height;

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

      return RetVal;
   end Get_height;

end MSHTML.IHTMLEmbedElement_Interface;

