with GNATCOM.Errors;

package body MSHTML.IElementBehaviorSiteOM2_Interface is

   procedure Initialize (This : in out IElementBehaviorSiteOM2_Type) is
   begin
      Set_IID (This, IID_IElementBehaviorSiteOM2);
   end Initialize;

   function Pointer (This : IElementBehaviorSiteOM2_Type)
     return Pointer_To_IElementBehaviorSiteOM2
   is
   begin
      return To_Pointer_To_IElementBehaviorSiteOM2 (Address (This));
   end Pointer;

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

   function RegisterEvent
     (This     : IElementBehaviorSiteOM2_Type;
      pchEvent : GNATCOM.Types.LPWSTR;
      lFlags   : Interfaces.C.long)
     return Interfaces.C.long
   is
       RetVal : aliased Interfaces.C.long;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.RegisterEvent
         (Pointer (This),
          pchEvent,
          lFlags,
          RetVal'Unchecked_Access));

      return RetVal;
   end RegisterEvent;

   function GetEventCookie
     (This     : IElementBehaviorSiteOM2_Type;
      pchEvent : GNATCOM.Types.LPWSTR)
     return Interfaces.C.long
   is
       RetVal : aliased Interfaces.C.long;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.GetEventCookie
         (Pointer (This),
          pchEvent,
          RetVal'Unchecked_Access));

      return RetVal;
   end GetEventCookie;

   procedure FireEvent
     (This         : IElementBehaviorSiteOM2_Type;
      lCookie      : Interfaces.C.long;
      pEventObject : Pointer_To_IHTMLEventObj)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.FireEvent
         (Pointer (This),
          lCookie,
          pEventObject));

   end FireEvent;

   function CreateEventObject
     (This          : IElementBehaviorSiteOM2_Type)
     return Pointer_To_IHTMLEventObj
   is
       RetVal : aliased Pointer_To_IHTMLEventObj;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.CreateEventObject
         (Pointer (This),
          RetVal'Unchecked_Access));

      return RetVal;
   end CreateEventObject;

   procedure RegisterName
     (This    : IElementBehaviorSiteOM2_Type;
      pchName : GNATCOM.Types.LPWSTR)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.RegisterName
         (Pointer (This),
          pchName));

   end RegisterName;

   procedure RegisterUrn
     (This   : IElementBehaviorSiteOM2_Type;
      pchUrn : GNATCOM.Types.LPWSTR)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.RegisterUrn
         (Pointer (This),
          pchUrn));

   end RegisterUrn;

   function GetDefaults
     (This       : IElementBehaviorSiteOM2_Type)
     return Pointer_To_IHTMLElementDefaults
   is
       RetVal : aliased Pointer_To_IHTMLElementDefaults;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.GetDefaults
         (Pointer (This),
          RetVal'Unchecked_Access));

      return RetVal;
   end GetDefaults;

end MSHTML.IElementBehaviorSiteOM2_Interface;

