20 #ifndef SW_TOXTEXTGENERATOR_HXX_
21 #define SW_TOXTEXTGENERATOR_HXX_
23 #include <rtl/ustring.hxx>
30 #include <unordered_map>
46 class ToxTextGeneratorTest;
50 class ToxLinkProcessor;
51 class ToxTabStopTokenHandler;
52 class 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;
std::shared_ptr< ToxLinkProcessor > mLinkProcessor
OUString HandleChapterToken(const SwTOXSortTabBase &rBase, const SwFormToken &aToken, SwRootFrame const *pLayout) const
Handle a chapter token.
std::vector< std::unique_ptr< SwFormatAutoFormat > > autoFormats
This class generates text for the entries of a table of x.
std::shared_ptr< ToxTabStopTokenHandler > mTabStopTokenHandler
This class helps to remove unwanted whitespaces from a string to use in a Tox.
Dialog to specify the properties of date form field.
The root element of a Writer document layout.
static OUString GetNumStringOfFirstNode(const SwTOXSortTabBase &rBase, bool bUsePrefix, sal_uInt8 nLevel, SwRootFrame const *pLayout)
This method will call GetNumStringOfFirstNode() of the first node in the provided SwTOXSortTabBase...
std::vector< sal_Int32 > startPositions
A wrapper around SfxPoolItem to store the start position of (usually) a text portion, with an optional end.
ToxTextGenerator(const SwForm &toxForm, std::shared_ptr< ToxTabStopTokenHandler > const &tabStopHandler)
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 ConstructPageNumberPlaceholder(size_t numberOfToxSources)
Handle a page number token.
std::vector< sal_Int32 > endPositions
OUString GenerateTextForChapterToken(const SwFormToken &chapterToken, const SwContentFrame *contentFrame, const SwContentNode *contentNode, SwRootFrame const *pLayout) const
Generate the text for a chapter token.
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).
SwTextNode is a paragraph in the document model.
virtual ~ToxTextGenerator()
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.
static void ApplyHandledTextToken(const HandledTextToken &htt, SwTextNode &targetNode)
Applies the result of a handled text token to a target node.
static void GetAttributesForNode(HandledTextToken &rResult, sal_Int32 &rOffset, SwTextNode const &rNode, ToxWhitespaceStripper const &rStripper, SwAttrPool &rPool, SwRootFrame const *const pLayout)
static HandledTextToken HandleTextToken(const SwTOXSortTabBase &source, SwAttrPool &attrPool, SwRootFrame const *const pLayout)
Append text (and selected attributes) to a target node.
Class for sorting directories.