Class TWPRTFDataCollectionBase

Hierarchy

System.TObject | System.Classes.TPersistent | System.Classes.TCollection | TWPRTFDataCollectionBase

Subclasses

WPRTEEdit.TWPRTFDataCollection

Description

This is the 'RTFData' object which holds the text

Properties

Property LastLoadPath : string

Property LastSectionID : Integer

Property LatelyDeletedObjects : TList

Property MaxParLength : Integer

Property Modified : Boolean

Property NewSectionIDInReformat : Integer

Property PageStartNumber : Integer

Property PrintParameter : TWPPrintParameter

Property RTFProps : TWPRTFProps

Property RTFVariables : TWPRTFExtraDataCollection

Property RTFViewOptions : TWPRTFViewOptions

Property SectionProperty[index] : TWPRTFSectionProps

Property SectionPropertyCount : Integer

Property SpecialTextAttr[index] : TCharacterAttr

Property Table[index] : TParagraph

Property TableCount : Integer

Property TextBoxPadding : Integer

Property TextObjects : TWPObjectEnv

Property WriteObjectMode : TWPObjectWriteRTFModeGlobal

Methods

Procedure _SetOwner(NewOwner:TPersistent)

Function AddSectionProps : TWPRTFSectionProps

Procedure AlwaysNewUndolevel

Function Append(Kind:TWPPagePropertyKind; Range:TWPPagePropertyRange; Name:string; SectionID:Integer) : TWPRTFDataBlock

Function AppendAsSection(FromCollection:TWPRTFDataCollectionBase; Options:TWPAppendAsSectionOptions) : TWPRTFSectionProps

Function AppendRTFData(Source:TWPRTFDataBlock; Dest:TWPRTFDataBlock) : TParagraph

Function AsANSIString(FormatName:string) : string

Procedure Assign(Source:TPersistent)

Procedure BeginUpdateData

Procedure BroadcastToEngines(Code:Integer; param:TObject; ExceptFor:TWPRTFEngineBasis)

Function CanRedo : Boolean

Function CanUndo : Boolean

Procedure Clear(styles:Boolean; PageInfo:Boolean; NewRTFProps:TWPRTFProps)

Procedure ClearAllWPObjects

Procedure ClearSectionProps

Function CodeLocate(ResultPar:TParagraph; ResultPosInPar:Integer; aName:string; Code:TWPTextObjType; CmpModes:TWPTextObjModes; LocateOptions:TWPCodeLocateOptions; CmpStr2:string) : Boolean

Function CodeLocatePair(FormatName:string; spar:TParagraph; epar:TParagraph; spos:Integer; epos:Integer; global:Boolean) : Integer

Function CodeSelect(aName:string; Code:TWPTextObjType; OnlyText:Boolean; StopAtParEnd:Boolean; LocateOptions:TWPCodeLocateOptions) : Boolean

Create(ItemClass:TCollectionItemClass)

Procedure DeleteRTFData(RTFData:TWPRTFDataBlock)

Procedure DeleteSectionProps(id:Integer)

Procedure DeleteText(Kind:TWPPagePropertyKind; Range:TWPPagePropertyRange; UsedForSectionID:Integer)

Procedure DeleteTexts(UsedForSectionID:Integer)

Destroy

Procedure DoAfterImageSaving(Writer:TWPCustomTextWriter; TextObject:TWPTextObj)

Procedure DoBeforeFormatTable(RTFData:TWPRTFDataCollectionBase; tablepar:TParagraph; KeepTogether:Boolean)

Procedure DoBeforeFormatTableRow(RTFData:TWPRTFDataCollectionBase; tablerow:TParagraph; KeepRowTogether:Boolean)

Function Empty : Boolean

Function EndUndolevel : Boolean

Procedure EndUpdateData

Procedure EvaluateXMLTag(Reader:TWPCustomTextReader; atag:TWPCustomHTMLTag; Handled:Boolean)

Procedure FinalizeMIME(Writer:TWPCustomTextWriter)

Function Find(Kind:TWPPagePropertyKind; Range:TWPPagePropertyRange; Name:string; UsedForSectionID:Integer) : TWPRTFDataBlock

Function FindAny(Kind:TWPPagePropertyKinds; Range:TWPPagePropertyRanges) : TWPRTFDataBlock

Function FindAnyName(aName:string) : TWPRTFDataBlock

Function FindItemID(id:Integer) : TWPRTFDataBlock

Function FindParByName(Name:string; StartWith:TWPRTFDataBlock; use_wpat_parname:Boolean; AndTypeIn:TWPParagraphTypes; need_props:TParProp) : TParagraph

Function FindParWithText(findtext:string; StartWith:TWPRTFDataBlock) : TParagraph

Function FindSpecialText(CurrentFormatPar:TParagraph; CurrentFormatPosInPar:Integer; pagenr:Integer; Kind:TWPPagePropertyKind; LastPage:Boolean; HideTextOnLastPage:Boolean; UsedForSectionID:Integer) : TWPRTFDataBlock

Function FindSpecialTextRange(Range:TWPPagePropertyRange; Kind:TWPPagePropertyKind; Name:string; UsedForSectionID:Integer) : TWPRTFDataBlock

Function FindTableByName(Name:string; StartWith:TWPRTFDataBlock) : TParagraph

Function FirstBodyPar : TParagraph

Function FirstPar : TParagraph

Function Get(Kind:TWPPagePropertyKind; Range:TWPPagePropertyRange; Name:string) : TWPRTFDataBlock

Function GetAClassName(AClassNr:Integer) : string

Function GetAClassNr(AClassName:string) : Integer

Function GetCurrPageProps : TWPRTFSectionProps

Function GetLeftParValue(N:Integer) : Double

Function GetLogicalPageProps : TWPRTFSectionProps

Function GetNamedCalcParValue(vname:string; Count:Integer) : Double

Function GetNamedCalcParValueOnPage(vname:string; Count:Integer; OnThisPageNr:Integer) : Double

Function GetNamedParValue(vname:string; Count:Integer) : Double

Function GetPageProps(Par:TParagraph) : TWPRTFSectionProps

Function GetParValue(Par:TParagraph; Ok:Boolean) : Double

Function GetPreviousRowValue(N:Integer) : Double

Function GetReaderClass(Source:TStream; aTextLoadFormat:string; FFileExtension:string) : TWPToolsReaderWriterClass

Function GetSectionProps(id:Integer) : TWPRTFSectionProps

Function GetWriterClass(aTextSaveFormat:string; FFileExtension:string) : TWPToolsReaderWriterClass

Function HasLandscapeSections : Boolean

Function HasSpecialTextForLastPage : Boolean

Function HTTPPrepareURL(url:string; LoadPath:string) : string

Function InsertRTFData(Source:TWPRTFDataBlock; Dest:TWPRTFDataBlock; DestPar:TParagraph; DestPosInPar:Integer; LastPosInPar:Integer; SplitDestPar:Boolean; UseFirstLoadedParProps:Boolean) : TParagraph

Procedure InternalEnterBand(Par:TParagraph)

Procedure InternalLeaveBand(Par:TParagraph)

Procedure ListAttachedImages(Writer:TWPCustomTextWriter; obj:TWPTextObj; FileName:string)

Procedure ListNamesAndCommands(Mode:TWPGetCellCommandNamesMode; list:TStrings)

Function LoadFromFile(FileName:string; FormatName:string; InsertText:Boolean) : Boolean

Function LoadFromStream(Source:TStream; InsertText:Boolean; FormatName:string; SplitPar:Boolean; Reader:TWPCustomTextReader; FilenameAndPath:string; FFileExtension:string; FTextLoadFormat:string; FLoadOptions:TLoadOptions; FLoadHTMLOptions:TLoadHTMLOptions; FCustomLoadOptions:Integer; FDisplayedText:TWPRTFDataBlock; AfterLoadEvent:TWPIOAfterLoadWithReader; ParamObj:TObject) : Boolean

Function LoadFromStreamWithReader(Stream:TStream; Reader:TWPCustomTextReader; OnlyBody:Boolean; AfterLoadEvent:TWPIOAfterLoadWithReader) : TWPRTFDataBlock

Function LoadFromStringWithReader(Ansi:AnsiString; Reader:TWPCustomTextReader; OnlyBody:Boolean; AfterLoadEvent:TWPIOAfterLoadWithReader) : TWPRTFDataBlock

Function LoadRTFDataBlock(Source:TStream; FormatName:string; FilenameAndPath:string; FirstCharAttr:Cardinal) : TWPRTFDataBlock

Function LocateWPObject(obj:TWPObject; FileName:string) : Boolean

Function LoopAllInplaceEditor(param:TObject; ParInplace:Boolean; ObjInplace:Boolean; CallBack:TWPOnLoopInplaceEditorCallback; OnlyFromDataBlock:TWPRTFDataBlock; OnlyFromParagraph:TParagraph; Modes:TWPLoopAllInplaceEditorModes; GroupFilter:Integer) : Integer

Function LoopAllObj(param:TObject; CallBack:TWPGlobalOnLoopAllObjCallback; OnlyFromDataBlock:TWPRTFDataBlock) : Integer

Function LoopAllPar(param:TObject; CallBack:TWPOnLoopAllParCallback; OnlyFromDataBlock:TWPRTFDataBlock) : Integer

Procedure MakeRTFProps

Function MayDeletePar(Par:TParagraph; ParType:TWPParagraphType) : Boolean

Procedure NeedReformat(Value:Boolean)

Procedure NewUndolevel

Procedure PaintBand(Memo:TWPRTFEngineBasis; toCanvas:TCanvas; Par:TParagraph; r:TRect; PaintBandMode:TWPPaintBandMode; PaintModes:TWPPaintModes)

Function PaintBandHandled : Boolean

Procedure PrepareImageforSaving(Writer:TWPCustomTextWriter; TextObject:TWPTextObj; DontSave:Boolean; embed_image_name:string)

Function RecalcText(pars:Boolean; fields:Boolean) : Boolean

Function Redo : Boolean

Procedure ReformatAll(InititializeAll:Boolean)

Function RequestHTTPImage(Reader:TWPCustomTextReader; LoadPath:string; url:string; TextObject:TWPTextObj) : Boolean

Function RequestHTTPString(Reader:TWPCustomTextReader; LoadPath:string; url:string) : AnsiString

Function RequestStyle(StyleName:string; NumberLevel:Integer) : TWPTextStyle

Function RTFEngine : TWPRTFEngineBasis

Function SaveSectionToStream(spar:TParagraph; epar:TParagraph; spos:Integer; epos:Integer; Destination:TStream; FormatName:string; FFileExtension:string) : Boolean

Function SaveSelectionToStream(FDisplayedText:TWPRTFDataBlock; Destination:TStream; FormatName:string; FFileExtension:string; FStoreOptions:TStoreOptions; FHTMLStoreOptions:THTMLStoreOptions) : Boolean

Function SaveToStream(Stream:TStream; FormatName:string) : Boolean

Function SaveToStreamWithWriter(Stream:TStream; Writer:TWPCustomTextWriter; OnlySelection:Boolean; DisplayedText:TWPRTFDataBlock) : Boolean

Procedure SelectBody

Function SetANSIString(Source:string; FormatName:string) : Boolean

Procedure SetOwnedFormatter(formatter:TWPAbstractRTFDataBlockFormatter)

Procedure SetRTFEngine(Engine:TWPRTFEngineBasis; Attach:Boolean)

Procedure StartUndolevel

Procedure StatusMsg(Code:Integer; Msg:string)

Procedure TransactionCommit(DeleteOldHeaderFooter:Boolean; DeleteNewHeaderFooter:Boolean)

Procedure TransactionRollback

Procedure TransactionStart

Function Undo : Boolean

Procedure UndoBufferSaveCurrentTable(Kind:TWPUndoKind)

Procedure UndoBufferSaveTo(aStyle:TWPTextStyle; Typ:TWPUndoType; Kind:TWPUndoKind; posinpar:Integer; SaveInRedoBuffer:Boolean)

Procedure UndoChange

Procedure UndoClear

Procedure UndoDisable

Procedure UndoEnable

Function UndoKind : TWPUndoKind

Procedure UndoLock(Mode:Boolean)

Function UndoStack : TWPUndoStack

Procedure UndoStoreComplete(AsStream:Boolean)

Procedure UndoStreamEnd

Procedure UndoStreamStart(Kind:TWPUndoKind)

Function UniqueName(Kind:TWPPagePropertyKind; PreStr:string) : string

Procedure UpdateObjWidths(obj:TWPObject; Mode:TWPTextObjModes)

Procedure UpdateReformatMode

Function Verify(RTFDataBlock:TWPRTFDataBlock) : Boolean

Function VerifyPar(Par:TParagraph) : Boolean

Function VerifyWPObject(obj:TWPObject) : Boolean

Events

AfterApplyUndoObject : TWPRTFDataCollectionAfterApplyUndoObject= TWPRTFDataCollectionAfterApplyUndoObject

AfterChangeTextBoxPar : TWPChangeTextBoxPar= TWPChangeTextBoxPar

AfterImageSaving : TWPAfterImageSaving= TWPAfterImageSaving

AfterLoadFromStream : TWPIOAfterLoadWithReader= TWPIOAfterLoadWithReader

This event is executed after text was loaded but before it is inserted into the text. It will not be triggered when text is loaded by 'PasteFromClipboard' and if the procedure has been called with a specific 'AfterLoad' event reference. For an example to format pasted text please see

AfterSaveTextObject : TWPWriterSaveTextObjectEvent= TWPWriterSaveTextObjectEvent

The events BeforeSaveTextObject and AfterSaveTextObject are called by the WPT format writer whenever any kind of text object, i.e. a merge field is saved. You can use this event to intercept the saving and modify the data on the fly

BeforeFormatTable : TWBeforeFormatTableEvent= TWBeforeFormatTableEvent

This event allows it to set KeepTogether for some of the tables only to make sure they are not distributed on different pages.

BeforeFormatTableRow : TWBeforeFormatTableRowEvent= TWBeforeFormatTableRowEvent

This event can be used to set the KeepRowTogether boolean on a per-row basis

BeforeLoadFromStream : TWPIOLoadWithReader= TWPIOLoadWithReader

This event is triggered before text is loaded. It makes it possible to set certain options for the reader

BeforeSaveTextObject : TWPWriterSaveTextObjectEvent= TWPWriterSaveTextObjectEvent

The events BeforeSaveTextObject and AfterSaveTextObject are called by the WPT format writer whenever any kind of text object, i.e. a merge field is saved. You can use this event to intercept the saving and modify the data on the fly

BeforeSaveToStream : TWPIOSaveWithWriter= TWPIOSaveWithWriter

OnCheckParagraphDeletion : TWPRTFDataCheckDeletionEvent= TWPRTFDataCheckDeletionEvent

This event can be used to prohibit the deletion of certain paragraphs, such as WPReporter bands

OnEvaluateXMLTag : TWPEvaluateXMLTagEvent= TWPEvaluateXMLTagEvent

OnGetSpecialText : TWPOnGetSpecialTextEvent= TWPOnGetSpecialTextEvent

OnGridUpdateGetDataAdapter : TWPGridUpdateGetDataAdapter= TWPGridUpdateGetDataAdapter

GridUpdate is a TParagraph procedure. This event allows it to attach a data set

OnGridUpdateProcessRow : TWPGridUpdateProcessRow= TWPGridUpdateProcessRow

OnHyphenate : TWPHyphenateEvent= TWPHyphenateEvent

OnMapParagraphToParClass : TWPMapParagraphToParClassEvent= TWPMapParagraphToParClassEvent

This event makes it possible that the HTML writer writes styles as classes, i.e. H1

OnPaintBand : TWPPaintBandEvent= TWPPaintBandEvent

You can use this event to provide your own code to paint a band. The default implementation can be found in unit WPRTReport.PAS. This requires WPReporter.

OnPrepareImageforSaving : TWPPrepareImageforSavingEvent= TWPPrepareImageforSavingEvent

OnReaderCreateStream : TMemoryStream= TMemoryStream

OnRecalcText : TWPRecalcTextEvent= TWPRecalcTextEvent

This event makes it possible to inject custom code which recalculates all fields and paragraphs in the text. Unless you set both the varaiables pars and fields to FALSE the default code will also be processed. The event handler must be assiged in code to WPRichText.RTFData.OnReacalcText
TWPRecalcTextEvent = procedure( Sender : TWPRTFDataCollectionBase; var pars, fields : Boolean ) of Object;

OnRequestHTTPImage : TWPRequestHTTPImageEvent= TWPRequestHTTPImageEvent

OnRequestHTTPString : TWPRequestHTTPStringEvent= TWPRequestHTTPStringEvent

OnRequestStyle : TWPOnRequestStyleEvent= TWPOnRequestStyleEvent

OnStatus : TWPRTFDataCollectionStatus= TWPRTFDataCollectionStatus

OnUndoChange : TWPUndoKindChange= TWPUndoKindChange

This event is triggered when the the undo/redo buffers were changed

Used or referenced by

-Function WPReplaceTokens(RTFData:TWPRTFDataCollectionBase; opening:string; closing:string; FieldPreText:string) : Integer