Class: MPageFolio

Declaration: HighLevelPrint.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

MCollectible, MPrintable

Inherited By:

TPaginatedPageFolio TCompoundPageFolio

Purpose:

An abstract mixin class designed to provide printability to any class it is mixed with. It is itself an MPrintable derived class which adds additional functionality with respect to pages and page iteration. In that sense, it is more suited to document-level printing than simple printability, which is what MPrintable offers. The main difference between this class and MPrintable is the added functions, CreatePageIterator and GetPageCount. These member functions must be overridden by the derived class to provide access to pages of the folio. The Print and PrintAndCreateJobHandle member functions inherited from MPrintable are already defined in terms of CreatePageIterator. MPageFolio is thus a page-oriented MPrintable.

Instantiation:

Allocate on the heap or the stack.

Deriving Classes:

This is an abstract class that must be derived to take advantage of its features. You must override pure virtual functions but Print and PrintAndCreateJobHandle are fully functional and do not need to be overridden.

Concurrency:

Not intended to be multithread safe.

Resource Use:

No special requirements.

Member Function: MPageFolio::~MPageFolio

virtual ~ MPageFolio ()

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 intended to be multithread safe.

Other Considerations:

None.

Member Function: MPageFolio::CreatePageIterator

virtual TPrintPageIterator * CreatePageIterator (TPageRange * aliasRange =NIL) const

Interface Category:

API.

Purpose:

Creates a page iterator specific to the page folio. Derived classes must override this function to create a polymorphic TPageIterator object. The create function takes a page range object which the page iterator that is created must honor in its implementation.

Calling Context:

Called directly to create a page iterator for any printable MPageFolio derived class. A page folio should be able to create any number of independently operating page iterators for itself.

Parameters:

Return Value:

Returns a client-owned pointer to a TPageIterator derived class for the folio or document creating this iterator.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not intended to be multithread safe.

Other Considerations:

Any number of page iterators can be created for a page folio and all can be operated at the same time (although not concurrently). If at any time the MPageFolio is destroyed without also destroying all of its iterators, the attempt to use any of its iterators could result in catastrophic exceptions. This consideration applies to all MPageFolio derived classes and their page iterators. There is no easy way to safeguard a page iterator when its target page folio is destroyed.

Member Function: MPageFolio::GetPageCount

virtual unsigned long GetPageCount () const

Interface Category:

API.

Purpose:

Derived classes must override this function to return the total number of pages in their page folio.

Calling Context:

Called directly to obtain the total number of pages in a folio (a document).

Parameters:

Return Value:

Returns the total number of pages.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not intended to be multithread safe.

Other Considerations:

None.

Member Function: MPageFolio::Print

virtual void Print (const TPrintJobDescription & job)

Interface Category:

API.

Purpose:

Prints the entire contents of the page folio. Clients and derived classes need not override this function.

Calling Context:

Called directly to print the printable portions of a page folio. The job submitted is comprised of the pages of the MPageFolio.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not intended to be multithread safe.

Other Considerations:

None.

Member Function: MPageFolio::PrintAndCreateJobHandle

virtual TPrintJobHandle * PrintAndCreateJobHandle (const TPrintJobDescription & job)

Interface Category:

API.

Purpose:

Prints the contents of the page folio as specified by the print job description and returns a handle to latent job that can be used to track the printing process or to perform rudimentary operations on the job such as aborting it or redirecting it to a different printer.

Calling Context:

Called directly not only to print the pages of an MPageFolio but to obtain a handle to the job just submitted.

Parameters:

Return Value:

Returns a client-owned print job handle that can be used to track the status of the just-submitted print job.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not intended to be multithread safe.

Other Considerations:

None.

Member Function: MPageFolio::operator=

MPageFolio & operator =(const MPageFolio &)

Interface Category:

API.

Purpose:

Assignment operator.

Calling Context:

Called when an object is assigned to another compatible object.

Parameters:

Return Value:

A reference to the left-hand side object.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not intended to be multithread safe.

Other Considerations:

None.

Member Function: MPageFolio::Hash

virtual long Hash () const

Interface Category:

API.

Purpose:

Generates a hash value.

Calling Context:

Called directly to generate a hash value for this object. Also used when objects of this type are placed in a collection or compared with other similar objects of compatible content.

Parameters:

Return Value:

A hash value.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not intended to be multithread safe.

Other Considerations:

None.

Member Function: MPageFolio::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 intended to be multithread safe.

Other Considerations:

None.

Member Function: MPageFolio::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 intended to be multithread safe.

Other Considerations:

None.

Member Function: MPageFolio::MPageFolio

  1. MPageFolio ()
  2. MPageFolio (const MPageFolio &)

Interface Category:

API.

Purpose:

  1. Default constructor. Used by derived classes and for streaming only.
  2. Copy constructor. Used by derived classes to copy peer objects.

Calling Context:

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

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not intended to be 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.