Class: TPrintingFlagSnapshot

Declaration: PrintingFlagSnapshot.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

None.

Inherited By:

None.

Purpose:

This class is provided for the express purpose of safely accessing the printing flag contained in the graf port. A client can use this class to determine when a Draw member function is called on an MGraphic by the printing subsystem or by the display. The object drawing can then be adjusted for printing versus displaying. The result of such adjustment might be to disable a particular highlight on a selection because highlighting is not normally considered to be a printing function.

Instantiation:

Allocate on the heap or the stack.

Deriving Classes:

This class is not intended to be derived.

Concurrency:

Not multithread safe.

Resource Use:

No special requirements.

Other Considerations:

This is an auxiliary class which might be superseded.

Member Function: TPrintingFlagSnapshot::TPrintingFlagSnapshot

  1. TPrintingFlagSnapshot (const TGrafPort & port)
  2. TPrintingFlagSnapshot (const TPrintingFlagSnapshot &)

Interface Category:

API.

Purpose:

  1. Constructor taking the target graf port to be sampled.
  2. Copy constructor.

Calling Context:

  1. Called to create this class and get a snapshot of this ports printing state.
  2. Called to copy an object.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

The snapshot taken of the target graf port ages over time. Objects of this class do not know when the graf port becomes invalid; however, as long as the graf port is valid, the printing attribute can also be assumed to be valid.

Member Function: TPrintingFlagSnapshot::~TPrintingFlagSnapshot

virtual ~ TPrintingFlagSnapshot ()

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.

Other Considerations:

None.

Member Function: TPrintingFlagSnapshot::IsPrintingPort

bool IsPrintingPort () const

Interface Category:

API.

Purpose:

Allows the caller to determine whether a graf port is used for printing. Clients can then take appropriate steps to adjust printing or display parameters.

Calling Context:

Called directly to determine if the target graf port is a printing graf port.

Parameters:

Return Value:

Returns true if the graf port is a printing port.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TPrintingFlagSnapshot::operator=

TPrintingFlagSnapshot & operator =(const TPrintingFlagSnapshot &)

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.
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.