home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 November: Tool Chest / Dev.CD Nov 94.toast / New System Software Extensions / OpenDoc A6 / OpenDoc Parts Framework / OPF / Examples / Text / Textension / Include / Columns.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-04-21  |  2.9 KB  |  120 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        Columns.h
  3.  
  4.     Contains:    xxx put contents here xxx
  5.  
  6.     Written by:    Essam Zaky
  7.  
  8.     Copyright:    © 1994 by Apple Computer, Inc., all rights reserved.
  9.  
  10.     Change History (most recent first):
  11.  
  12.          <3>      1/5/94    EZ        don't compile if txtnMultiFrames compilation var is not defined
  13.          <2>      1/4/94    EZ        clean up
  14.          <1>      1/4/94    EZ        first checked in
  15.  
  16. */
  17.  
  18. #ifdef txtnMultiFrames
  19.  
  20. #ifndef _Columns_
  21. #define _Columns_
  22.  
  23. #ifndef _ToolBoxDump_
  24. #include "ToolBoxDump.h"
  25. #endif
  26.  
  27. #ifndef _TextensionCommon_
  28. #include "TextensionCommon.h"
  29. #endif
  30.  
  31. #ifndef _Array_
  32. #include "Array.h"
  33. #endif
  34.  
  35. #ifndef _Pages_
  36. #include "Pages.h"
  37. #endif
  38.  
  39. //***************************************************************************************************
  40.  
  41.  
  42. class CColumnarFrames : public CPageFrames {
  43.     public:
  44.         CColumnarFrames();
  45.         
  46.         void IColumnarFrames();
  47.         
  48.         //•override
  49.         virtual void SetTextFrameSize(const LongPoint* newSize, CDisplayChanges* changes = nil, long frameNo = 0);
  50.         
  51.         #ifdef txtnScal
  52.         virtual void GetTextFrameSize(LongPoint* theSize, Boolean scaled = true, long frameNo = 0) const;
  53.         
  54.         virtual void SetScale(Point numer, Point denom);
  55.         
  56.         virtual void GetAbsTextFrame(long frameNo, TxtnLongRect* absRect, Boolean scaled = true) const;
  57.         #else
  58.         virtual void GetTextFrameSize(LongPoint* theSize, long frameNo = 0) const;
  59.  
  60.         virtual void GetAbsTextFrame(long frameNo, TxtnLongRect* absRect) const;
  61.         #endif
  62.         
  63.         virtual void InvalFramePart(long frameNo, TFrameEditFlags invalFlags, long invalMessage = 0
  64.                                                             , RgnHandle theClip = nil);
  65.         
  66.         virtual short GetLineFormatWidth(long lineNo) const;
  67.         virtual short GetLineMaxWidth(long lineNo) const;
  68.  
  69.         virtual void SectFrames(const Rect* theRect, CSectFrames* sectedFrames) const;
  70.         
  71.         virtual long Point2Frame(const LongPoint* thePt) const;
  72.         //up to now, always return a value >= 0
  73.         
  74.         //•own members
  75.         virtual long GetCountPages() const;
  76.  
  77.         void SectPages(const Rect* theRect, CSectFrames* sectedPages) const;
  78.         
  79.         inline void GetAbsPageTextFrame(long pageNo, TxtnLongRect* absRect) const
  80.             {CPageFrames::GetAbsTextFrame(pageNo, absRect);}
  81.             
  82.         void GetPageTextFrame(long pageNo, Rect* theRect) const;
  83.         
  84.         inline void GetAbsPageFrame(long pageNo, TxtnLongRect* absRect) const
  85.             {CPageFrames::GetAbsFrameRect(pageNo, absRect);}
  86.             
  87.         void GetPageFrame(long pageNo, Rect* theRect) const ;
  88.         
  89.         void SetCoulmnsInfo(short columnsPerPage, short columnGutter, CDisplayChanges* changes = nil);
  90.         void GetCoulmnsInfo(short* columnsPerPage, short* columnGutter) const;
  91.         
  92.         long Column2Page(long* columnNo) const;
  93.  
  94.     protected:
  95.         short fColumnsPerPage;
  96.  
  97.         short fColumnWidth;
  98.  
  99.         short fColumnGutter;
  100.         
  101.         #ifdef txtnScal
  102.         short fScaledColumnWidth;
  103.         short fScaledColumnGutter;
  104.         #endif
  105.         
  106.         //•own members
  107.         
  108.     private:
  109.         void CalcColumnWidth();
  110.         
  111.         #ifdef txtnScal
  112.         void CalcScaledVals();
  113.         #endif
  114. };
  115. //*************************************************************************************************
  116.  
  117.  
  118. #endif //_Columns_
  119.  
  120. #endif //txtnMultiFrames