with GNATCOM.IInterface;

with GNATCOM.Errors;

package body MSHTML.IDOMMSTransitionEvent_Interface is

   procedure Initialize (This : in out IDOMMSTransitionEvent_Type) is
   begin
      Set_IID (This, IID_IDOMMSTransitionEvent);
   end Initialize;

   function Pointer (This : IDOMMSTransitionEvent_Type)
     return Pointer_To_IDOMMSTransitionEvent
   is
   begin
      return To_Pointer_To_IDOMMSTransitionEvent (Address (This));
   end Pointer;

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

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

      return RetVal;
   end Get_propertyName;

   function Get_elapsedTime
     (This : IDOMMSTransitionEvent_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 initMSTransitionEvent
     (This         : IDOMMSTransitionEvent_Type;
      eventType    : GNATCOM.Types.BSTR;
      canBubble    : GNATCOM.Types.VARIANT_BOOL;
      cancelable   : GNATCOM.Types.VARIANT_BOOL;
      propertyName : GNATCOM.Types.BSTR;
      elapsedTime  : Interfaces.C.C_float;
      Free         : Boolean := True)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.initMSTransitionEvent
         (Pointer (This),
          eventType,
          canBubble,
          cancelable,
          propertyName,
          elapsedTime));

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

   end initMSTransitionEvent;

end MSHTML.IDOMMSTransitionEvent_Interface;

