home *** CD-ROM | disk | FTP | other *** search
/ The Developer Connection…ice Driver Kit for OS/2 3 / DEV3-D1.ISO / devtools / toolkt21 / c / samples / tp / txtep.csc < prev    next >
Encoding:
Text File  |  1993-03-12  |  2.9 KB  |  99 lines

  1. #   @(#)txtep.csc 1.3 1/22/92 16:11:53 [1/26/92] (c)IBM Corp. 1992
  2.  
  3. -- This class is adapted from the book
  4. --   Class Construction in C and C++, Object Oriented Fundamentals
  5. --   by Roger Sessions, Copyright (c) 1992 Prentice Hall.
  6. -- Reprinted with permission.
  7.  
  8. include "ep.sc"
  9.  
  10. class: txtEnvProcessor,
  11.   local;
  12.  
  13. parent: envProcessor;
  14.  
  15. /*
  16. ----------------------------------------------------
  17.   Class: txtEnvProcessor
  18.  
  19. Purpose: This is the primary definition of a text processing
  20.      environment.  As written, this creates left-justified
  21.      text.    Other text processing environements, such
  22.      as bulletedText are derived from this environment,
  23.      overriding only those specific areas treated differently.
  24.      For example, bulletedText is just like this default
  25.      environment, except that it deals with new paragraphs
  26.      differently.  Therefore it will override those
  27.      methods of txtEnvProcessor which specifically deal
  28.      with new paragraphs.
  29. ---------------------------------------------------- */
  30.  
  31. data:
  32.  
  33.   TPWord       *thisWord;
  34.   textLine     *thisLine;
  35.   columnBlock  *thisCB;
  36.  
  37. methods:
  38.  
  39.   void tpProcessWord();
  40.   -- Default word processor: Add it to the current line, if
  41.   -- space is available, otherwise create a new line.
  42.  
  43.   void tpProcessBlanks();
  44.   -- Default blank processor: Add to current line, if
  45.   -- space is available, otherwise discard (ie don't
  46.   -- use in a new line).
  47.  
  48.   void tpProcessLineBreak();
  49.   -- Default line break processor: Treat line breaks as
  50.   -- blanks (ie an input line break does not cause a line
  51.   -- break in the output file).
  52.  
  53.   void tpProcessFullLine();
  54.   -- Default full line processor: Add full input line to
  55.   -- columnBlock and start a new line.
  56.  
  57.   void tpProcessFullPage();
  58.   -- Default full page processor: Print the page and start
  59.   -- another.
  60.  
  61.   void tpProcessNewLine();
  62.   -- Default new line processor: Handles a new output line.
  63.   -- Default is indent line 2 characters.
  64.  
  65.   void tpProcessNewParagraph();
  66.   -- Default new paragraph processor: Breaks the output line.
  67.   -- Starts a new output line.
  68.  
  69.   textLine *tpGetLine();
  70.   -- Gets the current line.
  71.  
  72.   void tpSetLine(textLine *newLine);
  73.   -- Sets the current line.
  74.  
  75.   override epProcessEnvironment;
  76.   -- See the envProcessor definition for more information.
  77.  
  78.   override epShutdownEnvironment;
  79.   -- See the envProcessor definition for more information.
  80.  
  81.   override epInitializeEnvironment;
  82.   -- See the envProcessor definition for more information.
  83.  
  84.   override epPrepareForNewEnvironment;
  85.   -- See the envProcessor definition for more information.
  86.  
  87.   override epGetParagraphIndentation;
  88.   -- See the envProcessor definition for more information.
  89.  
  90.   override epGetLineIndentation;
  91.   -- See the envProcessor definition for more information.
  92.  
  93.   override epInit1;
  94.   -- See the envProcessor definition for more information.
  95.  
  96.   override somInit;
  97.  
  98.   override somUninit;
  99.