with GNATCOM.IInterface;

with GNATCOM.Errors;

package body MSHTML.IDOMCompositionEvent_Interface is

   procedure Initialize (This : in out IDOMCompositionEvent_Type) is
   begin
      Set_IID (This, IID_IDOMCompositionEvent);
   end Initialize;

   function Pointer (This : IDOMCompositionEvent_Type)
     return Pointer_To_IDOMCompositionEvent
   is
   begin
      return To_Pointer_To_IDOMCompositionEvent (Address (This));
   end Pointer;

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

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

      return RetVal;
   end Get_data;

   procedure initCompositionEvent
     (This       : IDOMCompositionEvent_Type;
      eventType  : GNATCOM.Types.BSTR;
      canBubble  : GNATCOM.Types.VARIANT_BOOL;
      cancelable : GNATCOM.Types.VARIANT_BOOL;
      viewArg    : Pointer_To_IHTMLWindow2;
      data       : GNATCOM.Types.BSTR;
      locale     : GNATCOM.Types.BSTR;
      Free       : Boolean := True)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.initCompositionEvent
         (Pointer (This),
          eventType,
          canBubble,
          cancelable,
          viewArg,
          data,
          locale));

      if Free then
               GNATCOM.IInterface.Free (eventType);
               GNATCOM.IInterface.Free (data);
               GNATCOM.IInterface.Free (locale);
      
      end if;

   end initCompositionEvent;

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

      return RetVal;
   end Get_locale;

end MSHTML.IDOMCompositionEvent_Interface;

