LibreOffice Module sw (master) 1
Classes | Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
sw::ToxLinkProcessor Class Reference

A helper class for ToxTextGenerator. More...

#include <ToxLinkProcessor.hxx>

Classes

struct  ClosedLink
 A link that has been encountered while parsing a tox. More...
 
struct  StartedLink
 Information about a started link. More...
 

Public Member Functions

 ToxLinkProcessor ()
 
virtual ~ToxLinkProcessor ()
 
void StartNewLink (sal_Int32 startPosition, const OUString &characterStyle)
 
void CloseLink (sal_Int32 endPosition, const OUString &url, bool bRelative)
 Close a link which has been found during processing. More...
 
void InsertLinkAttributes (SwTextNode &node)
 Insert the found links as attributes to a text node. More...
 

Private Member Functions

virtual sal_uInt16 ObtainPoolId (const OUString &characterStyle) const
 Obtain the pool id which belongs to a character style. More...
 

Private Attributes

std::vector< std::unique_ptr< ClosedLink > > m_ClosedLinks
 
std::optional< StartedLinkm_oStartedLink
 

Friends

class ::ToxLinkProcessorTest
 

Detailed Description

A helper class for ToxTextGenerator.

It collects information about encountered link tokens and allows access in a processed form.

Definition at line 30 of file ToxLinkProcessor.hxx.

Constructor & Destructor Documentation

◆ ToxLinkProcessor()

sw::ToxLinkProcessor::ToxLinkProcessor ( )
inline

Definition at line 32 of file ToxLinkProcessor.hxx.

◆ ~ToxLinkProcessor()

virtual sw::ToxLinkProcessor::~ToxLinkProcessor ( )
inlinevirtual

Definition at line 33 of file ToxLinkProcessor.hxx.

Member Function Documentation

◆ CloseLink()

void sw::ToxLinkProcessor::CloseLink ( sal_Int32  endPosition,
const OUString &  url,
bool  bRelative 
)

Close a link which has been found during processing.

Definition at line 27 of file ToxLinkProcessor.cxx.

References m_ClosedLinks, m_oStartedLink, ObtainPoolId(), and SAL_INFO.

◆ InsertLinkAttributes()

void sw::ToxLinkProcessor::InsertLinkAttributes ( SwTextNode node)

Insert the found links as attributes to a text node.

Definition at line 79 of file ToxLinkProcessor.cxx.

References SwTextNode::InsertItem(), and m_ClosedLinks.

◆ ObtainPoolId()

sal_uInt16 sw::ToxLinkProcessor::ObtainPoolId ( const OUString &  characterStyle) const
privatevirtual

Obtain the pool id which belongs to a character style.

Definition at line 67 of file ToxLinkProcessor.cxx.

References ChrFmt, and SwStyleNameMapper::GetPoolIdFromUIName().

Referenced by CloseLink().

◆ StartNewLink()

void sw::ToxLinkProcessor::StartNewLink ( sal_Int32  startPosition,
const OUString &  characterStyle 
)

Definition at line 21 of file ToxLinkProcessor.cxx.

References m_oStartedLink, and SAL_INFO_IF.

Friends And Related Function Documentation

◆ ::ToxLinkProcessorTest

friend class ::ToxLinkProcessorTest
friend

Definition at line 89 of file ToxLinkProcessor.hxx.

Member Data Documentation

◆ m_ClosedLinks

std::vector<std::unique_ptr<ClosedLink> > sw::ToxLinkProcessor::m_ClosedLinks
private

Definition at line 85 of file ToxLinkProcessor.hxx.

Referenced by CloseLink(), and InsertLinkAttributes().

◆ m_oStartedLink

std::optional<StartedLink> sw::ToxLinkProcessor::m_oStartedLink
private

Definition at line 87 of file ToxLinkProcessor.hxx.

Referenced by CloseLink(), and StartNewLink().


The documentation for this class was generated from the following files: