InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
ColRange Class Reference

#include <TableTypes.h>

Public Types

typedef base_type data_type
 

Public Member Functions

 ColRange ()
 
 ColRange (int32 sstart, int32 ccount)
 
 ColRange (const GridArea &area)
 
void Set (int32 sstart, int32 ccount)
 
int32 End () const
 
bool16 IsEmpty () const
 
bool16 Contains (const ColRange &rhs) const
 
bool16 Contains (int32 col) const
 
bool16 Intersects (const ColRange &rhs) const
 
bool16 operator== (const ColRange &rhs) const
 
bool16 operator!= (const ColRange &rhs) const
 
ColRange operator& (const ColRange &rhs) const
 
ColRange operator| (const ColRange &rhs) const
 
ColRangeoperator&= (const ColRange &rhs)
 
ColRangeoperator|= (const ColRange &rhs)
 
void ReadWrite (IPMStream *stream)
 

Public Attributes

int32 start
 
int32 count
 

Detailed Description

A range of cols represented by [start, start+count).

For instance, a ColRange(2,3) would miss out the zeroth and first columns, and would include the next three columns (2,3 and 4).

Author
Joe Shankar
See Also
ITableModel

Constructor & Destructor Documentation

ColRange::ColRange ()
inline

No-args constructor.

ColRange::ColRange (int32 sstart,
int32 ccount 
)
inline

Constructor.

Parameters
sstartthe first column in the range of interest
ccountthe number of columns to include in the range
ColRange::ColRange (const GridAreaarea)
inlineexplicit

Constructor. The projection of the GridArea onto the column (horizontal) axis will give the column range to span.

Parameters
areaspecifies an area, from which the columns spanned will become this column-range.

Member Function Documentation

bool16 ColRange::Contains (const ColRangerhs) const
inline

Query whether the given range is subset of this range (can be contained within).

Parameters
rhsspecifies a range of columns
Returns
kTrue if the columns in the given range are subset of the columns spanned by this range
bool16 ColRange::Contains (int32 col) const
inline

Query whether given column lies within this range.

Parameters
colspecifies column for query
Returns
kTrue if the column is within this range, kFalse otherwise
int32 ColRange::End () const
inline

Query for column just beyond end of the range spanned.

bool16 ColRange::Intersects (const ColRangerhs) const
inline

Query whether a given range of columns intersects with this range.

Parameters
rhsspecifies column range for this query
Returns
kTrue if there is an intersection in the range of this and the rhs, kFalse otherwise
bool16 ColRange::IsEmpty (void ) const
inline

Query if the range spans any columns at all.

Returns
kTrue if the column span is 0, kFalse otherwise
bool16 ColRange::operator!= (const ColRangerhs) const
inline

Overload of not-equal operator.

Parameters
rhsspecifies the range for comparison
Returns
kTrue if the ranges have different starting column or column span, kFalse if identical in these instance variables.
ColRange ColRange::operator& (const ColRangerhs) const

Overload of bitwise and operator, signifying intersection.

Parameters
rhsspecifies the range to take intersection of this with
ColRange& ColRange::operator&= (const ColRangerhs)
inline

Overload of bitwise-and assignment operator, to mean an intersection of this with the rhs range, followed by assignment.

Parameters
rhsspecifies a range to take intersection with
Returns
reference to self
bool16 ColRange::operator== (const ColRangerhs) const
inline

Overload of the equality relational operator. Two ranges are identical iff they have the same start and span the same number of columns.

Parameters
rhsspecifies the range to compare this against
Returns
kTrue if the start column and column span are equal, kFalse otherwise
ColRange ColRange::operator| (const ColRangerhs) const

Overload of bitwise or operator, signifying a union operation.

Parameters
rhsgives a range to take union of this range with
ColRange& ColRange::operator|= (const ColRangerhs)
inline

Overload of bitwise-or assignment operator, to mean a union followed by assignment.

Parameters
rhsspecifies range to take a union of this range with
Returns
reference to self
void ColRange::ReadWrite (IPMStreamstream)
inline

Used in persisting the state of an instance.

Parameters
streamthe stream to read instance data from or write instance data to depending on the stream's state
void ColRange::Set (int32 sstart,
int32 ccount 
)
inline

Mutator.

Parameters
sstartthe first column in the range of interest
ccountthe number of columns to include in the range

Member Data Documentation

int32 ColRange::count

Represents the columns spanned by this range.

int32 ColRange::start

Represents the first column in this range.