Class: TBackgroundStyle

Declaration: LineLayoutStyles.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

TColorStyle

Inherited By:

TForegroundStyle

Purpose:

TBackgroundStyle, derived from TColorStyle, is used to draw background patterns behind characters. This is a common feature in Japanese word processors. This style can also be derived to draw frames around characters, also a common feature in Japanese word processors.

Instantiation:

Allocate on the heap or the stack.

Deriving Classes:

Derive classes to provide a more sophisticated implementation of background styling.

Concurrency:

Multithread safe.

Resource Use:

No special requirements.

Member Function: TBackgroundStyle::Draw

virtual void Draw (TGrafPort * port, const TGArea & background, const TStyleSet & characterStyles, const TStyleSet & paragraphStyles) const

Interface Category:

API.

Purpose:

Draws an image into the port at origin. The origin is at the intersection of the baseline and the left side of the image in horizontal text. In vertical text the origin is at the intersection of the baseline and the top of the image, for best results in vertical text the image should center around the origin. The ascent is the amount before the baseline, and the descent is the amount after the baseline. These values will usually be ignored by derived classes.

Calling Context:

Called to draw an image into the port at the origin.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

None.

Member Function: TBackgroundStyle::GetName

virtual const TStyleName & GetName () const

Interface Category:

API.

Purpose:

Returns the style's internal name. This is not necessarily the class name. For example, there are related underlining styles that are each separate derived classes. However, because they are mutually exclusive, they share the same internal name.

Calling Context:

Called when the name associated with an object is needed; for example, when comparing objects.

Parameters:

Return Value:

The TToken for the associated name.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

None.

Member Function: TBackgroundStyle::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:

Multithread safe.

Other Considerations:

None.

Member Function: TBackgroundStyle::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:

Multithread safe.

Other Considerations:

None.

Member Function: TBackgroundStyle::operator==

virtual bool operator ==(const TStyle & thatStyle) const

Interface Category:

API.

Purpose:

Equality operator.

Calling Context:

Called to compare two objects.

Parameters:

Return Value:

Returns true if the objects are equal.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

None.

Member Function: TBackgroundStyle::Hash

virtual long Hash () const

Interface Category:

API.

Purpose:

Overrides inherited MCollectible function.

Calling Context:

Same as for base class.

Parameters:

Return Value:

The numeric value of the hash.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

None.

Member Function: TBackgroundStyle::GetUseGlyphAngles

virtual bool GetUseGlyphAngles () const

Interface Category:

API.

Purpose:

Queries whether the edges of the TArea used when drawing should be contoured to the slope of the glyphs that contain this style.

Calling Context:

Called when drawing.

Parameters:

Return Value:

Returns true if this field is set to true; the edges will be contoured.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

None.

Member Function: TBackgroundStyle::~TBackgroundStyle

virtual ~ TBackgroundStyle ()

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:

Multithread safe.

Other Considerations:

None.

Member Function: TBackgroundStyle::TBackgroundStyle

  1. TBackgroundStyle ()
  2. TBackgroundStyle (const TBackgroundStyle &)
  3. TBackgroundStyle (const TAttributeState & paint, bool useGlyphAngles =true)

Interface Category:

API.

Purpose:

  1. Default constructor.
  2. Copy constructor.
  3. Constructs a background style object with specified values.

Calling Context:

  1. Called by the stream-in operators.
  2. Called to copy an object.
  3. Call directly to construct a background style object with specified values.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

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.