with GNATCOM.Errors;

package body MSHTML.IMarkupServices2_Interface is

   procedure Initialize (This : in out IMarkupServices2_Type) is
   begin
      Set_IID (This, IID_IMarkupServices2);
   end Initialize;

   function Pointer (This : IMarkupServices2_Type)
     return Pointer_To_IMarkupServices2
   is
   begin
      return To_Pointer_To_IMarkupServices2 (Address (This));
   end Pointer;

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

   procedure CreateMarkupPointer
     (This      : IMarkupServices2_Type;
      ppPointer : Pointer_To_Pointer_To_IMarkupPointer)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.CreateMarkupPointer
         (Pointer (This),
          ppPointer));

   end CreateMarkupPointer;

   procedure CreateMarkupContainer
     (This              : IMarkupServices2_Type;
      ppMarkupContainer : Pointer_To_Pointer_To_IMarkupContainer)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.CreateMarkupContainer
         (Pointer (This),
          ppMarkupContainer));

   end CreateMarkupContainer;

   procedure createElement
     (This          : IMarkupServices2_Type;
      tagID         : uELEMENT_TAG_ID;
      pchAttributes : GNATCOM.Types.Pointer_To_unsigned_short;
      ppElement     : Pointer_To_Pointer_To_IHTMLElement)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.createElement
         (Pointer (This),
          tagID,
          pchAttributes,
          ppElement));

   end createElement;

   procedure CloneElement
     (This              : IMarkupServices2_Type;
      pElemCloneThis    : Pointer_To_IHTMLElement;
      ppElementTheClone : Pointer_To_Pointer_To_IHTMLElement)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.CloneElement
         (Pointer (This),
          pElemCloneThis,
          ppElementTheClone));

   end CloneElement;

   procedure InsertElement
     (This           : IMarkupServices2_Type;
      pElementInsert : Pointer_To_IHTMLElement;
      pPointerStart  : Pointer_To_IMarkupPointer;
      pPointerFinish : Pointer_To_IMarkupPointer)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.InsertElement
         (Pointer (This),
          pElementInsert,
          pPointerStart,
          pPointerFinish));

   end InsertElement;

   procedure RemoveElement
     (This           : IMarkupServices2_Type;
      pElementRemove : Pointer_To_IHTMLElement)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.RemoveElement
         (Pointer (This),
          pElementRemove));

   end RemoveElement;

   procedure remove
     (This           : IMarkupServices2_Type;
      pPointerStart  : Pointer_To_IMarkupPointer;
      pPointerFinish : Pointer_To_IMarkupPointer)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.remove
         (Pointer (This),
          pPointerStart,
          pPointerFinish));

   end remove;

   procedure Copy
     (This                 : IMarkupServices2_Type;
      pPointerSourceStart  : Pointer_To_IMarkupPointer;
      pPointerSourceFinish : Pointer_To_IMarkupPointer;
      pPointerTarget       : Pointer_To_IMarkupPointer)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Copy
         (Pointer (This),
          pPointerSourceStart,
          pPointerSourceFinish,
          pPointerTarget));

   end Copy;

   procedure move
     (This                 : IMarkupServices2_Type;
      pPointerSourceStart  : Pointer_To_IMarkupPointer;
      pPointerSourceFinish : Pointer_To_IMarkupPointer;
      pPointerTarget       : Pointer_To_IMarkupPointer)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.move
         (Pointer (This),
          pPointerSourceStart,
          pPointerSourceFinish,
          pPointerTarget));

   end move;

   procedure InsertText
     (This           : IMarkupServices2_Type;
      pchText        : GNATCOM.Types.Pointer_To_unsigned_short;
      cch            : Interfaces.C.long;
      pPointerTarget : Pointer_To_IMarkupPointer)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.InsertText
         (Pointer (This),
          pchText,
          cch,
          pPointerTarget));

   end InsertText;

   procedure ParseString
     (This              : IMarkupServices2_Type;
      pchHTML           : GNATCOM.Types.Pointer_To_unsigned_short;
      dwFlags           : Interfaces.C.unsigned_long;
      ppContainerResult : Pointer_To_Pointer_To_IMarkupContainer;
      ppPointerStart    : Pointer_To_IMarkupPointer;
      ppPointerFinish   : Pointer_To_IMarkupPointer)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.ParseString
         (Pointer (This),
          pchHTML,
          dwFlags,
          ppContainerResult,
          ppPointerStart,
          ppPointerFinish));

   end ParseString;

   procedure ParseGlobal
     (This              : IMarkupServices2_Type;
      hglobalHTML       : wireHGLOBAL;
      dwFlags           : Interfaces.C.unsigned_long;
      ppContainerResult : Pointer_To_Pointer_To_IMarkupContainer;
      pPointerStart     : Pointer_To_IMarkupPointer;
      pPointerFinish    : Pointer_To_IMarkupPointer)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.ParseGlobal
         (Pointer (This),
          hglobalHTML,
          dwFlags,
          ppContainerResult,
          pPointerStart,
          pPointerFinish));

   end ParseGlobal;

   procedure IsScopedElement
     (This     : IMarkupServices2_Type;
      pElement : Pointer_To_IHTMLElement;
      pfScoped : GNATCOM.Types.Pointer_To_long)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.IsScopedElement
         (Pointer (This),
          pElement,
          pfScoped));

   end IsScopedElement;

   procedure GetElementTagId
     (This     : IMarkupServices2_Type;
      pElement : Pointer_To_IHTMLElement;
      ptagId   : Pointer_To_uELEMENT_TAG_ID)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.GetElementTagId
         (Pointer (This),
          pElement,
          ptagId));

   end GetElementTagId;

   procedure GetTagIDForName
     (This     : IMarkupServices2_Type;
      bstrName : GNATCOM.Types.BSTR;
      ptagId   : Pointer_To_uELEMENT_TAG_ID;
      Free     : Boolean := True)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.GetTagIDForName
         (Pointer (This),
          bstrName,
          ptagId));

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

   end GetTagIDForName;

   procedure GetNameForTagID
     (This      : IMarkupServices2_Type;
      tagID     : uELEMENT_TAG_ID;
      pbstrName : GNATCOM.Types.Pointer_To_BSTR)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.GetNameForTagID
         (Pointer (This),
          tagID,
          pbstrName));

   end GetNameForTagID;

   procedure MovePointersToRange
     (This           : IMarkupServices2_Type;
      pIRange        : Pointer_To_IHTMLTxtRange;
      pPointerStart  : Pointer_To_IMarkupPointer;
      pPointerFinish : Pointer_To_IMarkupPointer)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.MovePointersToRange
         (Pointer (This),
          pIRange,
          pPointerStart,
          pPointerFinish));

   end MovePointersToRange;

   procedure MoveRangeToPointers
     (This           : IMarkupServices2_Type;
      pPointerStart  : Pointer_To_IMarkupPointer;
      pPointerFinish : Pointer_To_IMarkupPointer;
      pIRange        : Pointer_To_IHTMLTxtRange)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.MoveRangeToPointers
         (Pointer (This),
          pPointerStart,
          pPointerFinish,
          pIRange));

   end MoveRangeToPointers;

   procedure BeginUndoUnit
     (This     : IMarkupServices2_Type;
      pchTitle : GNATCOM.Types.Pointer_To_unsigned_short)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.BeginUndoUnit
         (Pointer (This),
          pchTitle));

   end BeginUndoUnit;

   procedure EndUndoUnit
     (This : IMarkupServices2_Type)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.EndUndoUnit
         (Pointer (This)));

   end EndUndoUnit;

   procedure ParseGlobalEx
     (This              : IMarkupServices2_Type;
      hglobalHTML       : wireHGLOBAL;
      dwFlags           : Interfaces.C.unsigned_long;
      pContext          : Pointer_To_IMarkupContainer;
      ppContainerResult : Pointer_To_Pointer_To_IMarkupContainer;
      pPointerStart     : Pointer_To_IMarkupPointer;
      pPointerFinish    : Pointer_To_IMarkupPointer)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.ParseGlobalEx
         (Pointer (This),
          hglobalHTML,
          dwFlags,
          pContext,
          ppContainerResult,
          pPointerStart,
          pPointerFinish));

   end ParseGlobalEx;

   procedure ValidateElements
     (This             : IMarkupServices2_Type;
      pPointerStart    : Pointer_To_IMarkupPointer;
      pPointerFinish   : Pointer_To_IMarkupPointer;
      pPointerTarget   : Pointer_To_IMarkupPointer;
      pPointerStatus   : Pointer_To_IMarkupPointer;
      ppElemFailBottom : Pointer_To_Pointer_To_IHTMLElement;
      ppElemFailTop    : Pointer_To_Pointer_To_IHTMLElement)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.ValidateElements
         (Pointer (This),
          pPointerStart,
          pPointerFinish,
          pPointerTarget,
          pPointerStatus,
          ppElemFailBottom,
          ppElemFailTop));

   end ValidateElements;

   procedure SaveSegmentsToClipboard
     (This         : IMarkupServices2_Type;
      pSegmentList : Pointer_To_ISegmentList;
      dwFlags      : Interfaces.C.unsigned_long)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.SaveSegmentsToClipboard
         (Pointer (This),
          pSegmentList,
          dwFlags));

   end SaveSegmentsToClipboard;

end MSHTML.IMarkupServices2_Interface;

