home *** CD-ROM | disk | FTP | other *** search
- /*
- File: RulersRanges.h
-
- Contains: xxx put contents here xxx
-
- Written by: Essam Zaky
-
- Copyright: © 1994 by Apple Computer, Inc., all rights reserved.
-
- Change History (most recent first):
-
- <2> 1/4/94 EZ clean up
- <1> 1/4/94 EZ first checked in
-
- */
-
- #ifndef _Rulers_
- #define _Rulers_
-
- #ifndef _ToolBoxDump_
- #include "ToolBoxDump.h"
- #endif
-
- #ifndef _TextensionCommon_
- #include "TextensionCommon.h"
- #endif
-
- #ifndef _Array_
- #include "Array.h"
- #endif
-
- #ifndef _ObjectsRanges_
- #include "ObjectsRanges.h"
- #endif
-
- #ifndef _RulerObject_
- #include "RulerObject.h"
- #endif
- //***************************************************************************************************
-
- class CRulersRanges : public CObjectsRanges {
- public:
- CRulersRanges();
-
- void IRulersRanges(CArray* chars, CAttrObject* protoObj);
-
- //•Override
- virtual void Free();
-
- virtual void FreeData(Boolean compact = true);
-
- virtual CAttrObject* Offset2Object(TOffset offset);
-
- virtual long UpdateRangeObjects(long startOffset, long len, const TAttrObjModifier* modifier);
-
- virtual CAttrObject* GetContinuousObj(long startOffset, long len);
- //the returned value is the obj at startOffset and not realy the continuous, this is how word processors show the current ruler
-
-
- #ifdef txtnDebug
- virtual void CheckCoherence(long count);
- #endif
-
-
- //•own members
- CRulerObject* GetNewRuler() const;
-
- void SetDefaultRuler(char rulerJust = 0);
-
- void CharRange2ParagRange(TOffset* startOffset, TOffset* endOffset) const;
- //•uses text chars
-
- long GetReplaceExtraChars(long startOffset, long endOffset, CAttrObject** replaceObj);
- //•uses text chars, to be called before replacing the text chars
-
- long ValidateRulerRange(long offset, long len);
- /* to be called after an input operation by stream, use fChars (•should be called after updating the text chars).
- returns the count of extra chars that are not in the range offset..offset+len and are changing ruler (should be formatted and redrawn)*/
-
- protected:
-
- private:
- CArray* fChars;
- CRulerObject* fPendingRuler;
-
- CRulerObject* GetPendingRuler(long offset, long len);
- void InvalidatePendingRuler(long offset, long len);
-
- Boolean ValidateRuler(long rulerIndex);
- };
- //**************************************************************************************************
-
- #endif
-