EmptySelectionParagraphSavedTextRep < BASECLASS >
StandardStyledWordWrappedTextInteractor
WordProcessor
WordProcessor::CommandNames
WordProcessor::HidableTextDatabasePtr
WordProcessor::IncrementalParagraphInfo
WordProcessor::NoParagraphDatabaseAvailable
WordProcessor::ParagraphDatabasePtr
WordProcessor::ParagraphDatabaseRep
WordProcessor::ParagraphInfo
WordProcessor::ParagraphInfoMarker
WordProcessor::WordProcessorFlavorPackageExternalizer
WordProcessor::WordProcessorFlavorPackageInternalizer
WordProcessor::WordProcessorTextIOSinkStream
WordProcessor::WordProcessorTextIOSrcStream
WordProcessorCommonCommandHelper < BASECLASS,CMD_INFO,CMD_ENABLER >
WordProcessorCommonCommandHelper_DefaultCmdInfo
WordProcessorHScrollbarHelper < BASECLASS >
This module contains all the classes needed to implement a typical
word-processor UI. These things include per-paragraph tab stops, justification,
margins, etc. The main class you should be interested in is the WordProcessor
class.
EmptySelectionParagraphSavedTextRep < BASECLASS > [public]
StandardStyledTextInteractor::EmptySelStyleTextRep
StandardStyledWordWrappedTextInteractor [public]
InteractorInteractorMixinHelper < INTERACTOR1,INTERACTOR2 >
, (INTERACTOR1=StandardStyledTextInteractor
,INTERACTOR2=WordWrappedTextInteractor
)
A simple mixin of WordWrappedTextInteractor
and StandardStyledTextInteractor
using InteractorInteractorMixinHelper.
Takes care of the nitty-gritty of combining their behaviors.
WordProcessor [public]
StandardStyledWordWrappedTextInteractor
A fancy word processor. Add high-end editing, more word-processor like features here. For example, paragraph formating, justification, margins, remembered per-paragraph tabstops settings, etc.
Member Details |
---|
Examine each paragraph from 'from' to 'to', and set their various paragraph properties to fit their indent level. If I supported style sheets, this would be a natural place to use them (just applying a predefined style sheet). |
TextImager::ContainsMappedDisplayCharacters to optionally map '\n' etc characters.
|
Override |
|
|
Returns command name for each of the user-visible commands produced by this module. This name is used used in the constructed Undo command name, as in, "Undo Justification". You can replace this name with whatever you like.You change this value with WordProcessor::SetCommandNames. The point of this is to allow for different UI-language localizations, without having to change Led itself. See also |
Get the 'first indent' property for the paragraph containing the given character position. |
Get the 'first indent' property for the paragraphs bounded by the given range, if it is unique over that range, and return true. If it is not unqique over that range, return false. |
Return the |
Return true iff there is a unique answer, and only then to we set out justification param ( |
WordWrappedTextImager::GetLayoutMargins to take into account paragraph info, like
margins, etc.
|
|
|
|
|
Return the string (computed often, as with roman numeral lists) which gets inserted to designate the list marker. |
Return the width (Led_Distance) of the leader. Based on result from |
|
|
Return the left and right margin settings for the paragraph containing the character characterPos |
|
|
|
|
|
|
|
Return the tabstops list setting for the paragraph containing the character characterPos |
Return true iff there is a unique answer, and only then to we set out |
Override |
Override @TextInteractor::HookExternalizerChanged' to sync up with our HidableText database. |
Called whenever the Usually called by |
Default implementation of |
Override @TextInteractor::HookInternalizerChanged' to sync up with our HidableText database. |
Called whenever the Usually called by |
Default implementation of |
|
|
|
|
|
Roughly equivilent to |
|
|
Interactively set the given region to be hidable or not. Interactively means that the action is considered an undoable command. |
TextImager::ContainsMappedDisplayCharacters to optionally map '\n' etc characters.
|
PartitioningTextImager::ResetTabStops to adjust the tabstop computation to take
into account the left hand side margin.
|
|
|
This method allows the caller to specify the database of hidden-text information associated with the given word processor. If not called, a default will be used, and automatically deleted. This API exists so that you can share a single database To disable hidden text support, just call this method from your TextImager::HookGainedNewTextStore () override, and pass NULL. Do this after the WordProcessor::HookGainedNewTextStore () override - since that method will create one of these by default. |
Set the justification to |
|
|
|
|
This method allows the caller to specify the database of paragraph information associated with the given word processor. If not called, a default will be used, and automatically deleted. This API exists so that you can share a single database |
The 'ShowParagraphGlyphs' property determines whether or not a glyph (image) is shown on the screen where the end of a paragraph (newline character) would be if it were visible. This defaults to off See also |
The 'ShowSpaceGlyphs' property determines whether or not a glyph (image) is shown on the screen where the space characters would be if they were visible. This defaults to off See also |
The 'ShowTabGlyphs' property determines whether or not a glyph (image) is shown on the screen where the tab characters would be if they were visible. This defaults to off See also |
|
|
Set the tabstops to |
WordProcessor::CommandNames [public]
Command names for each of the user-visible commands produced by the WordProcessor
module.
This name is used used in the constructed Undo command name, as
in, "Undo Justification". You can replace this name with whatever you like.
You change this value with WordProcessor::SetCommandNames
.
The point of this is to allow for different UI-language localizations, without having to change Led itself.
See also WordProcessor::GetCommandNames
.
WordProcessor::HidableTextDatabasePtr [public]
Led_RefCntPtr < T >
, (T=HidableTextMarkerOwner
)
A Led_RefCntPtr (smart pointer) to a HidableTextMarkerOwner
.
WordProcessor::IncrementalParagraphInfo [public]
WordProcessor::ParagraphInfo
Overload (hide) the WordProcessor::ParagraphInfo
methods, to assert that the
attribute is valid (for getters) and to set a ValidFlag for the setters. And add methods for
each attribute to test for validity, and to invalidate.
These are used if you want to set just part of a WordProcessor::ParagraphInfo
.
WordProcessor::NoParagraphDatabaseAvailable [public]
TextImager::NotFullyInitialized
Thrown by WordProcessor::GetLayoutMargins
etc when no WordProcessor::ParagraphDatabasePtr
available.
WordProcessor::ParagraphDatabasePtr [public]
Led_RefCntPtr < T >
, (T=WordProcessor::ParagraphDatabaseRep
)
A Led_RefCntPtr (smart pointer) to a WordProcessor::ParagraphDatabaseRep
.
WordProcessor::ParagraphDatabaseRep [public]
MarkerCover < MARKER,MARKERINFO,INCREMENTALMARKERINFO >
, (MARKER=WordProcessor::ParagraphInfoMarker
,MARKERINFO=WordProcessor::ParagraphInfo
,INCREMENTALMARKERINFO=WordProcessor::IncrementalParagraphInfo
)
A MarkerCover which associates WordProcessor::ParagraphInfo
with each paragraph in the next (merging together adjacent
identical ones). Paragraphs are defined by the Partition
object associated
(WordProcessor::ParagraphDatabaseRep::SetPartition).
Member Details |
---|
Called internally to check that all the paragraph info records in the MarkerCover respect the contraint that they start and end on paragraph boundaries. |
Return the default |
Override |
Override |
WordProcessor::ParagraphInfo [public]
An object which captures the per-paragraph information we store especially in the
WordProcessor
class. The attributes stored include:
Member Details |
---|
Return the |
Get the spacing used between rows of a given paragraph. Can either be magic value of 1000 - meaning automatic. From the RTF docs: If this control word is missing or if \sl1000 is used, the line spacing is automatically determined by the tallest character in the line; if N is a positive value, this size is used only if it is taller than the tallest character (otherwise, the tallest character is used); if N is a negative value, the absolute value of N is used, even if it is shorter than the tallest character. See the RTF docs for \slN and \slmultN |
Retrieve the indent level for the given list. Only valid value if |
Retrieve the WordProcessor::ParagraphInfo::ListStyle property associated with this paragraph (e.g. eListStyle_Bullet or eListStyle_None). |
Get the 'space after' attribute of the given paragraph. This is the number of TWIPS of space appended after the paragraph - and defaults to zero. See the RTF \sa tag. |
Get the 'space before' attribute of the given paragraph. This is the number of TWIPS of space inserted before the paragraph - and defaults to zero. See the RTF \sb tag. |
Set the |
|
|
|
|
|
WordProcessor::ParagraphInfoMarker [public]
Marker
WordProcessor::WordProcessorFlavorPackageExternalizer [public]
virtual StandardStyledTextInteractor::StyledTextFlavorPackageExternalizer
Add paragraph etc support support by creating a WordProcessor::WordProcessorTextIOSrcStream
.
WordProcessor::WordProcessorFlavorPackageInternalizer [public]
virtual StandardStyledTextInteractor::StyledTextFlavorPackageInternalizer
Add paragraph etc support support by creating a WordProcessor::WordProcessorTextIOSinkStream
.
WordProcessor::WordProcessorTextIOSinkStream [public]
StandardStyledTextInteractor::StandardStyledTextIOSinkStream
A StandardStyledTextInteractor::StandardStyledTextIOSinkStream
, for use with the StyledTextIO module,
which adds support for a WordProcessor::ParagraphDatabasePtr
.
WordProcessor::WordProcessorTextIOSrcStream [public]
StandardStyledTextInteractor::StandardStyledTextIOSrcStream
A StandardStyledTextInteractor::StandardStyledTextIOSrcStream
, for use with the StyledTextIO module,
which adds support for a WordProcessor::ParagraphDatabasePtr
.
Member Details |
---|
|
|
|
|
WordProcessorCommonCommandHelper < BASECLASS,CMD_INFO,CMD_ENABLER > [public]
TextInteractorCommonCommandHelper < BASECLASS,CMD_INFO,CMD_ENABLER >
Utility template to implement some sharable code to handle selection based wordprocessor font/style commands.
NB: BASECLASS
must be a subclass of WordProcessor
.
The class CMD_ENABLER
must look roughly like this and have these methods:
class TmpCmdUpdater {
public:
typedef unsigned int CommandNumber;
public:
nonvirtual CommandNumber GetCmdID (bool enabled);
// enable the command
nonvirtual void SetEnabled (bool enabled);
// check the menu item
nonvirtual void SetChecked (bool checked);
nonvirtual void SetText (const Led_SDK_Char* text);
};
You may be able to find one of these in your class library wrappers module. For example, using MFC, you can
use Led_MFC_TmpCmdUpdater
.
The class CMD_INFO
must look roughly like this and have these methods:
class MyCommandInfo : public WordProcessorCommonCommandHelper_DefaultCmdInfo {
public:
typedef unsigned int CommandNumber;
typedef Led_FontSpecification::FontNameSpecifier FontNameSpecifier;
public:
static FontNameSpecifier CmdNumToFontName (CommandNumber cmdNum);
// return true iff the arg fontSize is one of the predefined ones from the menu
static bool IsPredefinedFontSize (Led_Distance fontSize);
static Led_Distance FontCmdToSize (CommandNumber commandNum);
// display UI (dialog box) and query user for new height)
static Led_Distance PickOtherFontHeight (Led_Distance origHeight);
static bool PickNewParagraphLineSpacing (
Led_TWIPS* spaceBefore,
bool* spaceBeforeValid,
Led_TWIPS* spaceAfter,
bool* spaceAfterValid,
Led_LineSpacing* lineSpacing,
bool* lineSpacingValid
);
static Led_Color FontCmdToColor (CommandNumber cmd);
static CommandNumber FontColorToCmd (Led_Color color);
static bool PickOtherFontColor (Led_Color* color);
// display UI (e.g. CFontDialog) to pick a new font/color
static bool ChooseFont (
Led_IncrementalFontSpecification* font
);
enum {
kBaseFontSize_CmdID = YOUSPECIFY,
kLastFontSize_CmdID = YOUSPECIFY,
kFontSizeSmaller_CmdID = YOUSPECIFY,
kFontSizeLarger_CmdID = YOUSPECIFY,
kFontSizeOther_CmdID = YOUSPECIFY,
kBaseFontColor_CmdID = YOUSPECIFY,
kLastFontColor_CmdID = YOUSPECIFY,
kFontColorOther_CmdID = YOUSPECIFY,
kFirstJustification_CmdID = YOUSPECIFY,
kLastJustification_CmdID = YOUSPECIFY,
kJustifyLeft_CmdID = YOUSPECIFY,
kJustifyCenter_CmdID = YOUSPECIFY,
kJustifyRight_CmdID = YOUSPECIFY,
kJustifyFull_CmdID = YOUSPECIFY,
kParagraphSpacingCommand_CmdID = YOUSPECIFY,
kFontMenuFirst_CmdID = YOUSPECIFY,
kFontMenuLast_CmdID = YOUSPECIFY,
kFontStylePlain_CmdID = YOUSPECIFY,
kFontStyleBold_CmdID = YOUSPECIFY,
kFontStyleItalic_CmdID = YOUSPECIFY,
kFontStyleUnderline_CmdID = YOUSPECIFY,
#if qMacOS
kFontStyleOutline_CmdID = YOUSPECIFY,
kFontStyleShadow_CmdID = YOUSPECIFY,
kFontStyleCondensed_CmdID = YOUSPECIFY,
kFontStyleExtended_CmdID = YOUSPECIFY,
#elif qWindows
kFontStyleStrikeout_CmdID = YOUSPECIFY,
#endif
kSubScriptCommand_CmdID = YOUSPECIFY,
kSuperScriptCommand_CmdID = YOUSPECIFY,
kChooseFontCommand_CmdID = YOUSPECIFY,
kHideSelection_CmdID = YOUSPECIFY,
kUnHideSelection_CmdID = YOUSPECIFY,
kFirstShowHideGlyph_CmdID = YOUSPECIFY,
kLastShowHideGlyph_CmdID = YOUSPECIFY,
kShowHideParagraphGlyphs_CmdID = YOUSPECIFY,
kShowHideTabGlyphs_CmdID = YOUSPECIFY,
kShowHideSpaceGlyphs_CmdID = YOUSPECIFY,
};
};
This CMD_INFO
class you must provide yourself, based on information about your program. You may want
to look at the LedItMFC sample application for an example of this.
Note also - you SHOULD have your CMD_INFO class subclass from
WordProcessorCommonCommandHelper_DefaultCmdInfo
- so that as new commands are added, your code will inherit
default (ignored) values for the command numbers. Otherwise, your code may fail to compile with newer
versions of Led, until you add the new command ids.
WordProcessorCommonCommandHelper_DefaultCmdInfo [public]
TextInteractorCommandHelper_DefaultCmdInfo
Helper for the WordProcessorCommonCommandHelper
template.
When you specify a command-info structure, subclass it from this class. That way - when new commands are added, they will have default values provided for newly added commands.
WordProcessorHScrollbarHelper < BASECLASS > [public]
BASECLASS
Utility template to implement some sharable code to compute h scrollpos.
Member Details |
---|
Calculate how wide an effective margin must be used for specifying the parameters for a horizontal scrollbar. By default - asks the max row width/margins for all the rows displayed in the current window (so this value can change when we scroll or edit text). This can be overriden to implement something like wrap-to-window. |
Override |