home *** CD-ROM | disk | FTP | other *** search
/ The Developer Connection…ice Driver Kit for OS/2 3 / DEV3-D1.ISO / devtools / os2tk21j / c / samples / tp / page.cs_ / page.csc
Encoding:
Text File  |  1993-03-12  |  1.7 KB  |  84 lines

  1. #   @(#)page.csc 1.3 1/22/92 16:10:55 [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 <somobj.sc>
  9.  
  10. class: page,
  11.   local;
  12.  
  13. parent: SOMObject;
  14.  
  15. /*
  16. ----------------------------------------------------
  17.   Class: page
  18.  
  19. Purpose: This is a low level storage class, used to
  20.      coordinate the different information which
  21.      will be printed on the current page.
  22. ---------------------------------------------------- */
  23.  
  24.  
  25. passthru: C.h;
  26. #include "tpword.h"
  27. #include "textline.h"
  28. #include "colblk.h"
  29. endpassthru;
  30.  
  31. data:
  32.  
  33.   int height;
  34.   int width;
  35.   int ncolumns;
  36.   int currentCol;
  37.   int pageNumber;
  38.  
  39.   textLine *header;
  40.   textLine *footer;
  41.  
  42.   columnBlock *columns;
  43.   TPWord *pageWord;
  44.  
  45. methods:
  46.  
  47. group: GeneralMethods;
  48.  
  49.   void pgPrint(FILE *output);
  50.  
  51. group: SetMethods;
  52.  
  53.   void pgSetHeight(int newHeight);
  54.   -- Set the height of a page in characters.
  55.  
  56.   void pgSetWidth(int newWidth);
  57.   -- Set the width of a page in characters.
  58.  
  59.   void pgSetNumberOfColumns(int ncolumns);
  60.   -- Set the number of columns in a page.
  61.  
  62.   void pgSetPageNumber(TPWord *newPageWord);
  63.   -- Tell the page about a special word to be used to
  64.   -- store page numbers.
  65.  
  66. group: GetMethods;
  67.  
  68.   columnBlock *pgGetColumnBlock();
  69.   -- Get the columnBlock being used by this page.
  70.  
  71.   textLine *pgGetHeaderBlock();
  72.   -- Get the textLine representing the page header.
  73.  
  74.   textLine *pgGetFooterBlock();
  75.   -- Get the textLine representing the page footer.
  76.  
  77. group: SystemMethodOverrides;
  78.  
  79.    override somInit;
  80.  
  81.    override somUninit;
  82.  
  83.    override somDumpSelfInt;
  84.