Class: TGraphicObjectStyle

Declaration: LineLayoutStyles.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

TLineLayoutStyle

Inherited By:

TMGraphicObjectStyle

Purpose:

Derived from TLineLayoutStyle, it mark the characters in the text which do not display through the standard font mechanism. Instead, when they get displayed, the TGraphicObjectStyle::Draw function is called. The Draw function can then draw the glyphs anyway it wants. The intended use for this style is to embed a picture or button in a line of text and have the picture behave as a character. The paragraph and character style sets associated with the graphic object can be used by the object to display itself.

Instantiation:

Allocate on the heap or the stack.

Deriving Classes:

Derive classes to provide a specific implementation of the Draw member function.

Concurrency:

Multithread safe.

Resource Use:

No special requirements.

Member Function: TGraphicObjectStyle::Draw

virtual void Draw (TGrafPort * port, const TGPoint & origin, GCoordinate ascent, GCoordinate descent, const UniChar & code, TSingleLineOrientation::ELineOrientation direction, const TStyleSet & characterStyles, const TStyleSet & paragraphStyles) const

Interface Category:

API.

Purpose:

Draws an image into the port at the 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 the best results with 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 ignore 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: TGraphicObjectStyle::Info

virtual void Info (const UniChar & code, TSingleLineOrientation::ELineOrientation direction, const TStyleSet & characterStyles, const TStyleSet & paragraphStyles, GCoordinate & advance, GCoordinate & ascender, GCoordinate & descender) const

Interface Category:

API.

Purpose:

Calculates where a graphic will be displayed relative to other characters.

Calling Context:

Called when drawing to calculate where a graphic will be displayed relative to other characters.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

None.

Member Function: TGraphicObjectStyle::IsPropagatingStyle

virtual bool IsPropagatingStyle () const

Interface Category:

API.

Purpose:

Queries whether the style propagates.

Calling Context:

Called to determine if the style propagates.

Parameters:

Return Value:

Returns true if this style propagates.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

None.

Member Function: TGraphicObjectStyle::TGraphicObjectStyle

  1. TGraphicObjectStyle (const TGraphicObjectStyle &)
  2. TGraphicObjectStyle ()

Interface Category:

API.

Purpose:

  1. Copy constructor.
  2. Default constructor.

Calling Context:

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

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

None.

Member Function: TGraphicObjectStyle::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: TGraphicObjectStyle::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: TGraphicObjectStyle::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: TGraphicObjectStyle::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: TGraphicObjectStyle::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: TGraphicObjectStyle::~TGraphicObjectStyle

virtual ~ TGraphicObjectStyle ()

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