with GNATCOM.IInterface;

with GNATCOM.Errors;

package body MSHTML.ITemplatePrinter_Interface is

   procedure Initialize (This : in out ITemplatePrinter_Type) is
   begin
      Set_IID (This, IID_ITemplatePrinter);
   end Initialize;

   function Pointer (This : ITemplatePrinter_Type)
     return Pointer_To_ITemplatePrinter
   is
   begin
      return To_Pointer_To_ITemplatePrinter (Address (This));
   end Pointer;

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

   function startDoc
     (This      : ITemplatePrinter_Type;
      bstrTitle : GNATCOM.Types.BSTR;
      Free      : Boolean := True)
     return GNATCOM.Types.VARIANT_BOOL
   is
       RetVal : aliased GNATCOM.Types.VARIANT_BOOL;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.startDoc
         (Pointer (This),
          bstrTitle,
          RetVal'Unchecked_Access));

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

      return RetVal;
   end startDoc;

   procedure stopDoc
     (This : ITemplatePrinter_Type)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.stopDoc
         (Pointer (This)));

   end stopDoc;

   procedure printBlankPage
     (This : ITemplatePrinter_Type)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.printBlankPage
         (Pointer (This)));

   end printBlankPage;

   procedure printPage
     (This      : ITemplatePrinter_Type;
      pElemDisp : GNATCOM.Types.Pointer_To_IDispatch)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.printPage
         (Pointer (This),
          pElemDisp));

   end printPage;

   function ensurePrintDialogDefaults
     (This : ITemplatePrinter_Type)
     return GNATCOM.Types.VARIANT_BOOL
   is
       RetVal : aliased GNATCOM.Types.VARIANT_BOOL;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.ensurePrintDialogDefaults
         (Pointer (This),
          RetVal'Unchecked_Access));

      return RetVal;
   end ensurePrintDialogDefaults;

   function showPrintDialog
     (This : ITemplatePrinter_Type)
     return GNATCOM.Types.VARIANT_BOOL
   is
       RetVal : aliased GNATCOM.Types.VARIANT_BOOL;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.showPrintDialog
         (Pointer (This),
          RetVal'Unchecked_Access));

      return RetVal;
   end showPrintDialog;

   function showPageSetupDialog
     (This : ITemplatePrinter_Type)
     return GNATCOM.Types.VARIANT_BOOL
   is
       RetVal : aliased GNATCOM.Types.VARIANT_BOOL;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.showPageSetupDialog
         (Pointer (This),
          RetVal'Unchecked_Access));

      return RetVal;
   end showPageSetupDialog;

   function printNonNative
     (This    : ITemplatePrinter_Type;
      pMarkup : GNATCOM.Types.Pointer_To_IUnknown)
     return GNATCOM.Types.VARIANT_BOOL
   is
       RetVal : aliased GNATCOM.Types.VARIANT_BOOL;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.printNonNative
         (Pointer (This),
          pMarkup,
          RetVal'Unchecked_Access));

      return RetVal;
   end printNonNative;

   procedure printNonNativeFrames
     (This         : ITemplatePrinter_Type;
      pMarkup      : GNATCOM.Types.Pointer_To_IUnknown;
      fActiveFrame : GNATCOM.Types.VARIANT_BOOL)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.printNonNativeFrames
         (Pointer (This),
          pMarkup,
          fActiveFrame));

   end printNonNativeFrames;

   procedure Put_framesetDocument
     (This : ITemplatePrinter_Type;
      p    : GNATCOM.Types.VARIANT_BOOL)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Put_framesetDocument
         (Pointer (This),
          p));

   end Put_framesetDocument;

   function Get_framesetDocument
     (This : ITemplatePrinter_Type)
     return GNATCOM.Types.VARIANT_BOOL
   is
       RetVal : aliased GNATCOM.Types.VARIANT_BOOL;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Get_framesetDocument
         (Pointer (This),
          RetVal'Unchecked_Access));

      return RetVal;
   end Get_framesetDocument;

   procedure Put_frameActive
     (This : ITemplatePrinter_Type;
      p    : GNATCOM.Types.VARIANT_BOOL)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Put_frameActive
         (Pointer (This),
          p));

   end Put_frameActive;

   function Get_frameActive
     (This : ITemplatePrinter_Type)
     return GNATCOM.Types.VARIANT_BOOL
   is
       RetVal : aliased GNATCOM.Types.VARIANT_BOOL;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Get_frameActive
         (Pointer (This),
          RetVal'Unchecked_Access));

      return RetVal;
   end Get_frameActive;

   procedure Put_frameAsShown
     (This : ITemplatePrinter_Type;
      p    : GNATCOM.Types.VARIANT_BOOL)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Put_frameAsShown
         (Pointer (This),
          p));

   end Put_frameAsShown;

   function Get_frameAsShown
     (This : ITemplatePrinter_Type)
     return GNATCOM.Types.VARIANT_BOOL
   is
       RetVal : aliased GNATCOM.Types.VARIANT_BOOL;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Get_frameAsShown
         (Pointer (This),
          RetVal'Unchecked_Access));

      return RetVal;
   end Get_frameAsShown;

   procedure Put_selection
     (This : ITemplatePrinter_Type;
      p    : GNATCOM.Types.VARIANT_BOOL)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Put_selection
         (Pointer (This),
          p));

   end Put_selection;

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

      return RetVal;
   end Get_selection;

   procedure Put_selectedPages
     (This : ITemplatePrinter_Type;
      p    : GNATCOM.Types.VARIANT_BOOL)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Put_selectedPages
         (Pointer (This),
          p));

   end Put_selectedPages;

   function Get_selectedPages
     (This : ITemplatePrinter_Type)
     return GNATCOM.Types.VARIANT_BOOL
   is
       RetVal : aliased GNATCOM.Types.VARIANT_BOOL;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Get_selectedPages
         (Pointer (This),
          RetVal'Unchecked_Access));

      return RetVal;
   end Get_selectedPages;

   procedure Put_currentPage
     (This : ITemplatePrinter_Type;
      p    : GNATCOM.Types.VARIANT_BOOL)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Put_currentPage
         (Pointer (This),
          p));

   end Put_currentPage;

   function Get_currentPage
     (This : ITemplatePrinter_Type)
     return GNATCOM.Types.VARIANT_BOOL
   is
       RetVal : aliased GNATCOM.Types.VARIANT_BOOL;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Get_currentPage
         (Pointer (This),
          RetVal'Unchecked_Access));

      return RetVal;
   end Get_currentPage;

   procedure Put_currentPageAvail
     (This : ITemplatePrinter_Type;
      p    : GNATCOM.Types.VARIANT_BOOL)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Put_currentPageAvail
         (Pointer (This),
          p));

   end Put_currentPageAvail;

   function Get_currentPageAvail
     (This : ITemplatePrinter_Type)
     return GNATCOM.Types.VARIANT_BOOL
   is
       RetVal : aliased GNATCOM.Types.VARIANT_BOOL;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Get_currentPageAvail
         (Pointer (This),
          RetVal'Unchecked_Access));

      return RetVal;
   end Get_currentPageAvail;

   procedure Put_collate
     (This : ITemplatePrinter_Type;
      p    : GNATCOM.Types.VARIANT_BOOL)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Put_collate
         (Pointer (This),
          p));

   end Put_collate;

   function Get_collate
     (This : ITemplatePrinter_Type)
     return GNATCOM.Types.VARIANT_BOOL
   is
       RetVal : aliased GNATCOM.Types.VARIANT_BOOL;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Get_collate
         (Pointer (This),
          RetVal'Unchecked_Access));

      return RetVal;
   end Get_collate;

   function Get_duplex
     (This : ITemplatePrinter_Type)
     return GNATCOM.Types.VARIANT_BOOL
   is
       RetVal : aliased GNATCOM.Types.VARIANT_BOOL;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Get_duplex
         (Pointer (This),
          RetVal'Unchecked_Access));

      return RetVal;
   end Get_duplex;

   procedure Put_copies
     (This : ITemplatePrinter_Type;
      p    : Interfaces.C.unsigned_short)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Put_copies
         (Pointer (This),
          p));

   end Put_copies;

   function Get_copies
     (This : ITemplatePrinter_Type)
     return Interfaces.C.unsigned_short
   is
       RetVal : aliased Interfaces.C.unsigned_short;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Get_copies
         (Pointer (This),
          RetVal'Unchecked_Access));

      return RetVal;
   end Get_copies;

   procedure Put_pageFrom
     (This : ITemplatePrinter_Type;
      p    : Interfaces.C.unsigned_short)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Put_pageFrom
         (Pointer (This),
          p));

   end Put_pageFrom;

   function Get_pageFrom
     (This : ITemplatePrinter_Type)
     return Interfaces.C.unsigned_short
   is
       RetVal : aliased Interfaces.C.unsigned_short;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Get_pageFrom
         (Pointer (This),
          RetVal'Unchecked_Access));

      return RetVal;
   end Get_pageFrom;

   procedure Put_pageTo
     (This : ITemplatePrinter_Type;
      p    : Interfaces.C.unsigned_short)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Put_pageTo
         (Pointer (This),
          p));

   end Put_pageTo;

   function Get_pageTo
     (This : ITemplatePrinter_Type)
     return Interfaces.C.unsigned_short
   is
       RetVal : aliased Interfaces.C.unsigned_short;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Get_pageTo
         (Pointer (This),
          RetVal'Unchecked_Access));

      return RetVal;
   end Get_pageTo;

   procedure Put_tableOfLinks
     (This : ITemplatePrinter_Type;
      p    : GNATCOM.Types.VARIANT_BOOL)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Put_tableOfLinks
         (Pointer (This),
          p));

   end Put_tableOfLinks;

   function Get_tableOfLinks
     (This : ITemplatePrinter_Type)
     return GNATCOM.Types.VARIANT_BOOL
   is
       RetVal : aliased GNATCOM.Types.VARIANT_BOOL;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Get_tableOfLinks
         (Pointer (This),
          RetVal'Unchecked_Access));

      return RetVal;
   end Get_tableOfLinks;

   procedure Put_allLinkedDocuments
     (This : ITemplatePrinter_Type;
      p    : GNATCOM.Types.VARIANT_BOOL)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Put_allLinkedDocuments
         (Pointer (This),
          p));

   end Put_allLinkedDocuments;

   function Get_allLinkedDocuments
     (This : ITemplatePrinter_Type)
     return GNATCOM.Types.VARIANT_BOOL
   is
       RetVal : aliased GNATCOM.Types.VARIANT_BOOL;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Get_allLinkedDocuments
         (Pointer (This),
          RetVal'Unchecked_Access));

      return RetVal;
   end Get_allLinkedDocuments;

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

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

   end Put_header;

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

      return RetVal;
   end Get_header;

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

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

   end Put_footer;

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

      return RetVal;
   end Get_footer;

   procedure Put_marginLeft
     (This : ITemplatePrinter_Type;
      p    : Interfaces.C.long)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Put_marginLeft
         (Pointer (This),
          p));

   end Put_marginLeft;

   function Get_marginLeft
     (This : ITemplatePrinter_Type)
     return Interfaces.C.long
   is
       RetVal : aliased Interfaces.C.long;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Get_marginLeft
         (Pointer (This),
          RetVal'Unchecked_Access));

      return RetVal;
   end Get_marginLeft;

   procedure Put_marginRight
     (This : ITemplatePrinter_Type;
      p    : Interfaces.C.long)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Put_marginRight
         (Pointer (This),
          p));

   end Put_marginRight;

   function Get_marginRight
     (This : ITemplatePrinter_Type)
     return Interfaces.C.long
   is
       RetVal : aliased Interfaces.C.long;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Get_marginRight
         (Pointer (This),
          RetVal'Unchecked_Access));

      return RetVal;
   end Get_marginRight;

   procedure Put_marginTop
     (This : ITemplatePrinter_Type;
      p    : Interfaces.C.long)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Put_marginTop
         (Pointer (This),
          p));

   end Put_marginTop;

   function Get_marginTop
     (This : ITemplatePrinter_Type)
     return Interfaces.C.long
   is
       RetVal : aliased Interfaces.C.long;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Get_marginTop
         (Pointer (This),
          RetVal'Unchecked_Access));

      return RetVal;
   end Get_marginTop;

   procedure Put_marginBottom
     (This : ITemplatePrinter_Type;
      p    : Interfaces.C.long)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Put_marginBottom
         (Pointer (This),
          p));

   end Put_marginBottom;

   function Get_marginBottom
     (This : ITemplatePrinter_Type)
     return Interfaces.C.long
   is
       RetVal : aliased Interfaces.C.long;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Get_marginBottom
         (Pointer (This),
          RetVal'Unchecked_Access));

      return RetVal;
   end Get_marginBottom;

   function Get_pageWidth
     (This : ITemplatePrinter_Type)
     return Interfaces.C.long
   is
       RetVal : aliased Interfaces.C.long;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Get_pageWidth
         (Pointer (This),
          RetVal'Unchecked_Access));

      return RetVal;
   end Get_pageWidth;

   function Get_pageHeight
     (This : ITemplatePrinter_Type)
     return Interfaces.C.long
   is
       RetVal : aliased Interfaces.C.long;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Get_pageHeight
         (Pointer (This),
          RetVal'Unchecked_Access));

      return RetVal;
   end Get_pageHeight;

   function Get_unprintableLeft
     (This : ITemplatePrinter_Type)
     return Interfaces.C.long
   is
       RetVal : aliased Interfaces.C.long;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Get_unprintableLeft
         (Pointer (This),
          RetVal'Unchecked_Access));

      return RetVal;
   end Get_unprintableLeft;

   function Get_unprintableTop
     (This : ITemplatePrinter_Type)
     return Interfaces.C.long
   is
       RetVal : aliased Interfaces.C.long;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Get_unprintableTop
         (Pointer (This),
          RetVal'Unchecked_Access));

      return RetVal;
   end Get_unprintableTop;

   function Get_unprintableRight
     (This : ITemplatePrinter_Type)
     return Interfaces.C.long
   is
       RetVal : aliased Interfaces.C.long;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Get_unprintableRight
         (Pointer (This),
          RetVal'Unchecked_Access));

      return RetVal;
   end Get_unprintableRight;

   function Get_unprintableBottom
     (This : ITemplatePrinter_Type)
     return Interfaces.C.long
   is
       RetVal : aliased Interfaces.C.long;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Get_unprintableBottom
         (Pointer (This),
          RetVal'Unchecked_Access));

      return RetVal;
   end Get_unprintableBottom;

   procedure updatePageStatus
     (This : ITemplatePrinter_Type;
      p    : GNATCOM.Types.Pointer_To_long)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.updatePageStatus
         (Pointer (This),
          p));

   end updatePageStatus;

end MSHTML.ITemplatePrinter_Interface;

