20#ifndef SW_TOXTEXTGENERATOR_HXX_
21#define SW_TOXTEXTGENERATOR_HXX_
23#include <rtl/ustring.hxx>
30#include <unordered_map>
46class ToxTextGeneratorTest;
50class ToxLinkProcessor;
51class ToxTabStopTokenHandler;
52class ToxWhitespaceStripper;
72 std::unordered_map<OUString, int> & rMarkURLs,
73 const std::vector<std::unique_ptr<SwTOXSortTabBase>>& entries,
74 sal_uInt16 indexOfEntryToProcess, sal_uInt16 numberOfEntriesToProcess,
133 static std::shared_ptr<SfxItemSet>
168 friend class ::ToxTextGeneratorTest;
SwContentFrame is the layout for content nodes: a common base class for text (paragraph) and non-text...
The root element of a Writer document layout.
A wrapper around SfxPoolItem to store the start position of (usually) a text portion,...
SwTextNode is a paragraph in the document model.
This class generates text for the entries of a table of x.
void GenerateText(SwDoc *doc, std::unordered_map< OUString, int > &rMarkURLs, const std::vector< std::unique_ptr< SwTOXSortTabBase > > &entries, sal_uInt16 indexOfEntryToProcess, sal_uInt16 numberOfEntriesToProcess, SwRootFrame const *pLayout)
Generate the text for an entry of a table of X (X is, e.g., content).
std::shared_ptr< ToxTabStopTokenHandler > mTabStopTokenHandler
static void ApplyHandledTextToken(const HandledTextToken &htt, SwTextNode &targetNode)
Applies the result of a handled text token to a target node.
static HandledTextToken HandleTextToken(const SwTOXSortTabBase &source, SwAttrPool &attrPool, SwRootFrame const *const pLayout)
Append text (and selected attributes) to a target node.
ToxTextGenerator(const SwForm &toxForm, std::shared_ptr< ToxTabStopTokenHandler > tabStopHandler)
std::shared_ptr< ToxLinkProcessor > mLinkProcessor
static OUString ConstructPageNumberPlaceholder(size_t numberOfToxSources)
Handle a page number token.
virtual ~ToxTextGenerator()
OUString HandleChapterToken(const SwTOXSortTabBase &rBase, const SwFormToken &aToken, SwRootFrame const *pLayout) const
Handle a chapter token.
virtual SwChapterField ObtainChapterField(SwChapterFieldType *chapterFieldType, const SwFormToken *chapterToken, const SwContentFrame *contentFrame, const SwContentNode *contentNode) const
Obtain a ChapterField to use for the text generation.
static OUString GetNumStringOfFirstNode(const SwTOXSortTabBase &rBase, bool bUsePrefix, sal_uInt8 nLevel, SwRootFrame const *pLayout, bool bAddSpace=true)
This method will call GetNumStringOfFirstNode() of the first node in the provided SwTOXSortTabBase.
OUString GenerateTextForChapterToken(const SwFormToken &chapterToken, const SwContentFrame *contentFrame, const SwContentNode *contentNode, SwRootFrame const *pLayout) const
Generate the text for a chapter token.
static void GetAttributesForNode(HandledTextToken &rResult, sal_Int32 &rOffset, SwTextNode const &rNode, ToxWhitespaceStripper const &rStripper, SwAttrPool &rPool, SwRootFrame const *const pLayout)
static std::shared_ptr< SfxItemSet > CollectAttributesForTox(const SwTextAttr &hint, SwAttrPool &pool)
Collect the attributes of a hint that shall be copied over to the TOX.
This class helps to remove unwanted whitespaces from a string to use in a Tox.
Dialog to specify the properties of date form field.
Class for sorting directories.
std::vector< sal_Int32 > startPositions
std::vector< std::unique_ptr< SwFormatAutoFormat > > autoFormats
std::vector< sal_Int32 > endPositions