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.
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.
- TLineStyle ()
- TLineStyle (const TLineStyle &)
- TLineStyle (GCoordinate offsetIncrement, GCoordinate thicknessIncrement, bool coverSpaces =true, bool useCharacterBaseline =false)
- TLineStyle (const TAttributeState & paint, GCoordinate offsetIncrement, GCoordinate thicknessIncrement, bool coverSpaces =true, bool useCharacterBaseline =false)
- TLineStyle (GCoordinate offsetIncrement, GCoordinate offsetFactor, GCoordinate thicknessIncrement, GCoordinate thicknessFactor, bool coverSpaces =true, bool useCharacterBaseline =false)
- TLineStyle (const TAttributeState & paint, GCoordinate offsetIncrement, GCoordinate offsetFactor, GCoordinate thicknessIncrement, GCoordinate thicknessFactor, bool coverSpaces =true, bool useCharacterBaseline =false)
Interface Category:
API.
Purpose:
- Default constructor.
- Copy constructor.
- Constructs a style object with specific values.
- Constructs a style object with specific values.
- Constructs a style object with specific values.
- Constructs a style object with specific values.
Calling Context:
- Called by the stream-in operators.
- Called to copy an object.
- Call to construct a style object with specific values.
- Call to construct a style object with specific values.
- Call to construct a style object with specific values.
- Call to construct a style object with specific values.
Parameters:
- Takes no parameters.
- const TLineStyle & -The object to copy.
- GCoordinate offsetIncrement -The offset increment (absolute value for positioning).
- GCoordinate thicknessIncrement -The thickness increment (absolute value of thickness).
- bool coverSpaces =true -Indicates if spaces also have the line drawn.
- bool useCharacterBaseline =false -Indicates if the line should be drawn wherever the character's baseline falls (for example, moving up and down with super- and subscripts).
- const TAttributeState & paint -The line's color.
- GCoordinate offsetIncrement -The offset increment (absolute value for positioning).
- GCoordinate thicknessIncrement -The thickness increment (absolute value of thickness).
- bool coverSpaces =true -Indicates if the spaces also have the line drawn.
- bool useCharacterBaseline =false -Indicates if the line should be drawn wherever the character's baseline falls (for example, moving up and down with super- and subscripts).
- GCoordinate offsetIncrement -The offset increment (absolute value for positioning).
- GCoordinate offsetFactor -The offset factor (value for positioning as a multiple of the point size).
- GCoordinate thicknessIncrement -The thickness increment (absolute value of thickness).
- GCoordinate thicknessFactor -The thickness factor (thickness of the line as a multiple of the point size).
- bool coverSpaces =true -Indicates if spaces also have the line drawn.
- bool useCharacterBaseline =false -Indicates if the line should be drawn wherever the character's baseline falls (for example, moving up and down with super- and subscripts).
- const TAttributeState & paint -The line's color.
- GCoordinate offsetIncrement -The offset increment (absolute value for positioning).
- GCoordinate offsetFactor -The offset factor (value for positioning as a multiple of the point size).
- GCoordinate thicknessIncrement -The thickness increment (absolute value of thickness).
- GCoordinate thicknessFactor -The thickness factor (thickness of the line as a multiple of the point size).
- bool coverSpaces =true -Indicates if spaces also have the line drawn.
- bool useCharacterBaseline =false -Indicates if the line should be drawn wherever the character's baseline falls (for example, moving up and down with super- and subscripts).
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:
- TStream & fromWhere -The stream the object streams itself in from.
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:
- TStream & toWhere -The stream the object streams itself out to.
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:
- const TStyle & thatStyle -The object to compare with this object.
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
- virtual void SetLine (GCoordinate offsetIncrement, GCoordinate thickness, bool coverSpaces =true, bool useCharacterBaseline =false)
- virtual void SetLine (const TAttributeState & paint, GCoordinate offsetIncrement, GCoordinate thickness, bool coverSpaces =true, bool useCharacterBaseline =false)
- virtual void SetLine (GCoordinate offsetIncrement, GCoordinate offsetFactor, GCoordinate thicknessIncrement, GCoordinate thicknessFactor, bool coverSpaces =true, bool useCharacterBaseline =false)
- virtual void SetLine (const TAttributeState & paint, GCoordinate offsetIncrement, GCoordinate offsetFactor, GCoordinate thicknessIncrement, GCoordinate thicknessFactor, bool coverSpaces =true, bool useCharacterBaseline =false)
Interface Category:
API.
Purpose:
- Sets the characteristics of the line.
- Sets the characteristics of the line.
- Sets the characteristics of the line.
- Sets the characteristics of the line.
Calling Context:
- Used by TLineStyle derived classes to set the characteristics of the line.
- Used by TLineStyle derived classes to set the characteristics of the line.
- Used by TLineStyle derived classes to set the characteristics of the line.
- Used by TLineStyle derived classes to set the characteristics of the line.
Parameters:
- GCoordinate offsetIncrement -The positioning increment for the line.
- GCoordinate thickness -The thickness increment for the line.
- bool coverSpaces =true -The value for the line's coverSpaces flag.
- bool useCharacterBaseline =false -The value for the line's useCharacterBaseline flag.
- const TAttributeState & paint -The line's color.
- GCoordinate offsetIncrement -The positioning increment for the line.
- GCoordinate thickness -The thickness increment for the line.
- bool coverSpaces =true -The value for the line's coverSpaces flag.
- bool useCharacterBaseline =false -The value for the line's useCharacterBaseline flag.
- GCoordinate offsetIncrement -The positioning increment for the line.
- GCoordinate offsetFactor -The positioning factor for the line.
- GCoordinate thicknessIncrement -The thickness increment for the line.
- GCoordinate thicknessFactor -The thickness factor for the line.
- bool coverSpaces =true -The value for the line's coverSpaces flag.
- bool useCharacterBaseline =false -The value for the line's useCharacterBaseline flag.
- const TAttributeState & paint -The line's color.
- GCoordinate offsetIncrement -The positioning increment for the line.
- GCoordinate offsetFactor -The positioning factor for the line.
- GCoordinate thicknessIncrement -The thickness increment for the line.
- GCoordinate thicknessFactor -The thickness factor for the line.
- bool coverSpaces =true -The value for the line's coverSpaces flag.
- bool useCharacterBaseline =false -The value for the line's useCharacterBaseline flag.
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:
- TGrafPort * port -The grafport in which to draw.
- const TAttributeState & bundle -The color of the line.
- const TGPoint & origin -The origin of the text.
- GCoordinate start -The point at which to start the line.
- GCoordinate end -The point at which the line ends.
- TSingleLineOrientation :: ELineOrientation direction -The direction of the line.
- const TFont & font -The font of the text.
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.