/***************************************************************

This is a content filter for the CES system. Its function is to 
  provide text editing interface to the accumulator. mainly
  the ability to work with selection blocks.
  

 
 Dan, <Feb 19, 2002>

***************************************************************/

#ifndef _CONTENTFILTER

#define _CONTENTFILTER

#include "accumulator2.h"
#include "cestypes.h"

class ContentFilter {

 public:

  ContentFilter();
  
  // setup classes
  int       SetAccumulator  ( Accumulator * accum = NULL );
  long      SelectionStart  ( long newstart ) ;
  long      SelectionEnd    ( long newend   ) ;
  long      SelectionStart  ( void ) ;
  long      SelectionEnd    ( void ) ;
  long      SelectionSize   ( void ) ;
  
  // content search
  int       Seek            ( long offset, int whence );
  long      LinePos         ( void ) ;
  ChrOffset LineEnd         ( void ) ;
  ChrOffset NextLine        ( void ) ;
  ChrOffset PrevLine        ( void ) ;
  
  // content modify
  int       Putc            ( char inchar );
  int       Replace         ( char * buff ) ;
  
  // content retrieve 
  char *    Read            ( char * buff, int len );
   
  ~ContentFilter();
  
 private:
 
  int           blockStart  ;
  int           blockEnd    ;
  Accumulator * accumulator ;
  
  
};


#endif
