LibreOffice Module editeng (master) 1
Public Member Functions | List of all members
SvxTextForwarder Class Referenceabstract

Contains an EditEngine or an Outliner and unifies access to them. More...

#include <unoedsrc.hxx>

Inheritance diagram for SvxTextForwarder:
[legend]

Public Member Functions

virtual ~SvxTextForwarder () COVERITY_NOEXCEPT_FALSE
 
virtual sal_Int32 GetParagraphCount () const =0
 
virtual sal_Int32 GetTextLen (sal_Int32 nParagraph) const =0
 
virtual OUString GetText (const ESelection &rSel) const =0
 
virtual SfxItemSet GetAttribs (const ESelection &rSel, EditEngineAttribs nOnlyHardAttrib=EditEngineAttribs::All) const =0
 
virtual SfxItemSet GetParaAttribs (sal_Int32 nPara) const =0
 
virtual void SetParaAttribs (sal_Int32 nPara, const SfxItemSet &rSet)=0
 
virtual void RemoveAttribs (const ESelection &rSelection)=0
 
virtual void GetPortions (sal_Int32 nPara, std::vector< sal_Int32 > &rList) const =0
 
virtual OUString GetStyleSheet (sal_Int32 nPara) const =0
 
virtual void SetStyleSheet (sal_Int32 nPara, const OUString &rStyleName)=0
 
virtual SfxItemState GetItemState (const ESelection &rSel, sal_uInt16 nWhich) const =0
 
virtual SfxItemState GetItemState (sal_Int32 nPara, sal_uInt16 nWhich) const =0
 
virtual void QuickInsertText (const OUString &rText, const ESelection &rSel)=0
 
virtual void QuickInsertField (const SvxFieldItem &rFld, const ESelection &rSel)=0
 
virtual void QuickSetAttribs (const SfxItemSet &rSet, const ESelection &rSel)=0
 
virtual void QuickInsertLineBreak (const ESelection &rSel)=0
 
virtual OUString CalcFieldValue (const SvxFieldItem &rField, sal_Int32 nPara, sal_Int32 nPos, std::optional< Color > &rpTxtColor, std::optional< Color > &rpFldColor, std::optional< FontLineStyle > &rpFldLineStyle)=0
 
virtual void FieldClicked (const SvxFieldItem &rField)=0
 
virtual SfxItemPoolGetPool () const =0
 
virtual const SfxItemSetGetEmptyItemSetPtr ()=0
 
virtual void AppendParagraph ()=0
 
virtual sal_Int32 AppendTextPortion (sal_Int32 nPara, const OUString &rText, const SfxItemSet &rSet)=0
 
virtual void CopyText (const SvxTextForwarder &rSource)=0
 
virtual bool IsValid () const =0
 Query state of forwarder. More...
 
virtual LanguageType GetLanguage (sal_Int32 nPara, sal_Int32 nIndex) const =0
 Query language of character at given position on the underlying edit engine. More...
 
virtual sal_Int32 GetFieldCount (sal_Int32 nPara) const =0
 Query number of fields in the underlying edit engine. More...
 
virtual EFieldInfo GetFieldInfo (sal_Int32 nPara, sal_uInt16 nField) const =0
 Query information for given field number in the underlying edit engine. More...
 
virtual EBulletInfo GetBulletInfo (sal_Int32 nPara) const =0
 Query information regarding bullets for given paragraph on the underlying edit engine. More...
 
virtual tools::Rectangle GetCharBounds (sal_Int32 nPara, sal_Int32 nIndex) const =0
 Query the bounding rectangle of the given character. More...
 
virtual tools::Rectangle GetParaBounds (sal_Int32 nPara) const =0
 Query the bounding rectangle of the given paragraph. More...
 
virtual MapMode GetMapMode () const =0
 Query the map mode of the underlying EditEngine/Outliner. More...
 
virtual OutputDeviceGetRefDevice () const =0
 Query the reference output device of the underlying EditEngine/Outliner. More...
 
virtual bool GetIndexAtPoint (const Point &rPoint, sal_Int32 &rPara, sal_Int32 &rIndex) const =0
 Query paragraph and character index of the character at the given point. More...
 
virtual bool GetWordIndices (sal_Int32 nPara, sal_Int32 nIndex, sal_Int32 &rStart, sal_Int32 &rEnd) const =0
 Get the start and the end index of the word at the given index. More...
 
virtual bool GetAttributeRun (sal_Int32 &nStartIndex, sal_Int32 &nEndIndex, sal_Int32 nPara, sal_Int32 nIndex, bool bInCell=false) const =0
 Query range of similar attributes. More...
 
virtual sal_Int32 GetLineCount (sal_Int32 nPara) const =0
 Query number of lines in the formatted paragraph. More...
 
virtual sal_Int32 GetLineLen (sal_Int32 nPara, sal_Int32 nLine) const =0
 Query line length. More...
 
virtual void GetLineBoundaries (sal_Int32 &rStart, sal_Int32 &rEnd, sal_Int32 nParagraph, sal_Int32 nLine) const =0
 Query bounds of line in paragraph. More...
 
virtual sal_Int32 GetLineNumberAtIndex (sal_Int32 nPara, sal_Int32 nIndex) const =0
 Query the line number for an index in the paragraphs text. More...
 
virtual bool Delete (const ESelection &rSelection)=0
 Delete given text range and reformat text. More...
 
virtual bool InsertText (const OUString &rText, const ESelection &rSel)=0
 Insert/Replace given text in given range and reformat text. More...
 
virtual bool QuickFormatDoc (bool bFull=false)=0
 Updates the formatting. More...
 
virtual sal_Int16 GetDepth (sal_Int32 nPara) const =0
 Get the outline depth of given paragraph. More...
 
virtual bool SetDepth (sal_Int32 nPara, sal_Int16 nNewDepth)=0
 Set the outline depth of given paragraph. More...
 
virtual sal_Int32 GetNumberingStartValue (sal_Int32 nPara)
 
virtual void SetNumberingStartValue (sal_Int32 nPara, sal_Int32 nNumberingStartValue)
 
virtual bool IsParaIsNumberingRestart (sal_Int32 nPara)
 
virtual void SetParaIsNumberingRestart (sal_Int32 nPara, bool bParaIsNumberingRestart)
 

Detailed Description

Contains an EditEngine or an Outliner and unifies access to them.

The EditEngine-UNO objects use this class only. To reflect changes not only in the EditEngine, but also in the model data, call SvxEditSource::UpdateData(). This copies back the data to the model's EditTextObject/OutlinerParaObject.

Definition at line 141 of file unoedsrc.hxx.

Constructor & Destructor Documentation

◆ ~SvxTextForwarder()

SvxTextForwarder::~SvxTextForwarder ( )
virtual

Definition at line 44 of file unoedsrc.cxx.

Member Function Documentation

◆ AppendParagraph()

virtual void SvxTextForwarder::AppendParagraph ( )
pure virtual

◆ AppendTextPortion()

virtual sal_Int32 SvxTextForwarder::AppendTextPortion ( sal_Int32  nPara,
const OUString &  rText,
const SfxItemSet rSet 
)
pure virtual

◆ CalcFieldValue()

virtual OUString SvxTextForwarder::CalcFieldValue ( const SvxFieldItem rField,
sal_Int32  nPara,
sal_Int32  nPos,
std::optional< Color > &  rpTxtColor,
std::optional< Color > &  rpFldColor,
std::optional< FontLineStyle > &  rpFldLineStyle 
)
pure virtual

◆ CopyText()

virtual void SvxTextForwarder::CopyText ( const SvxTextForwarder rSource)
pure virtual

◆ Delete()

virtual bool SvxTextForwarder::Delete ( const ESelection rSelection)
pure virtual

Delete given text range and reformat text.

Parameters
rSelectionThe text range to be deleted
Returns
true if text has been successfully deleted

Implemented in SvxAccessibleTextAdapter, SvxEditEngineForwarder, SvxOutlinerForwarder, and SvxDummyTextSource.

Referenced by SvxAccessibleTextAdapter::Delete().

◆ FieldClicked()

virtual void SvxTextForwarder::FieldClicked ( const SvxFieldItem rField)
pure virtual

◆ GetAttribs()

virtual SfxItemSet SvxTextForwarder::GetAttribs ( const ESelection rSel,
EditEngineAttribs  nOnlyHardAttrib = EditEngineAttribs::All 
) const
pure virtual

◆ GetAttributeRun()

virtual bool SvxTextForwarder::GetAttributeRun ( sal_Int32 &  nStartIndex,
sal_Int32 &  nEndIndex,
sal_Int32  nPara,
sal_Int32  nIndex,
bool  bInCell = false 
) const
pure virtual

Query range of similar attributes.

Please note that the range returned is half-open: [nStartIndex,nEndIndex)

Parameters
nStartIndexHerein, the start index of the range of similar attributes is returned
nEndIndexHerein, the end index (exclusive) of the range of similar attributes is returned
nIndexThe character index from which the range of similar attributed characters is requested
Returns
true, if the range has been successfully determined

Implemented in SvxAccessibleTextAdapter, SvxEditEngineForwarder, SvxOutlinerForwarder, and SvxDummyTextSource.

Referenced by SvxAccessibleTextAdapter::GetAttributeRun().

◆ GetBulletInfo()

virtual EBulletInfo SvxTextForwarder::GetBulletInfo ( sal_Int32  nPara) const
pure virtual

Query information regarding bullets for given paragraph on the underlying edit engine.

Parameters
nPara[0.. n-1] Index of paragraph to query bullet info on

Implemented in SvxAccessibleTextAdapter, SvxEditEngineForwarder, SvxOutlinerForwarder, and SvxDummyTextSource.

Referenced by SvxAccessibleTextAdapter::GetBulletInfo(), and accessibility::AccessibleImageBullet::implGetBounds().

◆ GetCharBounds()

virtual tools::Rectangle SvxTextForwarder::GetCharBounds ( sal_Int32  nPara,
sal_Int32  nIndex 
) const
pure virtual

Query the bounding rectangle of the given character.

Parameters
nPara[0.. n] Index of paragraph to query the bounds in.

The virtual character after the last character of the represented text, i.e. the one at position n is a special case. Because it does not represent an existing character its bounding box is defined in relation to preceding characters. It should be roughly equivalent to the bounding box of some character when inserted at the end of the text. Its height typically being the maximal height of all the characters in the text or the height of the preceding character, its width being at least one pixel so that the bounding box is not degenerate.

Parameters
nIndex[0.. m-1] Index of character to query the bounds of
Returns
rectangle in logical coordinates, relative to upper left corner of text. The coordinates returned here are to be interpreted in the map mode given by GetMapMode().

Implemented in SvxAccessibleTextAdapter, SvxEditEngineForwarder, SvxOutlinerForwarder, and SvxDummyTextSource.

Referenced by SvxAccessibleTextAdapter::GetCharBounds(), and SvxAccessibleTextAdapter::GetIndexAtPoint().

◆ GetDepth()

virtual sal_Int16 SvxTextForwarder::GetDepth ( sal_Int32  nPara) const
pure virtual

Get the outline depth of given paragraph.

Parameters
nParaIndex of the paragraph to query the depth of
Returns
the outline level of the given paragraph. The range is [0,n), where n is the maximal outline level.

Implemented in SvxAccessibleTextAdapter, SvxEditEngineForwarder, SvxOutlinerForwarder, and SvxDummyTextSource.

Referenced by SvxAccessibleTextAdapter::GetDepth().

◆ GetEmptyItemSetPtr()

virtual const SfxItemSet * SvxTextForwarder::GetEmptyItemSetPtr ( )
pure virtual

◆ GetFieldCount()

virtual sal_Int32 SvxTextForwarder::GetFieldCount ( sal_Int32  nPara) const
pure virtual

Query number of fields in the underlying edit engine.

Parameters
nPara[0.. n-1] Index of paragraph to query field number in

Implemented in SvxAccessibleTextAdapter, SvxEditEngineForwarder, SvxOutlinerForwarder, and SvxDummyTextSource.

Referenced by SvxAccessibleTextAdapter::GetFieldCount().

◆ GetFieldInfo()

virtual EFieldInfo SvxTextForwarder::GetFieldInfo ( sal_Int32  nPara,
sal_uInt16  nField 
) const
pure virtual

Query information for given field number in the underlying edit engine.

Parameters
nPara[0.. n-1] Index of paragraph to query field info in
nField[0.. m-1] Index of field to query information of

Implemented in SvxAccessibleTextAdapter, SvxEditEngineForwarder, SvxOutlinerForwarder, and SvxDummyTextSource.

Referenced by SvxAccessibleTextAdapter::GetFieldInfo().

◆ GetIndexAtPoint()

virtual bool SvxTextForwarder::GetIndexAtPoint ( const Point rPoint,
sal_Int32 &  rPara,
sal_Int32 &  rIndex 
) const
pure virtual

Query paragraph and character index of the character at the given point.

Returns sal_True on success, sal_False otherwise

Parameters
rPointPoint to query text position of. Is interpreted in logical coordinates, relative to the upper left corner of the text, and in the map mode given by GetMapMode()
rPara[0.. n-1] Index of paragraph the point is within
rIndex[0.. m-1] Index of character the point is over
Returns
true, if the point is over any text and both rPara and rIndex are valid

Implemented in SvxAccessibleTextAdapter, SvxEditEngineForwarder, SvxOutlinerForwarder, and SvxDummyTextSource.

Referenced by SvxAccessibleTextAdapter::GetIndexAtPoint().

◆ GetItemState() [1/2]

virtual SfxItemState SvxTextForwarder::GetItemState ( const ESelection rSel,
sal_uInt16  nWhich 
) const
pure virtual

◆ GetItemState() [2/2]

virtual SfxItemState SvxTextForwarder::GetItemState ( sal_Int32  nPara,
sal_uInt16  nWhich 
) const
pure virtual

◆ GetLanguage()

virtual LanguageType SvxTextForwarder::GetLanguage ( sal_Int32  nPara,
sal_Int32  nIndex 
) const
pure virtual

Query language of character at given position on the underlying edit engine.

Parameters
nPara[0.. n-1] Index of paragraph to query language in
nIndex[0.. m-1] Index of character to query language of

Implemented in SvxAccessibleTextAdapter, SvxEditEngineForwarder, SvxOutlinerForwarder, and SvxDummyTextSource.

Referenced by SvxAccessibleTextAdapter::GetLanguage().

◆ GetLineBoundaries()

virtual void SvxTextForwarder::GetLineBoundaries ( sal_Int32 &  rStart,
sal_Int32 &  rEnd,
sal_Int32  nParagraph,
sal_Int32  nLine 
) const
pure virtual

Query bounds of line in paragraph.

Parameters
rStart[output param; 0 .. text_len] The index in the paragraph text that belongs to the chara at the start of the line
rEnd[output param; 0 .. text_len] The index in the paragraph text that follows the last chara in the line
nParagraph[0.. n-1] Index of paragraph to query line length in
nLine[0.. m-1] Index of line in paragraph to query line length of

Implemented in SvxOutlinerForwarder, SvxAccessibleTextAdapter, SvxEditEngineForwarder, and SvxDummyTextSource.

Referenced by SvxAccessibleTextAdapter::GetLineBoundaries().

◆ GetLineCount()

virtual sal_Int32 SvxTextForwarder::GetLineCount ( sal_Int32  nPara) const
pure virtual

Query number of lines in the formatted paragraph.

Parameters
nPara[0.. n-1] Index of paragraph to query number of lines in
Returns
number of lines in given paragraph

Implemented in SvxAccessibleTextAdapter, SvxEditEngineForwarder, SvxOutlinerForwarder, and SvxDummyTextSource.

Referenced by SvxAccessibleTextAdapter::GetLineCount().

◆ GetLineLen()

virtual sal_Int32 SvxTextForwarder::GetLineLen ( sal_Int32  nPara,
sal_Int32  nLine 
) const
pure virtual

Query line length.

Parameters
nPara[0.. n-1] Index of paragraph to query line length in
nLine[0.. m-1] Index of line in paragraph to query line length of

Implemented in SvxAccessibleTextAdapter, SvxEditEngineForwarder, SvxOutlinerForwarder, and SvxDummyTextSource.

Referenced by SvxAccessibleTextAdapter::GetLineLen().

◆ GetLineNumberAtIndex()

virtual sal_Int32 SvxTextForwarder::GetLineNumberAtIndex ( sal_Int32  nPara,
sal_Int32  nIndex 
) const
pure virtual

Query the line number for an index in the paragraphs text.

Parameters
nPara[0.. n-1] Index of paragraph to query line length in
nIndex[0.. m-1] Index of the char in the paragraph text
Returns
[0 .. k-1] The line number of the char in the paragraph

Implemented in SvxAccessibleTextAdapter, SvxEditEngineForwarder, SvxOutlinerForwarder, and SvxDummyTextSource.

Referenced by SvxAccessibleTextAdapter::GetLineNumberAtIndex().

◆ GetMapMode()

virtual MapMode SvxTextForwarder::GetMapMode ( ) const
pure virtual

Query the map mode of the underlying EditEngine/Outliner.

Returns
the map mode used on the EditEngine/Outliner. The values returned by GetParaBounds() and GetCharBounds() are to be interpreted in this map mode, the point given to GetIndexAtPoint() is interpreted in this map mode.

Implemented in SvxAccessibleTextAdapter, SvxEditEngineForwarder, SvxOutlinerForwarder, and SvxDummyTextSource.

Referenced by SvxAccessibleTextAdapter::GetMapMode(), and accessibility::AccessibleImageBullet::implGetBounds().

◆ GetNumberingStartValue()

sal_Int32 SvxTextForwarder::GetNumberingStartValue ( sal_Int32  nPara)
virtual

Reimplemented in SvxOutlinerForwarder.

Definition at line 563 of file unoforou.cxx.

◆ GetParaAttribs()

virtual SfxItemSet SvxTextForwarder::GetParaAttribs ( sal_Int32  nPara) const
pure virtual

◆ GetParaBounds()

virtual tools::Rectangle SvxTextForwarder::GetParaBounds ( sal_Int32  nPara) const
pure virtual

Query the bounding rectangle of the given paragraph.

Parameters
nPara[0.. n-1] Index of paragraph to query the bounds of
Returns
rectangle in logical coordinates, relative to upper left corner of text. The coordinates returned here are to be interpreted in the map mode given by GetMapMode().

Implemented in SvxAccessibleTextAdapter, SvxEditEngineForwarder, SvxOutlinerForwarder, and SvxDummyTextSource.

Referenced by SvxAccessibleTextAdapter::GetParaBounds(), and accessibility::AccessibleImageBullet::implGetBounds().

◆ GetParagraphCount()

virtual sal_Int32 SvxTextForwarder::GetParagraphCount ( ) const
pure virtual

◆ GetPool()

virtual SfxItemPool * SvxTextForwarder::GetPool ( ) const
pure virtual

◆ GetPortions()

virtual void SvxTextForwarder::GetPortions ( sal_Int32  nPara,
std::vector< sal_Int32 > &  rList 
) const
pure virtual

◆ GetRefDevice()

virtual OutputDevice * SvxTextForwarder::GetRefDevice ( ) const
pure virtual

Query the reference output device of the underlying EditEngine/Outliner.

Returns
the OutputDevice used from the EditEngine/Outliner to format the text. It should be used when performing e.g. font calculations, since this is usually a printer with fonts and resolution different from the screen.

Implemented in SvxAccessibleTextAdapter, SvxEditEngineForwarder, SvxOutlinerForwarder, and SvxDummyTextSource.

Referenced by SvxAccessibleTextAdapter::GetRefDevice().

◆ GetStyleSheet()

virtual OUString SvxTextForwarder::GetStyleSheet ( sal_Int32  nPara) const
pure virtual

◆ GetText()

virtual OUString SvxTextForwarder::GetText ( const ESelection rSel) const
pure virtual

◆ GetTextLen()

virtual sal_Int32 SvxTextForwarder::GetTextLen ( sal_Int32  nParagraph) const
pure virtual

◆ GetWordIndices()

virtual bool SvxTextForwarder::GetWordIndices ( sal_Int32  nPara,
sal_Int32  nIndex,
sal_Int32 &  rStart,
sal_Int32 &  rEnd 
) const
pure virtual

Get the start and the end index of the word at the given index.

An index value on a word leads from the first character of that word up to and including the last space before the next word. The index values returned do not contain any leading or trailing white-space. If the input indices are invalid, sal_False is returned.

Parameters
nPara[0.. n-1] Index of paragraph to start the search in
nIndex[0.. m-1] Index of character to query the search on
rStartStart index (in the same paragraph)
rEndEnd index (in the same paragraph), this point to the last character still contained in the query
Returns
true, if the result is non-empty

Implemented in SvxAccessibleTextAdapter, SvxEditEngineForwarder, SvxOutlinerForwarder, and SvxDummyTextSource.

Referenced by SvxAccessibleTextAdapter::GetWordIndices().

◆ InsertText()

virtual bool SvxTextForwarder::InsertText ( const OUString &  rText,
const ESelection rSel 
)
pure virtual

Insert/Replace given text in given range and reformat text.

Parameters
rTextText to insert/replace
rSelSelection where text should be replaced. The empty selection inserts
Returns
true if text has been successfully inserted

Implemented in SvxAccessibleTextAdapter, SvxEditEngineForwarder, SvxOutlinerForwarder, and SvxDummyTextSource.

Referenced by SvxAccessibleTextAdapter::InsertText().

◆ IsParaIsNumberingRestart()

bool SvxTextForwarder::IsParaIsNumberingRestart ( sal_Int32  nPara)
virtual

Reimplemented in SvxOutlinerForwarder.

Definition at line 572 of file unoforou.cxx.

◆ IsValid()

virtual bool SvxTextForwarder::IsValid ( ) const
pure virtual

◆ QuickFormatDoc()

virtual bool SvxTextForwarder::QuickFormatDoc ( bool  bFull = false)
pure virtual

Updates the formatting.

See also
EditEngine::QuickFormatDoc() for details
Returns
true if text have been successfully reformatted

Implemented in SvxAccessibleTextAdapter, SvxEditEngineForwarder, SvxOutlinerForwarder, and SvxDummyTextSource.

Referenced by SvxAccessibleTextAdapter::QuickFormatDoc().

◆ QuickInsertField()

virtual void SvxTextForwarder::QuickInsertField ( const SvxFieldItem rFld,
const ESelection rSel 
)
pure virtual

◆ QuickInsertLineBreak()

virtual void SvxTextForwarder::QuickInsertLineBreak ( const ESelection rSel)
pure virtual

◆ QuickInsertText()

virtual void SvxTextForwarder::QuickInsertText ( const OUString &  rText,
const ESelection rSel 
)
pure virtual

◆ QuickSetAttribs()

virtual void SvxTextForwarder::QuickSetAttribs ( const SfxItemSet rSet,
const ESelection rSel 
)
pure virtual

◆ RemoveAttribs()

virtual void SvxTextForwarder::RemoveAttribs ( const ESelection rSelection)
pure virtual

◆ SetDepth()

virtual bool SvxTextForwarder::SetDepth ( sal_Int32  nPara,
sal_Int16  nNewDepth 
)
pure virtual

Set the outline depth of given paragraph.

Parameters
nParaIndex of the paragraph to set the depth of
nNewDepthThe depth to set on the given paragraph. The range is [0,n), where n is the maximal outline level.
Returns
true, if depth could be successfully set. Reasons for failure are e.g. the text does not support outline level (EditEngine), or the depth range is exceeded.

Implemented in SvxAccessibleTextAdapter, SvxEditEngineForwarder, SvxOutlinerForwarder, and SvxDummyTextSource.

Referenced by SvxAccessibleTextAdapter::SetDepth().

◆ SetNumberingStartValue()

void SvxTextForwarder::SetNumberingStartValue ( sal_Int32  nPara,
sal_Int32  nNumberingStartValue 
)
virtual

Reimplemented in SvxOutlinerForwarder.

Definition at line 568 of file unoforou.cxx.

Referenced by SvxPropertyValuesToItemSet().

◆ SetParaAttribs()

virtual void SvxTextForwarder::SetParaAttribs ( sal_Int32  nPara,
const SfxItemSet rSet 
)
pure virtual

◆ SetParaIsNumberingRestart()

void SvxTextForwarder::SetParaIsNumberingRestart ( sal_Int32  nPara,
bool  bParaIsNumberingRestart 
)
virtual

Reimplemented in SvxOutlinerForwarder.

Definition at line 577 of file unoforou.cxx.

Referenced by SvxPropertyValuesToItemSet().

◆ SetStyleSheet()

virtual void SvxTextForwarder::SetStyleSheet ( sal_Int32  nPara,
const OUString &  rStyleName 
)
pure virtual

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