with GNATCOM.IInterface;

with GNATCOM.Errors;

package body MSHTML.IHTCPropertyBehavior_Interface is

   procedure Initialize (This : in out IHTCPropertyBehavior_Type) is
   begin
      Set_IID (This, IID_IHTCPropertyBehavior);
   end Initialize;

   function Pointer (This : IHTCPropertyBehavior_Type)
     return Pointer_To_IHTCPropertyBehavior
   is
   begin
      return To_Pointer_To_IHTCPropertyBehavior (Address (This));
   end Pointer;

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

   procedure fireChange
     (This : IHTCPropertyBehavior_Type)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.fireChange
         (Pointer (This)));

   end fireChange;

   procedure Put_value
     (This : IHTCPropertyBehavior_Type;
      p    : GNATCOM.Types.VARIANT;
      Free : Boolean := True)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Put_value
         (Pointer (This),
          p));

      if Free then
               GNATCOM.IInterface.Free (p);
      
      end if;

   end Put_value;

   function Get_value
     (This : IHTCPropertyBehavior_Type)
     return GNATCOM.Types.VARIANT
   is
       RetVal : aliased GNATCOM.Types.VARIANT;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Get_value
         (Pointer (This),
          RetVal'Unchecked_Access));

      return RetVal;
   end Get_value;

end MSHTML.IHTCPropertyBehavior_Interface;

