Led 3.0 Class Library Documentation

Module WordProcessor


Classes and Global Functions Index

Module Description:

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.


Class: EmptySelectionParagraphSavedTextRep < BASECLASS > [public]

Base Classes: StandardStyledTextInteractor::EmptySelStyleTextRep
Description:

Class: StandardStyledWordWrappedTextInteractor [public]

Base Classes: InteractorInteractorMixinHelper < INTERACTOR1,INTERACTOR2 > , (INTERACTOR1=StandardStyledTextInteractor,INTERACTOR2=WordWrappedTextInteractor)
Description:

A simple mixin of WordWrappedTextInteractor and StandardStyledTextInteractor using InteractorInteractorMixinHelper. Takes care of the nitty-gritty of combining their behaviors.


Class: WordProcessor [public]

Base Classes: StandardStyledWordWrappedTextInteractor
Description:

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

WordProcessor::AutoFormatIndentedText [public]

void WordProcessor::AutoFormatIndentedText (size_t from, size_t to)

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).

WordProcessor::ContainsMappedDisplayCharacters [public]

bool WordProcessor::ContainsMappedDisplayCharacters (const Led_tChar* text, size_t nTChars) const

Override TextImager::ContainsMappedDisplayCharacters to optionally map '\n' etc characters.

WordProcessor::DrawRowSegments [public]

void WordProcessor::DrawRowSegments (const RowReference& row, Led_Tablet tablet, const Led_Rect& currentRowRect, const Led_Rect& invalidRowRect,

Override MultiRowTextImager::DrawRowSegments to support things like indents, and justification.

WordProcessor::GetCharAtLocationRowRelative [public]

size_t WordProcessor::GetCharAtLocationRowRelative (const Led_Point& where, RowReference topRow, size_t maxRowsToCheck) const

Override TextImager::GetCharAtLocationRowRelative to adjust calculations for things like indents, and justification.

WordProcessor::GetCharLocationRowRelative [public]

Led_Rect WordProcessor::GetCharLocationRowRelative (size_t afterPosition, RowReference topRow, size_t maxRowsToCheck) const

Override TextImager::GetCharLocationRowRelative to adjust calculations for things like indents, and justification.

WordProcessor::GetCommandNames [public]

const WordProcessor::CommandNames& WordProcessor::GetCommandNames ()

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 WordProcessor::CommandNames.

WordProcessor::GetFirstIndent [public]

Led_TWIPS WordProcessor::GetFirstIndent (size_t characterPos) const

Get the 'first indent' property for the paragraph containing the given character position.

WordProcessor::GetFirstIndent (overload 1) [public]

bool WordProcessor::GetFirstIndent (size_t from, size_t to, Led_TWIPS* firstIndent) const

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.

WordProcessor::GetJustification [public]

Led_Justification WordProcessor::GetJustification (size_t characterPos) const

Return the Led_Justification setting for the paragraph containing the character characterPos

WordProcessor::GetJustification (overload 1) [public]

bool WordProcessor::GetJustification (size_t from, size_t to, Led_Justification* justification) const

Return true iff there is a unique answer, and only then to we set out justification param (Led_Justification).

WordProcessor::GetLayoutMargins [public]

void WordProcessor::GetLayoutMargins (RowReference row, Led_Coordinate* lhs, Led_Coordinate* rhs) const

Override WordWrappedTextImager::GetLayoutMargins to take into account paragraph info, like margins, etc.

WordProcessor::GetLineSpacing [public]

Led_LineSpacing WordProcessor::GetLineSpacing (size_t characterPos) const

See WordProcessor::ParagraphInfo::GetLineSpacing

WordProcessor::GetLineSpacing (overload 1) [public]

bool WordProcessor::GetLineSpacing (size_t from, size_t to, Led_LineSpacing* sl) const

See WordProcessor::ParagraphInfo::GetLineSpacing

WordProcessor::GetListIndentLevel [public]

unsigned char WordProcessor::GetListIndentLevel (size_t characterPos) const

See WordProcessor::ParagraphInfo::GetListIndentLevel

WordProcessor::GetListIndentLevel (overload 1) [public]

bool WordProcessor::GetListIndentLevel (size_t from, size_t to, unsigned char* indentLevel) const

See WordProcessor::ParagraphInfo::GetListIndentLevel

WordProcessor::GetListLeader [public]

Led_tString WordProcessor::GetListLeader (size_t paragraphMarkerPos) const

Return the string (computed often, as with roman numeral lists) which gets inserted to designate the list marker.

WordProcessor::GetListLeaderLength [public]

Led_Distance WordProcessor::GetListLeaderLength (size_t paragraphMarkerPos) const

Return the width (Led_Distance) of the leader. Based on result from WordProcessor::GetListLeader.

WordProcessor::GetListStyle [public]

ListStyle WordProcessor::GetListStyle (size_t characterPos) const

See WordProcessor::ParagraphInfo::GetListStyle

WordProcessor::GetListStyle (overload 1) [public]

bool WordProcessor::GetListStyle (size_t from, size_t to, ListStyle* listStyle) const

See WordProcessor::ParagraphInfo::GetListStyle

WordProcessor::GetMargins [public]

void WordProcessor::GetMargins (size_t characterPos, Led_TWIPS* leftMargin, Led_TWIPS* rightMargin) const

Return the left and right margin settings for the paragraph containing the character characterPos

WordProcessor::GetShowParagraphGlyphs [public]

bool WordProcessor::GetShowParagraphGlyphs () const

See WordProcessor::SetShowParagraphGlyphs.

WordProcessor::GetShowSpaceGlyphs [public]

bool WordProcessor::GetShowSpaceGlyphs () const

See WordProcessor::SetShowSpaceGlyphs.

WordProcessor::GetShowTabGlyphs [public]

bool WordProcessor::GetShowTabGlyphs () const

See WordProcessor::SetShowTabGlyphs.

WordProcessor::GetSpaceAfter [public]

Led_TWIPS WordProcessor::GetSpaceAfter (size_t characterPos) const

See WordProcessor::ParagraphInfo::GetSpaceAfter

WordProcessor::GetSpaceAfter (overload 1) [public]

bool WordProcessor::GetSpaceAfter (size_t from, size_t to, Led_TWIPS* sa) const

See WordProcessor::ParagraphInfo::GetSpaceAfter

WordProcessor::GetSpaceBefore [public]

Led_TWIPS WordProcessor::GetSpaceBefore (size_t characterPos) const

See WordProcessor::ParagraphInfo::GetSpaceBefore

WordProcessor::GetSpaceBefore (overload 1) [public]

bool WordProcessor::GetSpaceBefore (size_t from, size_t to, Led_TWIPS* sb) const

See WordProcessor::ParagraphInfo::GetSpaceBefore

WordProcessor::GetStandardTabStopList [public]

TextImager::StandardTabStopList WordProcessor::GetStandardTabStopList (size_t characterPos) const

Return the tabstops list setting for the paragraph containing the character characterPos

WordProcessor::GetStandardTabStopList (overload 1) [public]

bool WordProcessor::GetStandardTabStopList (size_t from, size_t to, StandardTabStopList* tabStops) const

Return true iff there is a unique answer, and only then to we set out tabStops param

WordProcessor::GetTabStopList [public]

const TextImager::TabStopList& WordProcessor::GetTabStopList (size_t containingPos) const

Override TextImager::GetTabStopList - to return the tabstoplist associated with this paragraph.

WordProcessor::HookExternalizerChanged [public]

void WordProcessor::HookExternalizerChanged ()

Override @TextInteractor::HookExternalizerChanged' to sync up with our HidableText database.

WordProcessor::HookHidableTextDatabaseChanged [public]

void WordProcessor::HookHidableTextDatabaseChanged ()

Called whenever the WordProcessor::HidableTextDatabasePtr associated with this WordProcessor is changed. This means when a new one is provided, created, or disassociated. It does NOT mean that its called when any of the data in the hidable text database changes.

Usually called by WordProcessor::SetHidableTextDatabase. By default, it calls WordProcessor::HookHidableTextDatabaseChanged_.

WordProcessor::HookHidableTextDatabaseChanged_ [public]

void WordProcessor::HookHidableTextDatabaseChanged_ ()

Default implementation of WordProcessor::HookHidableTextDatabaseChanged. Assures that when we change the hidableText database, we re-create the our internalizer and externalizers (cuz those can depend on the hidden text database). And be sure to notify any newly created hidable text database of our current internalizer and externalizer (the reverse).

WordProcessor::HookInternalizerChanged [public]

void WordProcessor::HookInternalizerChanged ()

Override @TextInteractor::HookInternalizerChanged' to sync up with our HidableText database.

WordProcessor::HookParagraphDatabaseChanged [public]

void WordProcessor::HookParagraphDatabaseChanged ()

Called whenever the WordProcessor::ParagraphDatabasePtr associated with this WordProcessor is changed. This means when a new one is provided, created, or disassociated. It does NOT mean that its called when any of the data in the paragphrase database changes.

Usually called by WordProcessor::SetParagraphDatabase. By default, it calls WordProcessor::HookParagraphDatabaseChanged_.

WordProcessor::HookParagraphDatabaseChanged_ [public]

void WordProcessor::HookParagraphDatabaseChanged_ ()

Default implementation of WordProcessor::HookParagraphDatabaseChanged.

WordProcessor::InteractiveDoIndentChange [public]

void WordProcessor::InteractiveDoIndentChange (bool increase)

WordProcessor::InteractiveSetFirstIndent [public]

void WordProcessor::InteractiveSetFirstIndent (Led_TWIPS firstIndent)

WordProcessor::InteractiveSetJustification [public]

void WordProcessor::InteractiveSetJustification (Led_Justification justification)

WordProcessor::InteractiveSetListStyle [public]

void WordProcessor::InteractiveSetListStyle (ListStyle listStyle)

WordProcessor::InteractiveSetMargins [public]

void WordProcessor::InteractiveSetMargins (Led_TWIPS leftMargin, Led_TWIPS rightMargin)

WordProcessor::InteractiveSetMarginsAndFirstIndent [public]

void WordProcessor::InteractiveSetMarginsAndFirstIndent (Led_TWIPS leftMargin, Led_TWIPS rightMargin, Led_TWIPS firstIndent)

Roughly equivilent to WordProcessor::InteractiveSetMargins followed by WordProcessor::InteractiveSetFirstIndent except that they are bundled together into one action, as far as UNDO is concerned.

WordProcessor::InteractiveSetParagraphSpacing [public]

void WordProcessor::InteractiveSetParagraphSpacing (Led_TWIPS spaceBefore, bool spaceBeforeValid, Led_TWIPS spaceAfter, bool spaceAfterValid, Led_LineSpacing lineSpacing, bool lineSpacingValid)

WordProcessor::InteractiveSetStandardTabStopList [public]

void WordProcessor::InteractiveSetStandardTabStopList (StandardTabStopList tabStops)

WordProcessor::InterectiveSetRegionHidable [public]

void WordProcessor::InterectiveSetRegionHidable (bool hidable)

Interactively set the given region to be hidable or not. Interactively means that the action is considered an undoable command.

WordProcessor::ReplaceMappedDisplayCharacters [public]

void WordProcessor::ReplaceMappedDisplayCharacters (const Led_tChar* srcText, Led_tChar* copyText, size_t nTChars) const

Override TextImager::ContainsMappedDisplayCharacters to optionally map '\n' etc characters.

WordProcessor::ResetTabStops [public]

size_t WordProcessor::ResetTabStops (size_t from, const Led_tChar* text, size_t nTChars, Led_Distance* charLocations, size_t startSoFar) const

Override PartitioningTextImager::ResetTabStops to adjust the tabstop computation to take into account the left hand side margin.

WordProcessor::SetCommandNames [public]

void WordProcessor::SetCommandNames (const WordProcessor::CommandNames& cmdNames)

See WordProcessor::GetCommandNames.

WordProcessor::SetFirstIndent [public]

void WordProcessor::SetFirstIndent (size_t from, size_t to, Led_TWIPS firstIndent)

WordProcessor::SetHidableTextDatabase [public]

void WordProcessor::SetHidableTextDatabase (const HidableTextDatabasePtr& hidableTextDatabase)

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 WordProcessor::HidableTextDatabasePtr with multiple views. And so you can save it associated with a document (or some such object), and dynamically create/destroy views using that data. Also - so you can subclass it, and provide your own virtual replacement database, or other subclass of the hidable text API.

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.

WordProcessor::SetJustification [public]

void WordProcessor::SetJustification (size_t from, size_t to, Led_Justification justification)

Set the justification to justification for all paragraphs between from and to.

WordProcessor::SetLineSpacing [public]

void WordProcessor::SetLineSpacing (size_t from, size_t to, Led_LineSpacing sl)

See WordProcessor::ParagraphInfo::SetLineSpacing

WordProcessor::SetListIndentLevel [public]

void WordProcessor::SetListIndentLevel (size_t from, size_t to, unsigned char indentLevel, bool autoFormat)

See WordProcessor::ParagraphInfo::SetListIndentLevel

WordProcessor::SetListStyle [public]

void WordProcessor::SetListStyle (size_t from, size_t to, ListStyle listStyle, bool autoFormat)

See WordProcessor::ParagraphInfo::SetListStyle

WordProcessor::SetMargins [public]

void WordProcessor::SetMargins (size_t from, size_t to, Led_TWIPS leftMargin, Led_TWIPS rightMargin)

See WordProcessor::GetMargins.

WordProcessor::SetParagraphDatabase [public]

void WordProcessor::SetParagraphDatabase (const ParagraphDatabasePtr& paragraphDatabase)

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 WordProcessor::ParagraphDatabasePtr with multiple views. And so you can save it associated with a document (or some such object), and dynamically create/destroy views using that data. Also - so you can subclass it, and provide your own virtual replacement database.

WordProcessor::SetShowParagraphGlyphs [public]

void WordProcessor::SetShowParagraphGlyphs (bool showParagraphGlyphs)

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 WordProcessor::GetShowParagraphGlyphs.

WordProcessor::SetShowSpaceGlyphs [public]

void WordProcessor::SetShowSpaceGlyphs (bool showSpaceGlyphs)

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 WordProcessor::GetShowSpaceGlyphs.

WordProcessor::SetShowTabGlyphs [public]

void WordProcessor::SetShowTabGlyphs (bool showTabGlyphs)

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 WordProcessor::GetShowTabGlyphs.

WordProcessor::SetSpaceAfter [public]

void WordProcessor::SetSpaceAfter (size_t from, size_t to, Led_TWIPS sa)

See WordProcessor::ParagraphInfo::GetSpaceAfter

WordProcessor::SetSpaceBefore [public]

void WordProcessor::SetSpaceBefore (size_t from, size_t to, Led_TWIPS sb)

See WordProcessor::ParagraphInfo::GetSpaceBefore

WordProcessor::SetStandardTabStopList [public]

void WordProcessor::SetStandardTabStopList (size_t from, size_t to, StandardTabStopList tabStops)

Set the tabstops to tabStops for all paragraphs between from and to.


Class: WordProcessor::CommandNames [public]

Description:

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.


Class: WordProcessor::HidableTextDatabasePtr [public]

Base Classes: Led_RefCntPtr < T > , (T=HidableTextMarkerOwner)
Description:

A Led_RefCntPtr (smart pointer) to a HidableTextMarkerOwner.


Class: WordProcessor::IncrementalParagraphInfo [public]

Base Classes: WordProcessor::ParagraphInfo
Description:

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.


Class: WordProcessor::NoParagraphDatabaseAvailable [public]

Base Classes: TextImager::NotFullyInitialized
Description:

Thrown by WordProcessor::GetLayoutMargins etc when no WordProcessor::ParagraphDatabasePtr available.


Class: WordProcessor::ParagraphDatabasePtr [public]

Base Classes: Led_RefCntPtr < T > , (T=WordProcessor::ParagraphDatabaseRep)
Description:

A Led_RefCntPtr (smart pointer) to a WordProcessor::ParagraphDatabaseRep.


Class: WordProcessor::ParagraphDatabaseRep [public]

Base Classes: MarkerCover < MARKER,MARKERINFO,INCREMENTALMARKERINFO > , (MARKER=WordProcessor::ParagraphInfoMarker,MARKERINFO=WordProcessor::ParagraphInfo,INCREMENTALMARKERINFO=WordProcessor::IncrementalParagraphInfo)
Description:

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

WordProcessor::ParagraphDatabaseRep::CheckMarkerBounaryConstraints [private]

void ParagraphDatabaseRep::CheckMarkerBounaryConstraints (size_t from, size_t to) throw ()

Called internally to check that all the paragraph info records in the MarkerCover respect the contraint that they start and end on paragraph boundaries.

WordProcessor::ParagraphDatabaseRep::GetStaticDefaultParagraphInfo [public]

ParagraphInfo ParagraphDatabaseRep::GetStaticDefaultParagraphInfo ()

Return the default WordProcessor::ParagraphInfo object used when the paragraph database object is created.

WordProcessor::ParagraphDatabaseRep::NoteCoverRangeDirtied [protected]

void ParagraphDatabaseRep::NoteCoverRangeDirtied (size_t from, size_t to, const MarkerVector& rangeAndSurroundingsMarkers)

Override MarkerCover::NoteCoverRangeDirtied to assure we check boundary contraints (assure paragraph cover markers end on paragraph boundaries, as defined by our partition).

WordProcessor::ParagraphDatabaseRep::SetInfo [public]

void ParagraphDatabaseRep::SetInfo (size_t charAfterPos, size_t nTCharsFollowing, const IncrementalParagraphInfo& infoForMarkers)

Override MarkerCover::SetInfos to assure we have a partition associated with us before allowing changes. This partition can be changed later.


Class: WordProcessor::ParagraphInfo [public]

Description:

An object which captures the per-paragraph information we store especially in the WordProcessor class. The attributes stored include:

Member Details

WordProcessor::ParagraphInfo::GetJustification [public]

Led_Justification WordProcessor::ParagraphInfo::GetJustification () const

Return the Led_Justification setting.

WordProcessor::ParagraphInfo::GetLineSpacing [public]

Led_LineSpacing WordProcessor::ParagraphInfo::GetLineSpacing () const

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

See also WordProcessor::ParagraphInfo::SetLineSpacing.

WordProcessor::ParagraphInfo::GetListIndentLevel [public]

unsigned char WordProcessor::ParagraphInfo::GetListIndentLevel () const

Retrieve the indent level for the given list. Only valid value if WordProcessor::ParagraphInfo::GetListStyle is not eListStyle_None.

WordProcessor::ParagraphInfo::GetListStyle [public]

ListStyle WordProcessor::ParagraphInfo::GetListStyle () const

Retrieve the WordProcessor::ParagraphInfo::ListStyle property associated with this paragraph (e.g. eListStyle_Bullet or eListStyle_None).

WordProcessor::ParagraphInfo::GetSpaceAfter [public]

Led_TWIPS WordProcessor::ParagraphInfo::GetSpaceAfter () const

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.

See also WordProcessor::ParagraphInfo::SetSpaceAfter.

WordProcessor::ParagraphInfo::GetSpaceBefore [public]

Led_TWIPS WordProcessor::ParagraphInfo::GetSpaceBefore () const

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.

See also WordProcessor::ParagraphInfo::SetSpaceBefore.

WordProcessor::ParagraphInfo::SetJustification [public]

void WordProcessor::ParagraphInfo::SetJustification (Led_Justification justification)

Set the Led_Justification setting.

WordProcessor::ParagraphInfo::SetLineSpacing [public]

void WordProcessor::ParagraphInfo::SetLineSpacing (Led_LineSpacing sl)

See also WordProcessor::ParagraphInfo::GetLineSpacing.

WordProcessor::ParagraphInfo::SetListIndentLevel [public]

void WordProcessor::ParagraphInfo::SetListIndentLevel (unsigned char indentLevel)

See also WordProcessor::ParagraphInfo::GetListIndentLevel.

WordProcessor::ParagraphInfo::SetListStyle [public]

void WordProcessor::ParagraphInfo::SetListStyle (ListStyle listStyle)

See also WordProcessor::ParagraphInfo::GetListStyle.

WordProcessor::ParagraphInfo::SetSpaceAfter [public]

void WordProcessor::ParagraphInfo::SetSpaceAfter (Led_TWIPS sa)

See also WordProcessor::ParagraphInfo::GetSpaceAfter.

WordProcessor::ParagraphInfo::SetSpaceBefore [public]

void WordProcessor::ParagraphInfo::SetSpaceBefore (Led_TWIPS sb)

See also WordProcessor::ParagraphInfo::GetSpaceBefore.


Class: WordProcessor::ParagraphInfoMarker [public]

Base Classes: Marker
Description:

Class: WordProcessor::WordProcessorFlavorPackageExternalizer [public]

Base Classes: virtual StandardStyledTextInteractor::StyledTextFlavorPackageExternalizer
Description:

Add paragraph etc support support by creating a WordProcessor::WordProcessorTextIOSrcStream.


Class: WordProcessor::WordProcessorFlavorPackageInternalizer [public]

Base Classes: virtual StandardStyledTextInteractor::StyledTextFlavorPackageInternalizer
Description:

Add paragraph etc support support by creating a WordProcessor::WordProcessorTextIOSinkStream.


Class: WordProcessor::WordProcessorTextIOSinkStream [public]

Base Classes: StandardStyledTextInteractor::StandardStyledTextIOSinkStream
Description:

A StandardStyledTextInteractor::StandardStyledTextIOSinkStream, for use with the StyledTextIO module, which adds support for a WordProcessor::ParagraphDatabasePtr.


Class: WordProcessor::WordProcessorTextIOSrcStream [public]

Base Classes: StandardStyledTextInteractor::StandardStyledTextIOSrcStream
Description:

A StandardStyledTextInteractor::StandardStyledTextIOSrcStream, for use with the StyledTextIO module, which adds support for a WordProcessor::ParagraphDatabasePtr.

Member Details

WordProcessor::WordProcessorTextIOSrcStream::GetLineSpacing [public]

Led_LineSpacing WordProcessorTextIOSrcStream::GetLineSpacing () const

WordProcessor::WordProcessorTextIOSrcStream::GetListStyleInfo [public]

void WordProcessor::WordProcessorTextIOSrcStream::GetListStyleInfo (ListStyle* listStyle, unsigned char* indentLevel) const

WordProcessor::WordProcessorTextIOSrcStream::GetSpaceAfter [public]

Led_TWIPS WordProcessorTextIOSrcStream::GetSpaceAfter () const

WordProcessor::WordProcessorTextIOSrcStream::GetSpaceBefore [public]

Led_TWIPS WordProcessorTextIOSrcStream::GetSpaceBefore () const


Class: WordProcessorCommonCommandHelper < BASECLASS,CMD_INFO,CMD_ENABLER > [public]

Base Classes: TextInteractorCommonCommandHelper < BASECLASS,CMD_INFO,CMD_ENABLER >
Description:

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.


Class: WordProcessorCommonCommandHelper_DefaultCmdInfo [public]

Base Classes: TextInteractorCommandHelper_DefaultCmdInfo
Description:

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.


Class: WordProcessorHScrollbarHelper < BASECLASS > [public]

Base Classes: BASECLASS
Description:

Utility template to implement some sharable code to compute h scrollpos.

Member Details

WordProcessorHScrollbarHelper < BASECLASS > ::CalculateFarthestRightMarginInWindow () [public]

Led_Distance WordProcessorHScrollbarHelper < BASECLASS > ::CalculateFarthestRightMarginInWindow () const

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.

WordProcessorHScrollbarHelper < BASECLASS > ::ComputeMaxHScrollPos () [public]

Led_Distance WordProcessorHScrollbarHelper < BASECLASS > ::ComputeMaxHScrollPos () const

Override TextImager::ComputeMaxHScrollPos to call WordProcessorHScrollbarHelper::CalculateFarthestRightMarginInWindow () and cache the results (for performance reasons).


Return to Led Page Return to Led ClassLib Documentation Index Return to Led Reference Manual Index
Last Updated 2001-10-20