with GNATCOM.IInterface;

with GNATCOM.Errors;

package body MSHTML.IHTMLAppBehavior2_Interface is

   procedure Initialize (This : in out IHTMLAppBehavior2_Type) is
   begin
      Set_IID (This, IID_IHTMLAppBehavior2);
   end Initialize;

   function Pointer (This : IHTMLAppBehavior2_Type)
     return Pointer_To_IHTMLAppBehavior2
   is
   begin
      return To_Pointer_To_IHTMLAppBehavior2 (Address (This));
   end Pointer;

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

   procedure Put_contextMenu
     (This : IHTMLAppBehavior2_Type;
      p    : GNATCOM.Types.BSTR;
      Free : Boolean := True)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Put_contextMenu
         (Pointer (This),
          p));

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

   end Put_contextMenu;

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

      return RetVal;
   end Get_contextMenu;

   procedure Put_innerBorder
     (This : IHTMLAppBehavior2_Type;
      p    : GNATCOM.Types.BSTR;
      Free : Boolean := True)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Put_innerBorder
         (Pointer (This),
          p));

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

   end Put_innerBorder;

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

      return RetVal;
   end Get_innerBorder;

   procedure Put_scroll
     (This : IHTMLAppBehavior2_Type;
      p    : GNATCOM.Types.BSTR;
      Free : Boolean := True)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Put_scroll
         (Pointer (This),
          p));

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

   end Put_scroll;

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

      return RetVal;
   end Get_scroll;

   procedure Put_scrollFlat
     (This : IHTMLAppBehavior2_Type;
      p    : GNATCOM.Types.BSTR;
      Free : Boolean := True)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Put_scrollFlat
         (Pointer (This),
          p));

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

   end Put_scrollFlat;

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

      return RetVal;
   end Get_scrollFlat;

   procedure Put_selection
     (This : IHTMLAppBehavior2_Type;
      p    : GNATCOM.Types.BSTR;
      Free : Boolean := True)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Put_selection
         (Pointer (This),
          p));

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

   end Put_selection;

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

      return RetVal;
   end Get_selection;

end MSHTML.IHTMLAppBehavior2_Interface;

