SimpleStyleMarkerByFontSpec < BASECLASS >
SimpleStyleMarkerByIncrementalFontSpec < BASECLASS >
SimpleStyleMarkerWithExtraDraw < BASECLASS >
SimpleStyleMarkerWithLightUnderline < BASECLASS >
StyledTextImager
StyledTextImager::RunElement
StyledTextImager::StyleMarker
StyledTextImager::StyleMarkerSummarySink
StyledTextImager::StyleMarkerSummarySinkForSingleOwner
TrivialFontSpecStyleMarker
qOldStyleMarkerBackCompatHelperCode
Basic foundations of display of 'styled', or marked up, text. The central
class of this module is StyledTextImager
SimpleStyleMarkerByFontSpec < BASECLASS > [public]
BASECLASS = StyledTextImager::StyleMarker
Very frequently, you will want to implement a style-marker which just uses some Led_FontSpecification
StandardStyledTextImager::StandardStyleMarker
does.
This class is an abstract class, where you must specify the particular Led_FontSpecification
by overriding
the pure-virtual SimpleStyleMarkerByFontSpec::MakeFontSpec. That font-spec is then used in the various
DrawSegemnt () etc overrides.
This class is not intended to be an abstract interface one programs to, but rather a helper class for subclasses
of the abstract StyledTextImager::StyleMarker
class. So you are not encouraged to declare variables of the type
SimpleStyleMarkerByFontSpec<>*
. Just use the class as a helper.
See TrivialFontSpecStyleMarker
for an even simpler class to use.
Member Details |
---|
Virtual method which subclasses override to specify how they want to have the given text displayed.
Hopefully enough context is passed into this function to make this helper class widely applicable. All it must do is return
a simple By default, it just returns the default font associated with the imager. |
SimpleStyleMarkerByIncrementalFontSpec < BASECLASS > [public]
BASECLASS (which should be a subclass of SimpleStyleMarkerByFontSpec < BASECLASS >
)
This helper can be used to avoid manually subclassing SimpleStyleMarkerByFontSpec
and instead, just takes an Led_IncrementalFontSpecification
and does the right thing - mapping
that into what is displayed.
SimpleStyleMarkerWithExtraDraw < BASECLASS > [public]
SimpleStyleMarkerByFontSpec < BASECLASS >
with BASECLASS defaulting to StyledTextImager::StyleMarker
Very frequently, you will want to implement a style-marker which just draws some extra stuff drawn at the end.
This class is an abstract class, where you must specify the particular extra drawing in the
SimpleStyleMarkerWithExtraDraw
method.
See also SimpleStyleMarkerWithLightUnderline
.
Member Details |
---|
Pure virtual method which subclasses override to specify how they want to draw (some additional markup - e.g. an underline). |
SimpleStyleMarkerWithLightUnderline < BASECLASS > [public]
BASECLASS
Very frequently, you will want to implement a style-marker which just draws some extra stuff drawn at the end.
This template is typically used with the default BASECLASS of SimpleStyleMarkerWithExtraDraw
.
StyledTextImager [public]
virtual TextImager
The class StyledTextImager is a TextImager
which knows about special markers,
either owned by itself, or the TextStore, which it uses to render and
measure the text. It is intended that these special markers it uses to
render the text (StyledTextImager::StyleMarker
's) be general enough to support both standard
style runs, as well as other fancier text adornments, like pictures, opendoc
embeddings, etc.
You can add arbitrary, and overlapping StyleMarkers to this class, and it will
simply render them. Since it must pick ONE StyleMarker to ask todo the drawing,
it asks the one with the highest priority (StyledTextImager::StyleMarker::GetPriority
()). If you
have some style marker which is smart enuf to pay attention to the
overlapping of markers (RARE - IF EVER) it is up to your marker to find which
other markers it overlaps with, and handle this combination itself.
This class is intended to make easy things like wrapping keywords with little markers which affect how they are displayed. It is ideal for something like a programming text editor which colors keywords, or a typical web browser that has to keep associated links with parts of the text anyhow (keep it in a marker that subclasses from SytleMarker, and then change the color, or font of your display).
For the more conventional Style-Run type API, see the class StandardStyledTextImager
.
Member Details |
---|
Create a summary of the style markers applied to a given range of text (by default using
|
StyledTextImager::RunElement [public]
A simple summary structure typically used from
StandardStyledTextImager::SummarizeStyleMarkers
, or subclasses, to represent the net effect of overlapping
style runs.
struct StyledTextImager::RunElement {
...
StyleMarker* fMarker;
size_t fLength;
vector<StyleMarker*> fSupercededMarkers;
...
};
StyledTextImager::StyleMarker [public]
Marker
Abstract class - subclass this to provide custom style drawing. Managed by
class StyledTextImager
.
Member Details |
---|
This pure-virtual hook function is called when the given range of text needs to be drawn. (SHOULD EXPLAIN THIS ALOT MORE!!!) |
Since we can have style markers overlap, we need someway to deal with conflicting style information. Since some style elements can be arbitrary drawing code, like an OpenDoc part, or a picture, we cannot genericly write code to merge styles. So we invoke a somewhat hackish priority scheme, where the marker with the highest priority is what is asked todo the drawing. The priority of StandardStyleMarker is eBaselinePriority - ZERO - as a reference. So you can specify easily either markers that take precedence over, or are always superseded by the standard style markers. And this returns eBaselinePriority - ZERO - by default. |
This pure-virtual hook function is called when the given range of text needs to be measured (baseline of text segment). (SHOULD EXPLAIN THIS ALOT MORE!!!) |
This pure-virtual hook function is called when the given range of text needs to be measured (character widths). (SHOULD EXPLAIN THIS ALOT MORE!!!) |
This pure-virtual hook function is called when the given range of text needs to be measured (hieght of text segment). (SHOULD EXPLAIN THIS ALOT MORE!!!) |
StyledTextImager::StyleMarkerSummarySink [public]
TextStore::MarkerSink
A marker sink used in calls to TextStore::CollectAllMarkersInRangeInto
to extract from the textstore
the style marker information which applies to a given region of text. This is typically used from
StandardStyledTextImager::SummarizeStyleMarkers
, or subclasses. And you would override it (and that method)
to provide an alternate mechanism for combining/interpretting style markers within a region (say when the overlap).
Member Details |
---|
When two style markers overlap, which one gets todo the drawing? As part of the summarizing
process ( This default algorithm simply chooses the one with the higher priority. Subclassers can override this behavior, and, for instance, restrict paying attention to only a particular subtype of '@StyleMarker's, or maybe to set particular values into one (chosen subtype marker to connote the overlap, and allow this to effect the draw. Or, perhaps, a subclass might ingnore markers with a particular owner value. Note that markers NOT used can be placed in the |
Private routine to split the current list of buckets at a particular position. Called with the endpoints of a new marker. |
StyledTextImager::StyleMarkerSummarySinkForSingleOwner [public]
StyledTextImager::StyleMarkerSummarySink
Ignore style markers from an owner other than the one given as argument in the constructor.
Member Details |
---|
Like |
TrivialFontSpecStyleMarker [public]
SimpleStyleMarkerByIncrementalFontSpec < BASECLASS >
with BASECLASS = SimpleStyleMarkerByFontSpec < BASECLASS >
.
This class just adds to SimpleStyleMarkerByFontSpec a field which is the Led_IncrementalFontSpecification
.
This is not intended to be subclassed. If you do subclass - beware the overload of operator new () and
block-allocation usage. Or better yet, subclass SimpleStyleMarkerByIncrementalFontSpec
instead.
qOldStyleMarkerBackCompatHelperCode [public]
See notes in SPR#0718. Defaults to qSupportLed23CompatAPI
. Won't exist after Led 3.0.