InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
RangeData Class Reference
Inheritance diagram for RangeData:
Text::StoryRange

Public Types

enum  Lean { kLeanForward = 0, kLeanForth = kLeanForward, kLeanBack = 1, kLeanBackward = kLeanBack }
 
enum  { kDontConsiderLean = 0, kIgnoreLean = kDontConsiderLean, kConsiderLean = 1 }
 
typedef base_type data_type
 

Public Member Functions

 RangeData (const RangeData &r) noexcept=default
 
 RangeData (RangeData &&r) noexcept=default
 
 RangeData (const RangeData &r, const RangeData *clip)
 
 RangeData (TextIndex start, TextIndex end, const RangeData *clip=nil)
 
 RangeData (TextIndex caret, Lean lean, const RangeData *clip=nil)
 
 RangeData (TextIndex start, TextIndex end, Lean lean, const RangeData *clip=nil)
 
RangeDataoperator= (const RangeData &) noexcept=default
 
RangeDataoperator= (RangeData &&) noexcept=default
 
TextIndex Start (Lean *lean) const
 
TextIndex End () const
 
int32 Length () const
 
int32 OverlapWith (const RangeData &other) const
 
bool16 StartsBefore (const RangeData &other, bool16 consideringLean=kIgnoreLean) const
 
bool16 EndsAfter (const RangeData &other, bool16 consideringLean=kIgnoreLean) const
 
bool16 Precedes (const RangeData &other) const
 
bool16 Leads (const RangeData &other) const
 
bool16 Succeeds (const RangeData &other) const
 
bool16 Follows (const RangeData &other) const
 
bool16 CompletelyPrecedes (const RangeData &other) const
 
bool16 Contains (const RangeData &other, bool16 consideringLean=kIgnoreLean) const
 
bool16 Contains (TextIndex index) const
 
bool16 Matches (const RangeData &other, bool16 consideringLean=kConsiderLean) const
 
bool16 Begins (const RangeData &other) const
 
bool16 Ends (const RangeData &other) const
 
bool16 Anchors (const RangeData &other) const
 

Friends

RangeData Join (const RangeData &x, const RangeData &y, const RangeData *clip)
 
RangeData SlideForward (const RangeData &x, int32 y, const RangeData *clip)
 
RangeData AdvanceEnd (const RangeData &x, int32 y, const RangeData *clip)
 
RangeData RecedeStart (const RangeData &x, int32 y, const RangeData *clip)
 

Constructor & Destructor Documentation

RangeData::RangeData (const RangeDatar,
const RangeDataclip 
)
inline

Description To construct a zero-length RangeData you must specify a lean. For example: RangeData( 34, RangeData::kLeanBack); Think of the specified range as representing the interval start + epsilon .. end - epsilon. That is, the start of the range leans forward and the end leans back. But, when start == end, you must specify a lean as many api's require it. Some examples include hit-testing text, drawing the insertion point in text when the text index is at a line break, calculating which parcel contains a given selection, and complex scenarios when navigating through text in the story editor/galley view when two story threads are composed juxtaposed on the same line but are at some distance from each other in the model (inline notes, deleted text). RangeData( 34, RangeData::kLeanBack); //ok RangeData( 34, 35); //ok RangeData( 34, 34); //incorrect

Parameters
RangeData::RangeData (TextIndex start,
TextIndex end,
const RangeDataclip = nil 
)
inline

Description To construct a zero-length RangeData you must specify a lean. For example: RangeData( 34, RangeData::kLeanBack); Think of the specified range as representing the interval start + epsilon .. end - epsilon. That is, the start of the range leans forward and the end leans back. But, when start == end, you must specify a lean as many api's require it. Some examples include hit-testing text, drawing the insertion point in text when the text index is at a line break, calculating which parcel contains a given selection, and complex scenarios when navigating through text in the story editor/galley view when two story threads are composed juxtaposed on the same line but are at some distance from each other in the model (inline notes, deleted text). RangeData( 34, RangeData::kLeanBack); //ok RangeData( 34, 35); //ok RangeData( 34, 34); //incorrect

Parameters
RangeData::RangeData (TextIndex start,
TextIndex end,
Lean lean,
const RangeDataclip = nil 
)
inline

Description To construct a zero-length RangeData you must specify a lean. For example: RangeData( 34, RangeData::kLeanBack); Think of the specified range as representing the interval start + epsilon .. end - epsilon. That is, the start of the range leans forward and the end leans back. But, when start == end, you must specify a lean as many api's require it. Some examples include hit-testing text, drawing the insertion point in text when the text index is at a line break, calculating which parcel contains a given selection, and complex scenarios when navigating through text in the story editor/galley view when two story threads are composed juxtaposed on the same line but are at some distance from each other in the model (inline notes, deleted text). RangeData( 34, RangeData::kLeanBack); //ok RangeData( 34, 35); //ok RangeData( 34, 34); //incorrect

Parameters