home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / Think Class Libraries / Waste TCL r2 / CWASTEText.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-11-30  |  4.6 KB  |  137 lines  |  [TEXT/KAHL]

  1. /********************************************************\
  2.  CWASTEText.h
  3.  
  4. \********************************************************/
  5.  
  6. #pragma once
  7.  
  8. #include "CAbstractText.h"
  9. #include "WASTE.h"
  10. class CPrinter;
  11.  
  12. class CWASTEText : public CAbstractText
  13. {
  14.     public:
  15.         
  16.         TCL_DECLARE_CLASS
  17.         
  18.         // data members
  19.         WEHandle     macWE;            // handle to WE data
  20.         long        spacingCmd;        // Line spacing command number
  21.         long        alignCmd;        // alignment cmd number
  22.         long        printPageWidth;
  23.         CPrinter    *itsPrinter;
  24.             
  25.         // construction/destruction
  26.         CWASTEText();
  27.         CWASTEText(CView *anEnclosure, CBureaucrat *aSupervisor,
  28.             short aWidth = 0, short aHeight = 0, short aHEncl = 0,
  29.             short aVEncl = 0, SizingOption aHSizing = sizELASTIC,
  30.             SizingOption aVSizing = sizELASTIC, short aLineWidth = -1,
  31.             Boolean aScrollHoriz = FALSE, TextStyle *tStyle = NULL);
  32.         
  33.         virtual ~CWASTEText();
  34.  
  35.         void IWASTEText(CView *anEnclosure, CBureaucrat *aSupervisor,
  36.                             short aWidth, short aHeight,
  37.                             short aHEncl, short aVEncl,
  38.                             SizingOption aHSizing, SizingOption aVSizing,
  39.                             short aLineWidth, TextStyle *tStyle = NULL);
  40.         virtual void IViewTemp(CView *anEnclosure, CBureaucrat *aSupervisor,
  41.                             Ptr viewData);
  42.         void IWASTETextX();
  43.  
  44.         CTextEditTask        *MakeEditTask( long editCmd);
  45.         CTextStyleTask        *MakeStyleTask( long styleCmd);
  46.  
  47.         // Menu and commands
  48.         virtual void        UpdateMenus(void);
  49.  
  50.         // Mouse and Keystrokes
  51.         virtual void        DoClick(Point hitPt, short modifierKeys, long when);
  52.         virtual void        PerformEditCommand(long theCommand);
  53.  
  54.         // Validation
  55.         virtual void        CheckInsertion(long numChars, long styleSize, Boolean useSelection);
  56.  
  57.         // Display
  58.         virtual void        Draw(Rect *area);
  59.         virtual void        Activate();
  60.         virtual void        Deactivate();
  61.         virtual void        SetSelection(long selStart, long selEnd, Boolean fRedraw);
  62.         Boolean                SetOutlineHighliting(Boolean hilite);
  63.         
  64.         // Text Specification
  65.         virtual void         Clear(void);
  66.         virtual void         SetTextPtr(Ptr textPtr, long numChars);
  67.         virtual void         StopInlineSession(void);
  68.         virtual Handle         GetTextHandle(void);
  69.         virtual Handle         CopyTextRange(long start, long end);
  70.         virtual void         CopyRangeWithStyle(long start, long end, Handle hText,
  71.                                 StScrpHandle hStyles);
  72.         virtual void         InsertTextPtr(Ptr text, long length, Boolean fRedraw);
  73.         virtual void         InsertWithStyle(Ptr text, long length, StScrpHandle hStyles,
  74.                                 Boolean fRedraw);
  75.         virtual void         TypeChar(char theChar, short theModifers);
  76.         virtual void         Specify(Boolean fEditable, Boolean fSelectable,
  77.                                 Boolean fStylable);
  78.  
  79.         // Calibrating
  80.         virtual void         CalcWERects();
  81.         virtual void         ResizeFrame(Rect *delta);
  82.         virtual void         AdjustBounds();
  83.  
  84.         virtual long         FindLine(long charPos);
  85.         virtual long         GetLength();
  86.         
  87.         // Text Characteristics
  88.         virtual void         SetFontNumber(short aFontNumber);
  89.         virtual void         SetFontNumberAll(short aFontNumber);
  90.         virtual void         SetFontNameAll(Str255 aFontName);
  91.         virtual void         SetFontStyle(short aStyle);
  92.         virtual void         SetFontStyleAll(short aStyle);
  93.         virtual void         SetFontSize(short aSize);
  94.         virtual void         SetFontSizeAll(short aSize);
  95.         virtual void         SetTextMode(short aMode);
  96.         virtual void         SetAlignment(short anAlignment);
  97.         virtual void         SetAlignCmd(long alignCmd);
  98.         virtual void         SetSpacingCmd(long aSpacingCmd);
  99.         virtual void        SetTheStyleScrap(long rangeStart, long rangeEnd,
  100.                                 StScrpHandle styleScrap, Boolean redraw);
  101.         virtual void         SetStyle(short mode, TextStyle *newStyle, Boolean redraw);
  102.  
  103.         virtual long         GetHeight(long startLine, long endLine);
  104.         virtual long         GetCharOffset(LongPt *aPt);
  105.         virtual void         GetCharPoint(long offset, LongPt *aPt);
  106.         virtual void         GetTextStyle(short *whichAttributes, TextStyle *aStyle);
  107.         virtual StScrpHandle GetTextStyles(void);
  108.         virtual void         GetCharStyle(long charOffset, TextStyle *theStyle);
  109.         virtual long         GetSpacingCmd();
  110.         virtual long         GetAlignCmd();
  111.         virtual StScrpHandle GetTheStyleScrap();
  112.  
  113.         virtual long         GetNumLines(void);
  114.         virtual void        GetSelection(long *selStart, long *selEnd);
  115.         virtual void         HideSelection(Boolean hide, Boolean redraw);
  116.         virtual void         GetSteps(short *hStep, short *vStep);
  117.  
  118.         // Printing
  119.         virtual void         Paginate(CPrinter *aPrinter, short pageWidth, short pageHeight);
  120.         virtual void         AboutToPrint(short *firstPage, short *lastPage);
  121.         virtual void         PrintPage(short pageNum, short pageWidth, short pageHeight,
  122.                                 CPrinter *aPRinter);
  123.         virtual void         DonePrinting();
  124.  
  125.         // Cursor
  126.         virtual void         Dawdle(long *maxSleep);
  127.  
  128.         // Object I/O
  129.         virtual void         PutTo(CStream& stream);
  130.         virtual void         GetFrom(CStream& stream);
  131.     
  132.     protected:
  133.         // temporarily changing selection to all
  134.         virtual void         TempSelectAll(void);
  135.         virtual void         RestoreSelection(void);
  136. };
  137.