Taxonomy Categories:
Member Functions:
Interface Category:
API.
Inherits From:
None.
Inherited By:
TPrintPageIterator
MPageFolio
Purpose:
Establishes a standard interface for printing. Everything that is printable should be a descendant of this class. Not every client need be concerned about overriding the virtual Print functions of this class because there are several standard MPrintable objects already in the system, for example, the MPageFolio provides a default print implementation whose descendants are fully printable: TPaginatedPageFolio, TTiledPageFolio, TBookPageFolio, and TCompoundPageFolio. Paginated Page Folio, Tiled Page Folio and Book Page Folio describe arbitrary canvases tiled (or paginated) into various page configurations. Compound Page Folio is a collection or container of various kinds of page folios, including other Compound Page Folios.
The concept of printability can be applied to any object. Being an MPrintable implies that an object knows what to do when a print message is executed. Printability does not imply any additional properties such as page breakdown or organization, although it also does not restrict the client from adding these properties either. It does, however, imply the complete encapsulation of one entire print job, a complete document. It would not make sense, for example, to concatenate two MPrintable functions and expect to have them logically attached to each other.
Instantiation:
This is an abstract base class. Only derived classes can instantiate it as part of their implementation, either on the heap or the stack.
Deriving Classes:
Derive to create objects that know how to print themselves. You must override all functions.
Concurrency:
Can be multithread safe if parameters are safe or protected by semaphore.
Resource Use:
No special requirements.
Member Function: MPrintable::Print
virtual void Print (const TPrintJobDescription &)
Interface Category:
API.
Purpose:
The default print function for any MPrintable. It accomplishes printing for the derived class and must be overridden by derived classes.
Calling Context:
Called directly to print an MPrintable object. You can call this function directly to print an MPrintable object or any of its descendants. It is mostly used by the Printing Framework to print assembled documents but anyone can create and print their documents using this mixin class, but you must override this member function when creating new classes. Normally clients are expected to use higher levels of the Printing Framework, such as TPageIterator or MPageFolio, in preference to using this class directly. For each page of a document to be printed, this function must call TPrintChannel::PrintPage(MDrawable&,TPageDescription&) with the graphic for the given page to be printed.
Parameters:
- const TPrintJobDescription & -A reference to the job description to be used for printing. The print job specifies certain things about the print job such as the number of copies, which printer, and page range.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Can be multithread safe if parameters are safe or protected by semaphore.
Other Considerations:
None.
- MPrintable ()
- MPrintable (const MPrintable &)
Interface Category:
API.
Purpose:
- Default constructor. Intended only for derived classes.
- Copy constructor. Intended only for derived classes.
Calling Context:
- Called by streaming and derived classes.
- Called by derived classes to copy an object.
Parameters:
Return Value:
None.
Exceptions:
Throws no exceptions; passes all exceptions through.
Concurrency:
Can be multithread sage if parameters are safe or protected by semaphore.
Other Considerations:
None.
Member Function: MPrintable::operator=
MPrintable & operator =(const MPrintable &)
Interface Category:
API.
Purpose:
Assignment operator.
Calling Context:
Called when an object is assigned to another compatible object.
Parameters:
- const MPrintable & -The object being assigned from.
Return Value:
A reference to the left-hand side object.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Can be multithread sage if parameters are safe or protected by semaphore.
Other Considerations:
None.
Member Function: MPrintable::PrintAndCreateJobHandle
virtual TPrintJobHandle * PrintAndCreateJobHandle (const TPrintJobDescription &)
Interface Category:
API.
Purpose:
Performs the print operation just as the MPrintable::Print function does, but returns a pointer to a TPrintJobHandle that can subsequently be used by the client to track what happens to the job as it goes through the printing process. The print job handle also allows some control operations to be performed on the job such as aborting or redirecting to a different printer.
Calling Context:
Called directly to print just like the Print member function but it also returns a handle to the latent print job being submitted by this call. Called directly to print an MPrintable object. You can call this function directly to print an MPrintable object or any of its descendants. It is mostly used by the Printing Framework to print assembled documents but anyone can create and print their documents using this mixin class, but you must override this member function when creating new classes. Normally clients are expected to use higher levels of the Printing Framework, such as TPageIterator or MPageFolio, in preference to using this class directly. For each page of a document to be printed, this function must call TPrintChannel::PrintPage(MDrawable&,TPageDescription&) with the graphic for the given page to be printed.
Parameters:
- const TPrintJobDescription & -A print job description object that specifies the parameters of the job such as the number of copies, banner pages, and so forth.
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:
Can be multithread sage if parameters are safe or protected by semaphore.
Other Considerations:
The client owns the TPrintJobHandle returned and is responsible for deleting it.
virtual ~ MPrintable ()
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:
Can be multithread sage if parameters are safe or protected by semaphore.
Other Considerations:
None.
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.