class SfxItemSet; class SwAttrPool; class SwChapterField; class SwChapterFieldType; class SwContentFrame; class SwRootFrame; class SwContentNode; class SwDoc; class SwForm; struct SwFormToken; class SwTextAttr; class SwTextNode; struct SwTOXSortTabBase; class ToxTextGeneratorTest;
namespace sw {
class ToxLinkProcessor; class ToxTabStopTokenHandler; class ToxWhitespaceStripper;
/** This class generates text for the entries of a table of x. * *Youcancontrolitsbehaviorbycalling@linkSetTabstopPolicy()andspecifyingthedesiredbehavior.
*/ class ToxTextGenerator
{ public:
ToxTextGenerator(const SwForm& toxForm, std::shared_ptr<ToxTabStopTokenHandler> tabStopHandler);
virtual ~ToxTextGenerator();
/** Generate the text for an entry of a table of X (X is, e.g., content). * *Thismethodwillprocesstheentriesin@pentries,startingat@pindexOfEntryToProcessand *process@pnumberOfEntriesToProcessentries.
*/
std::optional<std::pair<SwTextNode *, SvxTabStopItem>>
GenerateText(SwDoc& rDoc,
std::unordered_map<OUString, int> & rMarkURLs, const std::vector<std::unique_ptr<SwTOXSortTabBase>>& entries,
sal_uInt16 indexOfEntryToProcess, sal_uInt16 numberOfEntriesToProcess,
SwRootFrame const* pLayout);
/** Append text (and selected attributes) to a target node. * *Willtakethetextof@psource,andreturnthetextandtheattributeswhichshouldbeaddedtothe *targettextnode.@seeCollectAttributesForTox()forthecriteriaoftheattributeswhicharetaken.
*/ static HandledTextToken
HandleTextToken(const SwTOXSortTabBase& source, SwAttrPool& attrPool,
SwRootFrame const*const pLayout);
/** Applies the result of a handled text token to a target node. */ staticvoid
ApplyHandledTextToken(const HandledTextToken& htt, SwTextNode& targetNode);
/** Handle a page number token. * *Willreturnastringof@pnumberOfToxSourcesconcatenated'@'signs,separatedbycommas,and *finishedbya'~'. *(The'@'signisthemagiccharacterC_NUM_REPL,the'~'signisthemagiccharacterC_END_PAGE_NUM. * *@internal *Thecountofsimilarentries,i.e.,nodesinaTOXSourcesofSwTOXSortTabBasegivesthePagerNumber *pattern.
*/ static OUString
ConstructPageNumberPlaceholder(size_t numberOfToxSources);
/** Collect the attributes of a hint that shall be copied over to the TOX. * *SometextattributesareusedintheTOXentries.Thismethoddefineswhichattributesareused. * *@paramhintThehintfromwhichtheattributesaretaken *@parampoolTheattributepoolforthenewitems
*/ static std::shared_ptr<SfxItemSet>
CollectAttributesForTox(const SwTextAttr& hint, SwAttrPool& pool);
/** This method will call GetNumStringOfFirstNode() of the first node in the provided SwTOXSortTabBase. * *Theparameters@pbUsePrefixand@pnLevelarepassedtoSwTextNode::GetNumString() * *@internal *Themethodisonlycalledifseveralpreconditionsfor@prBasearetrue.Checktheimplementation *fordetails.
*/ static OUString
GetNumStringOfFirstNode(const SwTOXSortTabBase& rBase, bool bUsePrefix,
sal_uInt8 nLevel, SwRootFrame const* pLayout, bool bAddSpace = true);
/** Generate the text for a chapter token.
*/
OUString
GenerateTextForChapterToken(const SwFormToken& chapterToken, const SwContentFrame* contentFrame, const SwContentNode *contentNode, SwRootFrame const* pLayout) const;
/** Obtain a ChapterField to use for the text generation. *@internal *Thismethodisoverriddenintheunittests.Donotoverrideityourself.
*/ virtual SwChapterField
ObtainChapterField(SwChapterFieldType* chapterFieldType, const SwFormToken* chapterToken, const SwContentFrame* contentFrame, const SwContentNode *contentNode) const;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.