Class: TPageRange

Declaration: PrintJobDescription.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

MCollectible

Inherited By:

TEvenPageRange TOddPageRange TStandardPageRange

Purpose:

One of the things that can affect a print job is the range of pages to be included in the document. Traditionally, you can specify closed continuous subranges of a document, such as pages 3 to 5, pages 1 and 2, page 15 to the end, and so forth. A TPageRange object extends that concept to allow any combination of pages to be included or excluded during printing. Page ranges obey the rules of sets in the sense that any set of pages can be included in a range. One of the derived classes, TStandardPageRange, more precisely follows the semantics of set behavior. This class specifies examination of page ranges or the state of a page range. Derived classes may add enhanced functionality to augment changing or altering page ranges. Page ranges provide means for examining the first page in a range, the last page, or the total number of pages in the range. Page ranges can be empty (no pages in the range), full (all pages are in the range), or somewhere in between. Specific pages can be checked to see whether they are included in the range. A page range does not have to be continuous. Some examples of page ranges and their usage are TEvenPageRange, TOddPageRange, and TStandardPageRange.

Instantiation:

Abstract class; do not instantiate.

Deriving Classes:

Clients are normally not forced to derive from this class as it simply defines the interface for page ranges. However, should clients wish to extend or create a page range of their own, they should derive from this class or use one of its existing deriving classes. All virtual functions should be overridden. No matter what functionality is added, its pure virtual functions should always reflect the immediate state of the page range derived class. Streaming and assignment functions should also be provided. All derived class should preserve the interface of this abstract class.

Concurrency:

Not multithread safe.

Resource Use:

No special requirements.

Member Function: TPageRange::TPageRange

  1. TPageRange ()
  2. TPageRange (const TPageRange &)

Interface Category:

API.

Purpose:

  1. Default constructor.
  2. Copy constructor.

Calling Context:

  1. Called by the stream-in operators and the derived class default constructor.
  2. Called to copy an object.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TPageRange::~TPageRange

virtual ~ TPageRange ()

Interface Category:

API.

Purpose:

Destructor.

Calling Context:

Called to destroy an object.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Member Function: TPageRange::IsEmpty

virtual bool IsEmpty () const

Interface Category:

API.

Purpose:

Determines if the range is empty.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns true if the range is empty; false otherwise.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TPageRange::IsFull

virtual bool IsFull () const

Interface Category:

API.

Purpose:

Determines if the range is continuous.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns true if the range is continuous; false otherwise.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TPageRange::IsPageInRange

virtual bool IsPageInRange (unsigned long pageNumber) const

Interface Category:

API.

Purpose:

Returns true if the absolute page number is in range.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns true if the page number is in the range; false otherwise.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TPageRange::IsNthPageInRange

virtual bool IsNthPageInRange (unsigned long & pageNumber) const

Interface Category:

API.

Purpose:

Takes a page number and returns the corresponding absolute page number if one exists. For example, for a TEvenPageRange, if this function is called with 4 as an argument, it returns true and the page number argument is modified to be 8 if the document has 8 or more pages. Otherwise, the function result is false.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns true if the page number is in range.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TPageRange::GetPageCountInRange

virtual unsigned long GetPageCountInRange () const

Interface Category:

API.

Purpose:

Returns the number of pages in this range.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns the number of pages.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TPageRange::GetFirstPageInRange

virtual unsigned long GetFirstPageInRange () const

Interface Category:

API.

Purpose:

Returns the first absolute page number in the range.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns the first absolute page number.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TPageRange::GetLastPageInRange

virtual unsigned long GetLastPageInRange () const

Interface Category:

API.

Purpose:

Returns the last absolute page in the range.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns the first absolute page number in the range.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TPageRange::Hash

virtual long Hash () const

Interface Category:

API.

Purpose:

Generates a hash value.

Calling Context:

Called to generate a hash value.

Parameters:

Return Value:

A long hash value.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TPageRange::operator=

TPageRange & operator =(const TPageRange &)

Interface Category:

API.

Purpose:

Assignment operator.

Calling Context:

Called when an object is assigned to another compatible object.

Parameters:

Return Value:

A non-const reference to the left-hand side object.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TPageRange::operator<<=

virtual TStream & operator <<= (TStream & fromWhere)

Interface Category:

API.

Purpose:

Stream-in operator.

Calling Context:

Called to stream in data.

Parameters:

Return Value:

Returns a reference to the stream the object streams itself in from.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TPageRange::operator>>=

virtual TStream & operator >>=(TStream & toWhere) const

Interface Category:

API.

Purpose:

Stream-out operator.

Calling Context:

Called to stream out data.

Parameters:

Return Value:

Returns a reference to the stream the object streams itself out to.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.