with GNATCOM.IInterface;

with GNATCOM.Errors;

package body MSHTML.IClientCaps_Interface is

   procedure Initialize (This : in out IClientCaps_Type) is
   begin
      Set_IID (This, IID_IClientCaps);
   end Initialize;

   function Pointer (This : IClientCaps_Type)
     return Pointer_To_IClientCaps
   is
   begin
      return To_Pointer_To_IClientCaps (Address (This));
   end Pointer;

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

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

      return RetVal;
   end Get_javaEnabled;

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

      return RetVal;
   end Get_cookieEnabled;

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

      return RetVal;
   end Get_cpuClass;

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

      return RetVal;
   end Get_systemLanguage;

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

      return RetVal;
   end Get_userLanguage;

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

      return RetVal;
   end Get_platform;

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

      return RetVal;
   end Get_connectionSpeed;

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

      return RetVal;
   end Get_onLine;

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

      return RetVal;
   end Get_colorDepth;

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

      return RetVal;
   end Get_bufferDepth;

   function Get_width
     (This : IClientCaps_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;

   function Get_height
     (This : IClientCaps_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_availHeight
     (This : IClientCaps_Type)
     return Interfaces.C.long
   is
       RetVal : aliased Interfaces.C.long;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Get_availHeight
         (Pointer (This),
          RetVal'Unchecked_Access));

      return RetVal;
   end Get_availHeight;

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

      return RetVal;
   end Get_availWidth;

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

      return RetVal;
   end Get_connectionType;

   function isComponentInstalled
     (This     : IClientCaps_Type;
      bstrName : GNATCOM.Types.BSTR;
      bstrURL  : GNATCOM.Types.BSTR;
      bStrVer  : GNATCOM.Types.BSTR;
      Free     : Boolean := True)
     return GNATCOM.Types.VARIANT_BOOL
   is
       RetVal : aliased GNATCOM.Types.VARIANT_BOOL;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.isComponentInstalled
         (Pointer (This),
          bstrName,
          bstrURL,
          bStrVer,
          RetVal'Unchecked_Access));

      if Free then
               GNATCOM.IInterface.Free (bstrName);
               GNATCOM.IInterface.Free (bstrURL);
               GNATCOM.IInterface.Free (bStrVer);
      
      end if;

      return RetVal;
   end isComponentInstalled;

   function getComponentVersion
     (This     : IClientCaps_Type;
      bstrName : GNATCOM.Types.BSTR;
      bstrURL  : GNATCOM.Types.BSTR;
      Free     : Boolean := True)
     return GNATCOM.Types.BSTR
   is
       RetVal : aliased GNATCOM.Types.BSTR;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.getComponentVersion
         (Pointer (This),
          bstrName,
          bstrURL,
          RetVal'Unchecked_Access));

      if Free then
               GNATCOM.IInterface.Free (bstrName);
               GNATCOM.IInterface.Free (bstrURL);
      
      end if;

      return RetVal;
   end getComponentVersion;

   function compareVersions
     (This     : IClientCaps_Type;
      bstrVer1 : GNATCOM.Types.BSTR;
      bstrVer2 : GNATCOM.Types.BSTR;
      Free     : Boolean := True)
     return Interfaces.C.long
   is
       RetVal : aliased Interfaces.C.long;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.compareVersions
         (Pointer (This),
          bstrVer1,
          bstrVer2,
          RetVal'Unchecked_Access));

      if Free then
               GNATCOM.IInterface.Free (bstrVer1);
               GNATCOM.IInterface.Free (bstrVer2);
      
      end if;

      return RetVal;
   end compareVersions;

   procedure addComponentRequest
     (This     : IClientCaps_Type;
      bstrName : GNATCOM.Types.BSTR;
      bstrURL  : GNATCOM.Types.BSTR;
      bStrVer  : GNATCOM.Types.BSTR;
      Free     : Boolean := True)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.addComponentRequest
         (Pointer (This),
          bstrName,
          bstrURL,
          bStrVer));

      if Free then
               GNATCOM.IInterface.Free (bstrName);
               GNATCOM.IInterface.Free (bstrURL);
               GNATCOM.IInterface.Free (bStrVer);
      
      end if;

   end addComponentRequest;

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

      return RetVal;
   end doComponentRequest;

   procedure clearComponentRequest
     (This : IClientCaps_Type)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.clearComponentRequest
         (Pointer (This)));

   end clearComponentRequest;

end MSHTML.IClientCaps_Interface;

