with GNATCOM.IInterface;

with GNATCOM.Errors;

package body MSHTML.IDOMMSAnimationEvent_Interface is

   procedure Initialize (This : in out IDOMMSAnimationEvent_Type) is
   begin
      Set_IID (This, IID_IDOMMSAnimationEvent);
   end Initialize;

   function Pointer (This : IDOMMSAnimationEvent_Type)
     return Pointer_To_IDOMMSAnimationEvent
   is
   begin
      return To_Pointer_To_IDOMMSAnimationEvent (Address (This));
   end Pointer;

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

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

      return RetVal;
   end Get_animationName;

   function Get_elapsedTime
     (This : IDOMMSAnimationEvent_Type)
     return Interfaces.C.C_float
   is
       RetVal : aliased Interfaces.C.C_float;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Get_elapsedTime
         (Pointer (This),
          RetVal'Unchecked_Access));

      return RetVal;
   end Get_elapsedTime;

   procedure initMSAnimationEvent
     (This          : IDOMMSAnimationEvent_Type;
      eventType     : GNATCOM.Types.BSTR;
      canBubble     : GNATCOM.Types.VARIANT_BOOL;
      cancelable    : GNATCOM.Types.VARIANT_BOOL;
      animationName : GNATCOM.Types.BSTR;
      elapsedTime   : Interfaces.C.C_float;
      Free          : Boolean := True)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.initMSAnimationEvent
         (Pointer (This),
          eventType,
          canBubble,
          cancelable,
          animationName,
          elapsedTime));

      if Free then
               GNATCOM.IInterface.Free (eventType);
               GNATCOM.IInterface.Free (animationName);
      
      end if;

   end initMSAnimationEvent;

end MSHTML.IDOMMSAnimationEvent_Interface;

