class SwTextFrame; struct SwSpecialPos; class SwViewOption; namespace com::sun::star { namespace i18n { struct Boundary; }
}
/** *collecttextportiondatafromthelayoutthroughSwPortionHandlerinterface
*/ class SwAccessiblePortionData : public SwPortionHandler
{ // the frame this portion is referring to const SwTextFrame& m_rTextFrame;
// variables used while collecting the data
OUStringBuffer m_aBuffer;
TextFrameIndex m_nViewPosition; const SwViewOption* m_pViewOptions;
/// the accessible string /// note that the content is different both from the string in the text /// node(s) as well as the string in the text frame, so there are 3 /// different index spaces involved.
OUString m_sAccessibleString;
// positions array // instances of Position_t must always include the minimum and // maximum positions as first/last elements (to simplify the // algorithms) typedef std::vector<sal_Int32> AccessiblePositions; typedef std::vector<TextFrameIndex> FramePositions;
AccessiblePositions m_aLineBreaks; /// position of line breaks
FramePositions m_ViewPositions; /// position of portion breaks in the core view
AccessiblePositions m_aAccessiblePositions; /// portion breaks in m_sAccessibleString
AccessiblePositions m_aFieldPosition;
AccessiblePositions m_aSentences; /// positions of sentence breaks
size_t m_nBeforePortions; /// # of portions before first core character bool m_bFinished;
/// fill the boundary with the values from rPositions[nPos] staticvoid FillBoundary(css::i18n::Boundary& rBound, const AccessiblePositions& rPositions,
size_t nPos );
/// get the text string, as presented by the layout const OUString& GetAccessibleString() const;
/// get the start & end positions of the sentence void GetLineBoundary( css::i18n::Boundary& rBound,
sal_Int32 nPos ) const;
// get start and end position of the last line void GetLastLineBoundary( css::i18n::Boundary& rBound ) const;
/// Determine whether this core position is valid for these portions. /// (A paragraph may be split into several frames, e.g. at page /// boundaries. In this case, only part of a paragraph is represented /// through this object. This method determines whether one particular /// position is valid for this object or not.) bool IsValidCorePosition(TextFrameIndex nPos) const;
TextFrameIndex GetFirstValidCorePosition() const;
TextFrameIndex GetLastValidCorePosition() const;
/// get the position in the accessibility string for a given view position
sal_Int32 GetAccessiblePosition(TextFrameIndex nPos) const;
/// get the position in the core view string for a given /// (accessibility) position
TextFrameIndex GetCoreViewPosition(sal_Int32 nPos) const;
/// fill a SwSpecialPos structure, suitable for calling /// SwTextFrame->GetCharRect /// Returns the core position, and fills rpPos either with NULL or /// with the &rPos, after putting the appropriate data into it.
TextFrameIndex FillSpecialPos(sal_Int32 nPos,
SwSpecialPos& rPos,
SwSpecialPos*& rpPos ) const;
// get boundaries of words/sentences. The data structures are // created on-demand. void GetSentenceBoundary( css::i18n::Boundary& rBound,
sal_Int32 nPos );
// get (a) boundary for attribute change void GetAttributeBoundary( css::i18n::Boundary& rBound,
sal_Int32 nPos ) const;
/// Convert start and end positions into core positions. /// @returns true if 'special' portions are included either completely /// or not at all. This can be used to test whether editing /// that range would be legal bool GetEditableRange( sal_Int32 nStart, sal_Int32 nEnd,
TextFrameIndex& rCoreStart, TextFrameIndex& rCoreEnd) 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.