#ifndef __PRINTWIN_H
#define __PRINTWIN_H

#ifndef __WINDOW_H
#include <window.h>
#endif

#ifndef __ARRAY_H
#include <array.h>
#endif

#ifndef __TEXT_H
#include <text.h>
#endif

class TPrintwin : public TWindow
{                 

  bool       _aborted;
  bool       _isbackground;
  PRINT_RCD* _printrcd;   
  int        _formlen;
  int        _formwidth;
  TArray*    _bg;
  TTextfile& _txt;
  
  int        _lead,  _ascent, _descent;
  int        _hofs,  _vofs;
  int        _chary;           
  int        _char_size;
  bool       _inited;
  
  void paint_background(long j);
  void paint_row(long j);                        
  bool print_band(int, RCT&);

public:                  
  
  // check if aborted; also returned by do_print
  bool aborted() const { return _aborted; }
  
  // inhibits background printing       
  void print_background(bool b) { _isbackground = b; }
  
  // starts printing; FALSE if aborted
  bool do_print();
  
  TPrintwin(PRINT_RCD* pr, TTextfile& txt, int chsize = 12);
  virtual ~TPrintwin(); 
};      


#endif   
