Class: TLineStyle

Declaration: LineLayoutStyles.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

TColorStyle

Inherited By:

TOverbarStyle TStrikethroughStyle TUnderlineStyle

Purpose:

TLineStyle, derived from TColorStyle, is a style used for associating a line with text. The thickness and position of the line are each determined by two numbers: an increment and an offset. The line's thickness is defined to be increment + offset * pointSize. If the increment is 1 and the offset 0.25, for example, the line would be 4 pixels thick for 12-point text and 7 pixels thick for 24-point text. The line's position is determined in a more complicated fashion, and, unlike the thickness, is not the same for all derived classes of TLineStyle. In all cases, however, the line is placed relative to two vertical positions for the line of text, such as the baseline, the ascent, the descent, or the x-height. Different vertical positions are used for different derived classes to determine the line's placement. If p1 and p2 are the two vertical positions, then the line is placed at p1 + increment + ( p2 -p1 ) * factor. A factor of 0 will place the line at p1, and an offset of 1 at p2.

Instantiation:

Allocate on the heap or the stack.

Deriving Classes:

TLineStyle is abstract and must be derived to associate the line value with a higher concept.

Concurrency:

Multithread safe.

Resource Use:

No special requirements.

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

virtual ~ TLineStyle ()

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: TLineStyle::TLineStyle

  1. TLineStyle ()
  2. TLineStyle (const TLineStyle &)
  3. TLineStyle (GCoordinate offsetIncrement, GCoordinate thicknessIncrement, bool coverSpaces =true, bool useCharacterBaseline =false)
  4. TLineStyle (const TAttributeState & paint, GCoordinate offsetIncrement, GCoordinate thicknessIncrement, bool coverSpaces =true, bool useCharacterBaseline =false)
  5. TLineStyle (GCoordinate offsetIncrement, GCoordinate offsetFactor, GCoordinate thicknessIncrement, GCoordinate thicknessFactor, bool coverSpaces =true, bool useCharacterBaseline =false)
  6. TLineStyle (const TAttributeState & paint, GCoordinate offsetIncrement, GCoordinate offsetFactor, GCoordinate thicknessIncrement, GCoordinate thicknessFactor, bool coverSpaces =true, bool useCharacterBaseline =false)

Interface Category:

API.

Purpose:

  1. Default constructor.
  2. Copy constructor.
  3. Constructs a style object with specific values.
  4. Constructs a style object with specific values.
  5. Constructs a style object with specific values.
  6. Constructs a style object with specific values.

Calling Context:

  1. Called by the stream-in operators.
  2. Called to copy an object.
  3. Call to construct a style object with specific values.
  4. Call to construct a style object with specific values.
  5. Call to construct a style object with specific values.
  6. Call to construct a style object with specific values.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

None.

Member Function: TLineStyle::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: TLineStyle::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: TLineStyle::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: TLineStyle::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: TLineStyle::GetBundleDefaulted

virtual bool GetBundleDefaulted () const

Interface Category:

API.

Purpose:

Queries whether the system default bundle is to be used.

Calling Context:

Call when drawing to query whether the system default bundle is to be used.

Parameters:

Return Value:

Returns true if the system default bundle is to be used.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

None.

Member Function: TLineStyle::GetCoverSpaces

virtual bool GetCoverSpaces () const

Interface Category:

API.

Purpose:

Queries whether to draw the line across white space.

Calling Context:

Call when drawing to query whether to draw the line across white space.

Parameters:

Return Value:

Returns true if the line should be drawn across white space.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

None.

Member Function: TLineStyle::GetUseCharacterBaseline

virtual bool GetUseCharacterBaseline () const

Interface Category:

API.

Purpose:

Queries whether to draw the line relative to each character's baseline. For example, is a character is superscripted, the line is raised by the amount of the superscripting.

Calling Context:

Call when drawing to query whether to draw the line relative to each character's baseline.

Parameters:

Return Value:

Returns true if the line should be drawn relative to each character's baseline.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

None.

Member Function: TLineStyle::SetLine

  1. virtual void SetLine (GCoordinate offsetIncrement, GCoordinate thickness, bool coverSpaces =true, bool useCharacterBaseline =false)
  2. virtual void SetLine (const TAttributeState & paint, GCoordinate offsetIncrement, GCoordinate thickness, bool coverSpaces =true, bool useCharacterBaseline =false)
  3. virtual void SetLine (GCoordinate offsetIncrement, GCoordinate offsetFactor, GCoordinate thicknessIncrement, GCoordinate thicknessFactor, bool coverSpaces =true, bool useCharacterBaseline =false)
  4. virtual void SetLine (const TAttributeState & paint, GCoordinate offsetIncrement, GCoordinate offsetFactor, GCoordinate thicknessIncrement, GCoordinate thicknessFactor, bool coverSpaces =true, bool useCharacterBaseline =false)

Interface Category:

API.

Purpose:

  1. Sets the characteristics of the line.
  2. Sets the characteristics of the line.
  3. Sets the characteristics of the line.
  4. Sets the characteristics of the line.

Calling Context:

  1. Used by TLineStyle derived classes to set the characteristics of the line.
  2. Used by TLineStyle derived classes to set the characteristics of the line.
  3. Used by TLineStyle derived classes to set the characteristics of the line.
  4. Used by TLineStyle derived classes to set the characteristics of the line.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

None.

Member Function: TLineStyle::GetThicknessFactor

virtual GCoordinate GetThicknessFactor () const

Interface Category:

API.

Purpose:

Returns the thickness factor for the line style instance.

Calling Context:

Used to obtain the thickness factor for the line style instance.

Parameters:

Return Value:

The thickness factor for the line style instance.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

None.

Member Function: TLineStyle::GetThicknessIncrement

virtual GCoordinate GetThicknessIncrement () const

Interface Category:

API.

Purpose:

Returns the thickness increment for the line style instance.

Calling Context:

Used to obtain the thickness increment for the line style instance.

Parameters:

Return Value:

The thickness increment for the line style instance.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

None.

Member Function: TLineStyle::GetOffsetFactor

virtual GCoordinate GetOffsetFactor () const

Interface Category:

API.

Purpose:

Returns the offset factor for the line style instance.

Calling Context:

Used to obtain the offset factor for the line style instance.

Parameters:

Return Value:

The offset factor for the line style instance.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

None.

Member Function: TLineStyle::GetOffsetIncrement

virtual GCoordinate GetOffsetIncrement () const

Interface Category:

API.

Purpose:

Returns the offset increment for the line style instance.

Calling Context:

Used to obtain the offset increment for the line style instance.

Parameters:

Return Value:

The offset increment for the line style instance.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

None.

Member Function: TLineStyle::Draw

virtual void Draw (TGrafPort * port, const TAttributeState & bundle, const TGPoint & origin, GCoordinate start, GCoordinate end, TSingleLineOrientation :: ELineOrientation direction, const TFont & font) const

Interface Category:

API.

Purpose:

Draws the line specified by this object.

Calling Context:

Used by line layout when drawing text to draw line styles.

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.