36#include <com/sun/star/accessibility/AccessibleRole.hpp>
37#include <com/sun/star/accessibility/AccessibleScrollType.hpp>
38#include <com/sun/star/accessibility/AccessibleStateType.hpp>
39#include <com/sun/star/accessibility/AccessibleTextType.hpp>
40#include <com/sun/star/accessibility/AccessibleEventId.hpp>
41#include <com/sun/star/i18n/Boundary.hpp>
42#include <com/sun/star/i18n/CharacterIteratorMode.hpp>
43#include <com/sun/star/i18n/WordType.hpp>
44#include <com/sun/star/i18n/XBreakIterator.hpp>
45#include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
46#include <com/sun/star/beans/UnknownPropertyException.hpp>
60#include <com/sun/star/accessibility/AccessibleRelationType.hpp>
67#include <com/sun/star/beans/XPropertySet.hpp>
70#include <com/sun/star/awt/FontWeight.hpp>
71#include <com/sun/star/awt/FontStrikeout.hpp>
72#include <com/sun/star/awt/FontSlant.hpp>
82#include <com/sun/star/text/WritingMode2.hpp>
86#include <com/sun/star/text/TextMarkupType.hpp>
91#include <editeng/editids.hrc>
95#include "../../uibase/inc/fldmgr.hxx"
102using beans::PropertyValue;
103using beans::UnknownPropertyException;
104using beans::PropertyState_DIRECT_VALUE;
114constexpr OUStringLiteral
sServiceName =
u"com.sun.star.text.AccessibleParagraphView";
135 if( pCaret !=
nullptr )
151 bool bFormat = pTextFrame->
HasPara();
171 OSL_ENSURE( nRet >= 0,
"invalid cursor?" );
189 SwPaM* pCursor =
nullptr;
193 if ( pCursorShell !=
nullptr &&
194 ( _bForSelection || !pCursorShell->
IsTableMode() ) )
201 pCursor = pCursorShell->
GetCursor(
false );
220 rStateSet |= AccessibleStateType::MULTI_LINE;
225 rStateSet |= AccessibleStateType::MULTI_SELECTABLE;
227 rStateSet |= AccessibleStateType::FOCUSABLE;
234 if (pCaret !=
nullptr &&
240 rStateSet |= AccessibleStateType::FOCUSED;
254 if( sText != sOldText )
257 AccessibleEventObject
aEvent;
258 aEvent.EventId = AccessibleEventId::TEXT_CHANGED;
267 uno::Reference< XAccessibleContext > xAccContext(xparent,uno::UNO_QUERY);
268 if (xAccContext.is() && xAccContext->getAccessibleRole() == AccessibleRole::TABLE_CELL)
273 AccessibleEventObject aParaEvent;
274 aParaEvent.EventId = AccessibleEventId::VALUE_CHANGED;
279 else if( !bVisibleDataFired )
289 std::scoped_lock aGuard(
m_Mutex );
295 if( bNewIsHeading != bOldIsHeading )
298 AccessibleEventObject
aEvent;
299 aEvent.EventId = AccessibleEventId::ROLE_CHANGED;
304 if( sText == sOldText )
310 std::scoped_lock aGuard(
m_Mutex );
316 if( sNewDesc != sOldDesc )
319 AccessibleEventObject
aEvent;
320 aEvent.EventId = AccessibleEventId::DESCRIPTION_CHANGED;
321 aEvent.OldValue <<= sOldDesc;
322 aEvent.NewValue <<= sNewDesc;
334 std::scoped_lock aGuard(
m_Mutex );
351 if( pWin && pWin->
HasFocus() && -1 == nOld )
354 AccessibleEventObject
aEvent;
355 aEvent.EventId = AccessibleEventId::CARET_CHANGED;
361 if( pWin && pWin->
HasFocus() && -1 == nNew )
369 aEvent.EventId = AccessibleEventId::TEXT_SELECTION_CHANGED;
385 std::scoped_lock aGuard(
m_Mutex );
388 OSL_ENSURE(
nPos != -1,
"focus object should be selected" );
396 std::shared_ptr<SwAccessibleMap>
const& pInitMap,
399 , m_nOldCaretPos( -1 )
400 , m_bIsHeading( false )
402 , m_nHeadingLevel (-1)
403 , m_aSelectionHelper( *this )
405 , m_bLastHasSelection(false)
426 std::scoped_lock aGuard(
m_Mutex );
434 OSL_ENSURE( pFrame !=
nullptr,
"The text frame has vanished!" );
439 OSL_ENSURE( pFrame->
IsTextFrame(),
"The text frame has mutated!" );
445 OSL_ENSURE(
m_pPortionData !=
nullptr,
"UpdatePortionData() failed" );
456 OSL_ENSURE(
GetMap() !=
nullptr,
"no map?" );
459 OSL_ENSURE( pViewShell !=
nullptr,
"View shell expected!" );
462 OSL_ENSURE( pSfxShell !=
nullptr,
"SfxViewShell shell expected!" );
468 OSL_ENSURE( pDispatcher !=
nullptr,
"Dispatcher expected!" );
476 sal_Int32 nStartIndex,
477 sal_Int32 nEndIndex )
480 (nEndIndex == -1)) ||
482 "please check parameters before calling this method" );
493 pUnoCursor->SetMark();
497 uno::Reference<text::XText> aEmpty;
504 sal_Int32 nPos, sal_Int32 nLength)
510 sal_Int32 nPos, sal_Int32 nLength)
516 sal_Int32 nBegin, sal_Int32 nEnd, sal_Int32 nLength)
538 i18n::Boundary& rBound,
539 std::u16string_view text,
548 rBound.startPos =
nPos;
549 rBound.endPos = nPosEnd;
555 i18n::Boundary& rBound,
556 const OUString& rText,
569 const sal_Int16 nWordType = i18n::WordType::ANY_WORD;
573 rText,
nPos, aLocale, nWordType,
true );
579 i18n::Boundary& rBound,
580 const OUString& rText,
584 while(
nPos < rText.getLength() && pStr[
nPos] ==
u' ' )
592 i18n::Boundary& rBound,
593 std::u16string_view aText,
596 if( sal_Int32(aText.size()) ==
nPos )
604 i18n::Boundary& rBound,
605 std::u16string_view aText )
608 rBound.endPos = aText.size();
613 i18n::Boundary& rBound,
621 i18n::Boundary& rBound,
622 const OUString& rText,
635 const sal_Int16 nIterMode = i18n::CharacterIteratorMode::SKIPCELL;
638 rText,
nPos, aLocale, nIterMode, 1, nDone );
640 rText, rBound.endPos, aLocale, nIterMode, 1, nDone );
641 bool bRet = ((rBound.startPos <=
nPos) && (
nPos <= rBound.endPos));
642 OSL_ENSURE( rBound.startPos <=
nPos,
"start pos too high" );
643 OSL_ENSURE( rBound.endPos >=
nPos,
"end pos too low" );
649 i18n::Boundary& rBound,
650 const OUString& rText,
652 sal_Int16 nTextType )
655 if( !( AccessibleTextType::LINE == nTextType
658 throw lang::IndexOutOfBoundsException();
664 case AccessibleTextType::WORD:
668 case AccessibleTextType::SENTENCE:
672 case AccessibleTextType::PARAGRAPH:
676 case AccessibleTextType::CHARACTER:
680 case AccessibleTextType::LINE:
682 if((
nPos == rText.getLength()) &&
nPos > 0)
688 case AccessibleTextType::ATTRIBUTE_RUN:
692 case AccessibleTextType::GLYPH:
697 throw lang::IllegalArgumentException( );
709 std::scoped_lock aGuard2(
m_Mutex );
723 throw uno::RuntimeException(
"no SwTextFrame",
static_cast<cppu::OWeakObject*
>(
this));
741 OSL_ENSURE( pTextFrame,
742 "<SwAccessibleParagraph::getAccessibleRelationSet()> - missing text frame");
746 if ( pPrevContentFrame )
748 uno::Sequence< uno::Reference<XInterface> > aSequence {
GetMap()->
GetContext( pPrevContentFrame ) };
749 AccessibleRelation aAccRel( AccessibleRelationType::CONTENT_FLOWS_FROM,
751 pHelper->AddRelation( aAccRel );
755 if ( pNextContentFrame )
757 uno::Sequence< uno::Reference<XInterface> > aSequence {
GetMap()->
GetContext( pNextContentFrame ) };
758 AccessibleRelation aAccRel( AccessibleRelationType::CONTENT_FLOWS_TO,
760 pHelper->AddRelation( aAccRel );
778 if (pCursorSh !=
nullptr &&
779 ( pCursor ==
nullptr ||
785 SwPaM aPaM( aStartPos );
795 if (pWindow !=
nullptr)
806 std::optional<Color> xSectionTOXColor;
811 pFrame->
GetBackgroundBrush( aFillAttributes, pBackgroundBrush, xSectionTOXColor, aDummyRect,
false,
false ) )
813 if ( xSectionTOXColor )
815 rColor = *xSectionTOXColor;
820 rColor = pBackgroundBrush->
GetColor();
824 else if ( pCursorSh )
837 Color aBackgroundCol;
841 if ( aBackgroundCol.
IsDark() )
858 Color aBackgroundCol;
862 return sal_Int32(aBackgroundCol);
874 const OUString& sTestServiceName)
886 static uno::Sequence< OUString >
const aNames
909 static uno::Sequence< OUString >
const aNames
932 uno::Reference<XAccessibleText> aAccText =
static_cast<XAccessibleText *
>(*this);
937 uno::Reference<XAccessibleEditableText> aAccEditText =
this;
938 aRet <<= aAccEditText;
942 uno::Reference<XAccessibleSelection> aAccSel =
this;
947 uno::Reference<XAccessibleHypertext> aAccHyp =
this;
954 uno::Reference<XAccessibleTextAttributes> aAccTextAttr =
this;
955 aRet <<= aAccTextAttr;
961 uno::Reference<XAccessibleTextMarkup> aAccTextMarkup =
this;
962 aRet <<= aAccTextMarkup;
967 uno::Reference<XAccessibleMultiLineText> aAccMultiLineText =
this;
968 aRet <<= aAccMultiLineText;
972 uno::Reference< css::accessibility::XAccessibleTextSelection > aTextExtension =
this;
973 aRet <<= aTextExtension;
977 uno::Reference<XAccessibleExtendedAttributes> xAttr =
this;
982 aRet = SwAccessibleContext::queryInterface(rType);
1000 SwAccessibleContext::getTypes() ).
getTypes();
1005 return css::uno::Sequence<sal_Int8>();
1018 std::scoped_lock aOldCaretPosGuard(
m_Mutex );
1041 throw lang::IndexOutOfBoundsException();
1048 if( pCursorShell !=
nullptr )
1054 SwPaM aPaM( aStartPos );
1073 throw lang::IndexOutOfBoundsException();
1088 throw lang::IndexOutOfBoundsException();
1091 bool bBehindText =
false;
1117 css::uno::Sequence< css::style::TabStop > tabs;
1118 const sal_Int32 nStrLen = pFrame->
GetText().getLength();
1125 if( tabs.hasElements() )
1131 throw uno::RuntimeException(
"no Window",
static_cast<cppu::OWeakObject*
>(
this));
1140 aScreenRect.
Move( -aFramePixPos.
X(), -aFramePixPos.
Y() );
1142 tabs.getArray()[0].Position = aScreenRect.
GetWidth();
1153 explicit IndexCompare(
const PropertyValue* pVals ) :
pValues(pVals) {}
1154 bool operator() ( sal_Int32 a, sal_Int32 b )
const
1156 return (pValues[a].Name < pValues[b].Name);
1164 OUString strTypeName;
1168 if (nFieldIndex >= 0)
1177 && (nFieldIndex-- == 0))
1180 static_txtattr_cast<SwTextField const*>(pHt));
1184 && (nFieldIndex-- == 0))
1186 strTypeName =
"set reference";
1198 sal_uInt32 subType = 0;
1202 subType =
static_cast<const SwDocStatField*
>(pField)->GetSubType();
1212 sEntry =
"Headings";
1214 sEntry =
"Numbered Paragraphs";
1216 sEntry =
"Bookmarks";
1220 sEntry =
"Footnotes";
1223 sEntry =
"Endnotes";
1226 sEntry =
"Insert Reference";
1229 sEntry =
static_cast<const SwGetRefField*
>(pField)->GetSetRefName();
1233 strTypeName = sEntry;
1238 if (sEntry.getLength() > 0)
1240 strTypeName +=
"-" + sEntry;
1250 const sal_uInt32 nFormat= pField->
GetFormat();
1252 if (nFormat < nSize)
1255 if (sEntry.getLength() > 0)
1257 strTypeName +=
"-" + sEntry;
1263 subType =
static_cast<const SwExtUserField*
>(pField)->GetSubType();
1269 if (sEntry.getLength() > 0)
1271 strTypeName +=
"-" + sEntry;
1282 bool bOn = pRPld->
IsOn();
1285 strTypeName +=
"on";
1287 strTypeName +=
"off";
1299 std::vector<OUString> aLst;
1301 if (subType < aLst.size())
1302 sEntry = aLst[subType];
1303 if (sEntry.getLength() > 0)
1307 strTypeName = sEntry;
1309 const sal_uInt16 nExSub = pField->
GetSubType() & 0xff00;
1310 if (nSize > 0 && nExSub > 0)
1315 strTypeName += sEntry;
1320 strTypeName +=
"-" + sEntry;
1333 const uno::Sequence< OUString >& aRequestedAttributes )
1343 throw lang::IndexOutOfBoundsException();
1345 bool bSupplementalMode =
false;
1346 uno::Sequence< OUString > aNames = aRequestedAttributes;
1347 if (!aNames.hasElements())
1349 bSupplementalMode =
true;
1361 std::vector< PropertyValue > aValues( aDefAttrSeq.size() );
1363 for (
const auto& rDefEntry : aDefAttrSeq )
1365 tAccParaPropValMap::const_iterator aRunIter =
1366 aRunAttrSeq.find( rDefEntry.first );
1367 if ( aRunIter != aRunAttrSeq.end() )
1369 aValues[
i] = aRunIter->second;
1373 aValues[
i] = rDefEntry.second;
1377 if( bSupplementalMode )
1379 uno::Sequence< OUString > aSupplementalNames = aRequestedAttributes;
1380 if (!aSupplementalNames.hasElements())
1386 aValues.resize( aValues.size() + aSupplementalAttrSeq.size() );
1388 for (
const auto& rSupplementalEntry : aSupplementalAttrSeq )
1390 aValues[
i] = rSupplementalEntry.second;
1396 aValues.emplace_back();
1399 if (!strTypeName.isEmpty())
1401 aValues.emplace_back();
1402 PropertyValue& rValueFT = aValues.back();
1403 rValueFT.Name =
"FieldType";
1404 rValueFT.Value <<= strTypeName.toAsciiLowerCase();
1405 rValueFT.Handle = -1;
1406 rValueFT.State = PropertyState_DIRECT_VALUE;
1411 sal_Int32
nLength = aValues.size();
1412 std::vector<sal_Int32> aIndices;
1415 aIndices.push_back(
i);
1416 std::sort(aIndices.begin(), aIndices.end(), IndexCompare(aValues.data()));
1418 uno::Sequence<PropertyValue> aNewValues(
nLength );
1419 PropertyValue* pNewValues = aNewValues.getArray();
1422 pNewValues[
i] = aValues[aIndices[
i]];
1435 targetSet.
Put(sourceSet);
1440 const uno::Sequence< OUString >& aRequestedAttributes,
1442 const bool bOnlyCharAttrs )
1447 std::optional<SfxItemSet> pSet;
1448 if ( !bOnlyCharAttrs )
1458 svl::Items<RES_CHRATR_BEGIN, RES_CHRATR_END - 1> );
1466 if ( !bOnlyCharAttrs )
1471 pTextNode->SwContentNode::GetAttr( aParaSet );
1472 pSet->Put( aParaSet );
1476 "<SwAccessibleParagraph::_getDefaultAttributesImpl(..)> - missing paragraph style. Serious defect!" );
1482 pSet->Put( aCharSet );
1492 const SfxPoolItem* pItem = pSet->GetItem( pEntry->nWID );
1496 pItem->
QueryValue( aVal, pEntry->nMemberId );
1498 PropertyValue rPropVal;
1499 rPropVal.Name = pEntry->aName;
1500 rPropVal.Value = aVal;
1501 rPropVal.Handle = -1;
1502 rPropVal.State = beans::PropertyState_DEFAULT_VALUE;
1504 aDefAttrSeq[rPropVal.Name] = rPropVal;
1510 if ( !bOnlyCharAttrs && pTextNode->
GetTextColl() )
1514 PropertyValue rPropVal;
1517 rPropVal.Value = aVal;
1518 rPropVal.Handle = -1;
1519 rPropVal.State = beans::PropertyState_DEFAULT_VALUE;
1521 aDefAttrSeq[rPropVal.Name] = rPropVal;
1527 if ( !bOnlyCharAttrs &&
GetFrame() )
1530 if ( aIter != aDefAttrSeq.end() )
1532 PropertyValue rPropVal( aIter->second );
1533 sal_Int16 nVal = rPropVal.Value.get<sal_Int16>();
1534 if ( nVal == text::WritingMode2::PAGE )
1537 while ( pUpperFrame )
1544 nVal = text::WritingMode2::TB_RL;
1548 nVal = text::WritingMode2::RL_TB;
1552 nVal = text::WritingMode2::LR_TB;
1554 rPropVal.Value <<= nVal;
1555 aDefAttrSeq[rPropVal.Name] = rPropVal;
1561 pUpperFrame =
static_cast<const SwFlyFrame*
>(pUpperFrame)->GetAnchorFrame();
1565 pUpperFrame = pUpperFrame->
GetUpper();
1573 if ( !aRequestedAttributes.hasElements() )
1575 rDefAttrSeq = aDefAttrSeq;
1579 for(
const OUString& rReqAttr : aRequestedAttributes )
1581 tAccParaPropValMap::const_iterator
const aIter = aDefAttrSeq.find( rReqAttr );
1582 if ( aIter != aDefAttrSeq.end() )
1584 rDefAttrSeq[ aIter->first ] = aIter->second;
1591 const uno::Sequence< OUString >& aRequestedAttributes )
1601 static constexpr OUStringLiteral sMMToPixelRatio =
u"MMToPixelRatio";
1602 bool bProvideMMToPixelRatio( !aRequestedAttributes.hasElements() ||
1605 uno::Sequence< PropertyValue > aValues( aDefAttrSeq.size() +
1606 ( bProvideMMToPixelRatio ? 1 : 0 ) );
1607 auto pValues = aValues.getArray();
1608 std::transform(aDefAttrSeq.begin(), aDefAttrSeq.end(),
pValues,
1609 [](
const auto& rEntry) -> PropertyValue { return rEntry.second; });
1612 if ( bProvideMMToPixelRatio )
1614 PropertyValue rPropVal;
1615 rPropVal.Name = sMMToPixelRatio;
1616 const Size a100thMMSize( 1000, 1000 );
1618 const float fRatio = (
static_cast<float>(a100thMMSize.
Width())/100)/aPixelSize.
Width();
1619 rPropVal.Value <<= fRatio;
1620 rPropVal.Handle = -1;
1621 rPropVal.State = beans::PropertyState_DEFAULT_VALUE;
1622 pValues[ aValues.getLength() - 1 ] = rPropVal;
1629 const sal_Int32 nIndex,
1630 const uno::Sequence< OUString >& aRequestedAttributes,
1634 std::optional<SwPaM> pPaM;
1644 pPaM.emplace(aModelPos, aEndPos);
1659 aAutomaticParaStyleCharAttrs.Put( *(pTextNode->
GetpSwAttrSet()),
false );
1660 aSet.Put( aAutomaticParaStyleCharAttrs );
1667 aSet.Put( aCharAttrsAtPaM );
1675 uno::Sequence< OUString > aDummy;
1685 if ( aSet.GetItemState( pEntry->nWID,
true, &pItem ) == SfxItemState::SET )
1688 pItem->
QueryValue( aVal, pEntry->nMemberId );
1690 PropertyValue rPropVal;
1691 rPropVal.Name = pEntry->aName;
1692 rPropVal.Value = aVal;
1693 rPropVal.Handle = -1;
1694 rPropVal.State = PropertyState_DIRECT_VALUE;
1696 tAccParaPropValMap::const_iterator aDefIter =
1697 aDefAttrSeq.find( rPropVal.Name );
1698 if ( aDefIter == aDefAttrSeq.end() ||
1699 rPropVal.Value != aDefIter->second.Value )
1701 aRunAttrSeq[rPropVal.Name] = rPropVal;
1707 if ( !aRequestedAttributes.hasElements() )
1709 rRunAttrSeq = aRunAttrSeq;
1713 for(
const OUString& rReqAttr : aRequestedAttributes )
1715 tAccParaPropValMap::iterator aIter = aRunAttrSeq.find( rReqAttr );
1716 if ( aIter != aRunAttrSeq.end() )
1718 rRunAttrSeq[ (*aIter).first ] = (*aIter).second;
1727 const uno::Sequence< OUString >& aRequestedAttributes )
1737 throw lang::IndexOutOfBoundsException();
1748 const uno::Sequence< OUString >& aRequestedAttributes,
1766 aSet.Put( pTextNode->SwContentNode::GetAttr(
RES_UL_SPACE) );
1776 for (
const auto & rEntry : pPropMap)
1778 const SfxPoolItem* pItem = aSet.GetItem( rEntry.nWID );
1784 PropertyValue rPropVal;
1785 rPropVal.Name = rEntry.aName;
1786 rPropVal.Value = aVal;
1787 rPropVal.Handle = -1;
1788 rPropVal.State = beans::PropertyState_DEFAULT_VALUE;
1790 aSupplementalAttrSeq[rPropVal.Name] = rPropVal;
1795 for(
const OUString& rSupplementalAttr : aRequestedAttributes )
1797 tAccParaPropValMap::const_iterator
const aIter = aSupplementalAttrSeq.find( rSupplementalAttr );
1798 if ( aIter != aSupplementalAttrSeq.end() )
1800 rSupplementalAttrSeq[ aIter->first ] = aIter->second;
1806 std::vector< PropertyValue >& rValues)
1820 case RedlineType::Insert:
1823 case RedlineType::Delete:
1826 case RedlineType::Format:
1834 case SID_ATTR_CHAR_WEIGHT:
1838 case SID_ATTR_CHAR_POSTURE:
1842 case SID_ATTR_CHAR_STRIKEOUT:
1844 ChangeAttr.Value <<= awt::FontStrikeout::SINGLE;
1846 case SID_ATTR_CHAR_UNDERLINE:
1853 if( aChangeAttr.
m_nItemId == SID_ATTR_BRUSH )
1857 ChangeAttrColor.Value <<=
COL_BLUE;
1859 ChangeAttrColor.Value <<= aChangeAttr.
m_nColor;
1865 ChangeAttrColor.Value <<=
COL_BLUE;
1867 ChangeAttrColor.Value <<= aChangeAttr.
m_nColor;
1879 if (
pos.first->Len() ==
pos.second
1883 assert(
pos.first->Len() !=
pos.second);
1887 sal_Int32 nValues = rValues.size();
1888 for (sal_Int32
i = 0;
i < nValues; ++
i)
1890 PropertyValue& rValue = rValues[
i];
1898 if (rValue.Name == ChangeAttrColor.Name )
1900 rValue.Value = ChangeAttrColor.Value;
1908 sal_uInt32 crBack =
static_cast<sal_uInt32
>(
reinterpret_cast<sal_uIntPtr
>(anyChar.pReserved));
1911 uno::Reference<XAccessibleComponent> xComponent(
this);
1912 if (xComponent.is())
1914 crBack =
static_cast<sal_uInt32
>(xComponent->getBackground());
1916 rValue.Value <<= crBack;
1927 sal_uInt32 crChar =
static_cast<sal_uInt32
>(
reinterpret_cast<sal_uIntPtr
>(anyChar.pReserved));
1931 uno::Reference<XAccessibleComponent> xComponent(
this);
1932 if (xComponent.is())
1936 rValue.Value <<= crChar;
1950 if(
nullptr != pWrongList )
1952 sal_Int32 nBegin =
pos.second;
1971 if(
nullptr != pWrongList )
1973 sal_Int32 nBegin =
pos.second;
1977 rValue.Value <<= sal_Int32(0x00ff0000);
1984 sal_uInt32 crUnderline =
static_cast<sal_uInt32
>(
reinterpret_cast<sal_uIntPtr
>(anyChar.pReserved));
1987 uno::Reference<XAccessibleComponent> xComponent(
this);
1988 if (xComponent.is())
1992 rValue.Value <<= crUnderline;
2003 if( !tabs.hasElements() )
2005 css::style::TabStop ts;
2008 if( rc1.X - rc0.X >= 48 )
2009 ts.Position = (rc1.X - rc0.X) - (rc1.X - rc0.X - 48)% 47 + 47;
2012 ts.DecimalChar =
' ';
2014 ts.Alignment = css::style::TabAlign_LEFT;
2017 rValue.Value <<= tabs;
2026 rValue.Value <<= sal_Int32(101);
2043 throw lang::IndexOutOfBoundsException();
2046 bool bBehindText =
false;
2075 throw uno::RuntimeException(
"no Window",
static_cast<cppu::OWeakObject*
>(
this));
2082 aScreenRect.
Move( -aFramePixPos.
getX(), -aFramePixPos.
getY() );
2085 return awt::Rectangle(
2086 aScreenRect.
Left(), aScreenRect.
Top(),
2109 throw uno::RuntimeException(
"no Window",
static_cast<cppu::OWeakObject*
>(
this));
2111 Point aPoint( rPoint.X, rPoint.Y );
2116 Point aCorePoint(
GetMap()->PixelToCore( aPoint ) );
2117 if( !aLogBounds.
Contains( aCorePoint ) )
2122 awt::Rectangle aRectEndPos =
2125 if (rPoint.X - aRectEndPos.X >= 0 &&
2126 rPoint.X - aRectEndPos.X < aRectEndPos.Width &&
2127 rPoint.Y - aRectEndPos.Y >= 0 &&
2128 rPoint.Y - aRectEndPos.Y < aRectEndPos.Height)
2135 OSL_ENSURE(
GetFrame() !=
nullptr,
"The text frame has vanished!" );
2136 OSL_ENSURE(
GetFrame()->IsTextFrame(),
"The text frame has mutated!" );
2154 if ( (!bVert && aResultRect.
Pos().getX() > aCorePoint.
getX()) ||
2155 ( bVert && aResultRect.
Pos().getY() > aCorePoint.
getY()) ||
2156 ( bR2L && aResultRect.
Right() < aCorePoint.
getX()) )
2161 if ( (!bVert && aResultRectPrev.
Pos().getX() < aCorePoint.
getX() && aResultRect.
Pos().getY() == aResultRectPrev.
Pos().getY()) ||
2162 ( bVert && aResultRectPrev.
Pos().getY() < aCorePoint.
getY() && aResultRect.
Pos().getX() == aResultRectPrev.
Pos().getX()) ||
2163 ( bR2L && aResultRectPrev.
Right() > aCorePoint.
getX() && aResultRect.
Pos().getY() == aResultRectPrev.
Pos().getY()) )
2181 sal_Int32 nStart, nEnd;
2184 ?
GetString().copy( nStart, nEnd - nStart )
2194 sal_Int32 nStart, nEnd;
2205 sal_Int32 nStart, nEnd;
2220 throw lang::IndexOutOfBoundsException();
2227 if( pCursorShell !=
nullptr )
2254 sal_Int32 nStartIndex, sal_Int32 nEndIndex )
2262 if ( !
IsValidRange( nStartIndex, nEndIndex, sText.getLength() ) )
2263 throw lang::IndexOutOfBoundsException();
2266 return sText.copy(nStartIndex, nEndIndex-nStartIndex );
2275 TextSegment aResult;
2276 aResult.SegmentStart = -1;
2277 aResult.SegmentEnd = -1;
2284 if(
nIndex == rText.getLength() && AccessibleTextType::LINE != nTextType )
2288 i18n::Boundary aBound;
2291 OSL_ENSURE( aBound.startPos >= 0,
"illegal boundary" );
2292 OSL_ENSURE( aBound.startPos <= aBound.endPos,
"illegal boundary" );
2297 aResult.SegmentText = rText.copy( aBound.startPos, aBound.endPos - aBound.startPos );
2298 aResult.SegmentStart = aBound.startPos;
2299 aResult.SegmentEnd = aBound.endPos;
2313 TextSegment aResult;
2314 aResult.SegmentStart = -1;
2315 aResult.SegmentEnd = -1;
2322 i18n::Boundary aBound;
2323 if (
nIndex == rText.getLength())
2324 aBound.startPos = aBound.endPos =
nIndex;
2330 aBound.startPos = aBound.endPos =
nIndex;
2334 if (nTextType == AccessibleTextType::WORD || nTextType == AccessibleTextType::SENTENCE)
2336 i18n::Boundary preBound = aBound;
2337 while(preBound.startPos==aBound.startPos &&
nIndex > 0)
2341 rText.iterateCodePoints(&
nIndex, -1);
2348 aResult.SegmentText = rText.copy( preBound.startPos, preBound.endPos - preBound.startPos );
2349 aResult.SegmentStart = preBound.startPos;
2350 aResult.SegmentEnd = preBound.endPos;
2361 rText.iterateCodePoints(&
nIndex, -1);
2368 if (bWord &&
nIndex<rText.getLength())
2370 aResult.SegmentText = rText.copy( aBound.startPos, aBound.endPos - aBound.startPos );
2371 aResult.SegmentStart = aBound.startPos;
2372 aResult.SegmentEnd = aBound.endPos;
2384 TextSegment aResult;
2385 aResult.SegmentStart = -1;
2386 aResult.SegmentEnd = -1;
2392 if(
nIndex == rText.getLength() )
2396 i18n::Boundary aBound;
2402 if(
nIndex < rText.getLength() )
2410 aResult.SegmentText = rText.copy( aBound.startPos, aBound.endPos - aBound.startPos );
2411 aResult.SegmentStart = aBound.startPos;
2412 aResult.SegmentEnd = aBound.endPos;
2488 sal_Int32 nEndIndex, AccessibleScrollType aScrollType )
2497 throw lang::IndexOutOfBoundsException();
2501 throw uno::RuntimeException(
"no Window",
static_cast<cppu::OWeakObject*
>(
this));
2504 awt::Rectangle startR, endR;
2510 Point eP(std::max(startR.X + startR.Width, endR.X + endR.Width), endR.Y + endR.Height);
2521 switch (aScrollType)
2524 case AccessibleScrollType_SCROLL_TOP_LEFT:
2526 case AccessibleScrollType_SCROLL_BOTTOM_RIGHT:
2528 case AccessibleScrollType_SCROLL_TOP_EDGE:
2530 case AccessibleScrollType_SCROLL_BOTTOM_EDGE:
2532 case AccessibleScrollType_SCROLL_LEFT_EDGE:
2534 case AccessibleScrollType_SCROLL_RIGHT_EDGE:
2537 case AccessibleScrollType_SCROLL_ANYWHERE:
2543 const SwRect aRect(startPoint, endPoint);
2545 OSL_ENSURE( pViewShell !=
nullptr,
"View shell expected!" );
2547 ScrollMDI(pViewShell, aRect, USHRT_MAX, USHRT_MAX);
2586 return replaceText( nStartIndex, nEndIndex, OUString() );
2595 sal_Int32 nStartIndex, sal_Int32 nEndIndex,
2596 const OUString& sReplacement )
2604 if( !
IsValidRange( nStartIndex, nEndIndex, rText.getLength() ) )
2605 throw lang::IndexOutOfBoundsException();
2614 nStartIndex, nEndIndex, nStart, nEnd );
2629 const_cast<SwDoc&
>(pFrame->
GetDoc()), aStartPos, &aEndPos));
2630 xRange->setString(sReplacement);
2641 sal_Int32 nStartIndex,
2642 sal_Int32 nEndIndex,
2643 const uno::Sequence<PropertyValue>& rAttributeSet )
2651 if( !
IsValidRange( nStartIndex, nEndIndex, rText.getLength() ) )
2652 throw lang::IndexOutOfBoundsException();
2663 sal_Int32
nLength = rAttributeSet.getLength();
2664 const PropertyValue* pPairs = rAttributeSet.getConstArray();
2665 std::vector<sal_Int32> aIndices(
nLength);
2666 std::iota(aIndices.begin(), aIndices.end(), 0);
2667 std::sort(aIndices.begin(), aIndices.end(), IndexCompare(pPairs));
2670 uno::Sequence< OUString > aNames(
nLength );
2671 OUString* pNames = aNames.getArray();
2672 uno::Sequence< uno::Any > aValues(
nLength );
2676 const PropertyValue& rVal = pPairs[aIndices[
i]];
2677 pNames[
i] = rVal.Name;
2686 xPortion->setPropertyValues( aNames, aValues );
2688 catch (
const UnknownPropertyException&)
2705 sal_Int64 nChildIndex )
2713 sal_Int64 nChildIndex )
2740 sal_Int64 nSelectedChildIndex )
2749 sal_Int64 nChildIndex )
2760class SwHyperlinkIter_Impl
2768 explicit SwHyperlinkIter_Impl(
const SwTextFrame & rTextFrame);
2777SwHyperlinkIter_Impl::SwHyperlinkIter_Impl(
const SwTextFrame & rTextFrame)
2778 : m_rFrame(rTextFrame)
2779 , m_Iter(rTextFrame)
2780 , m_nStt(rTextFrame.GetOffset())
2795 while (
SwTextAttr const*
const pHt = m_Iter.NextAttr(&pNode))
2799 const TextFrameIndex nHtStt(m_rFrame.MapModelToView(pNode, pHt->GetStart()));
2800 const TextFrameIndex nHtEnd(m_rFrame.MapModelToView(pNode, pHt->GetAnyEnd()));
2801 if (nHtEnd > nHtStt &&
2802 ((nHtStt >= m_nStt && nHtStt < m_nEnd) ||
2803 (nHtEnd > m_nStt && nHtEnd <= m_nEnd)))
2828 SwHyperlinkIter_Impl aIter(*pTextFrame);
2829 while( aIter.next() )
2835uno::Reference< XAccessibleHyperlink > SAL_CALL
2842 uno::Reference< XAccessibleHyperlink > xRet;
2845 SwHyperlinkIter_Impl aHIter(*pTextFrame);
2848 for (sal_Int32 nTIndex = 0; pHt && nTIndex <= nLinkIndex; ++nTIndex)
2850 if( nTIndex == nLinkIndex )
2858 xRet = (*aIter).second;
2865 max(aHIter.startIdx(), nHintStart));
2867 min(aHIter.endIdx(), nHintEnd));
2869 *
this, nTmpHStt, nTmpHEnd );
2872 (*aIter).second = xRet;
2883 pHt =
const_cast<SwTextAttr*
>(aHIter.next(&pNode));
2886 throw lang::IndexOutOfBoundsException();
2901 throw lang::IndexOutOfBoundsException();
2904 sal_Int32 nRet = -1;
2908 SwHyperlinkIter_Impl aHIter(*pTextFrame);
2917 pHt = aHIter.next(&pNode);
2926 throw lang::IndexOutOfBoundsException();
2935 std::unique_ptr<SwTextMarkupHelper> pTextMarkupHelper;
2936 switch ( nTextMarkupType )
2938 case text::TextMarkupType::TRACK_CHANGE_INSERTION:
2939 case text::TextMarkupType::TRACK_CHANGE_DELETION:
2940 case text::TextMarkupType::TRACK_CHANGE_FORMATCHANGE:
2954 return pTextMarkupHelper->getTextMarkupCount( nTextMarkupType );
2967 sal_Int32 nSelected = 0;
2969 if( pCursor !=
nullptr )
2977 nLastNode = pMerged->pLastNode->GetIndex();
2981 nLastNode = nFirstNode;
2988 if( rTmpCursor.HasMark() )
2995 if ((nStartIndex <= nLastNode) && (nFirstNode <= nEndIndex))
3014 sal_Int32 nStart=-1, nEnd=-1;
3025 sal_Int32 nStart=-1, nEnd=-1;
3034 if(selectionIndex < 0)
return false;
3036 sal_Int32 nSelected = selectionIndex;
3041 if( pCursor !=
nullptr )
3051 nLastNode = pMerged->pLastNode->GetIndex();
3055 nLastNode = nFirstNode;
3059 SwPaM* pRingStart = pCursor;
3070 if ((nStartIndex <= nLastNode) && (nFirstNode <= nEndIndex))
3072 if( nSelected == 0 )
3074 pCursor->
MoveTo(
nullptr);
3088 while( !bRet && (pCursor != pRingStart) );
3103 throw lang::IndexOutOfBoundsException();
3107 for ( sal_Int32
i = nSelectedCount ;
i >= 0 ;
i--)
3109 sal_Int32 nStart, nEnd;
3115 if (( startOffset>=nStart && startOffset <=nEnd ) ||
3116 ( endOffset>=nStart && endOffset <=nEnd ) ||
3117 ( startOffset <= nStart && endOffset >=nEnd) ||
3118 ( startOffset >= nStart && endOffset <=nEnd) )
3126 if (( startOffset>=nEnd && startOffset <=nStart ) ||
3127 ( endOffset>=nEnd && endOffset <=nStart ) ||
3128 ( startOffset <= nStart && endOffset >=nEnd) ||
3129 ( startOffset >= nStart && endOffset <=nEnd) )
3141 if( pCursorShell !=
nullptr )
3158 sal_Int32 nTextMarkupType )
3162 std::unique_ptr<SwTextMarkupHelper> pTextMarkupHelper;
3163 switch ( nTextMarkupType )
3165 case text::TextMarkupType::TRACK_CHANGE_INSERTION:
3166 case text::TextMarkupType::TRACK_CHANGE_DELETION:
3167 case text::TextMarkupType::TRACK_CHANGE_FORMATCHANGE:
3181 return pTextMarkupHelper->getTextMarkup( nTextMarkupIndex, nTextMarkupType );
3184uno::Sequence< TextSegment > SAL_CALL
3186 sal_Int32 nTextMarkupType )
3194 throw lang::IndexOutOfBoundsException();
3197 std::unique_ptr<SwTextMarkupHelper> pTextMarkupHelper;
3198 switch ( nTextMarkupType )
3200 case text::TextMarkupType::TRACK_CHANGE_INSERTION:
3201 case text::TextMarkupType::TRACK_CHANGE_DELETION:
3202 case text::TextMarkupType::TRACK_CHANGE_FORMATCHANGE:
3216 return pTextMarkupHelper->getTextMarkupAtIndex( nCharIndex, nTextMarkupType );
3228 throw lang::IndexOutOfBoundsException();
3244 throw lang::IndexOutOfBoundsException();
3247 i18n::Boundary aLineBound;
3250 TextSegment aTextAtLine;
3252 aTextAtLine.SegmentText = rText.copy( aLineBound.startPos,
3253 aLineBound.endPos - aLineBound.startPos );
3254 aTextAtLine.SegmentStart = aLineBound.startPos;
3255 aTextAtLine.SegmentEnd = aLineBound.endPos;
3266 if ( nLineNoOfCaret >= 0 &&
3272 return TextSegment();
3289 if ( nCaretPos != 0 )
3291 i18n::Boundary aLineBound;
3293 if ( nCaretPos == aLineBound.startPos )
3296 if ( pCursorShell !=
nullptr )
3305 throw uno::RuntimeException(
"no Window",
static_cast<cppu::OWeakObject*
>(
this));
3312 aScreenRect.
Move( -aFramePixPos.
getX(), -aFramePixPos.
getY() );
3315 const awt::Rectangle aCursorRect( aScreenRect.
Left(),
3320 if ( aCharRect.X != aCursorRect.X ||
3321 aCharRect.Y != aCursorRect.Y )
3339 sal_Int32 * pSelection, sal_Int32& nStart, sal_Int32& nEnd)
3341 if (pSelection && *pSelection < 0)
return false;
3349 if( pCursor !=
nullptr )
3357 nLastNode = pMerged->pLastNode->GetIndex();
3361 nLastNode = nFirstNode;
3368 if( rTmpCursor.HasMark() )
3375 if ((nStartIndex <= nLastNode) && (nFirstNode <= nEndIndex))
3377 if (!pSelection || *pSelection == 0)
3382 sal_Int32 nLocalStart = -1;
3383 if (nStartIndex < nFirstNode)
3403 else if( nCoreStart <=
3410 "problem determining valid core position");
3419 sal_Int32 nLocalEnd = -1;
3420 if (nLastNode < nEndIndex)
3442 else if( nCoreEnd >=
3450 "problem determining valid core position");
3457 if( ( nLocalStart != -1 ) && ( nLocalEnd != -1 ) )
3459 nStart = nLocalStart;
3478 if (pSelection && bRet)
3481 if( nStart == nCaretPos )
3482 std::swap( nStart, nEnd );
3494 return AccessibleRole::HEADING;
3498 return AccessibleRole::PARAGRAPH;
3505 uno::Reference< css::beans::XPropertySet > xPortion =
CreateUnoPortion( 0, 0 );
3506 uno::Any styleAny = xPortion->getPropertyValue(
"ParaStyleName" );
3508 if (styleAny >>= sValue)
3510 sal_Int32
length = sValue.getLength();
3513 if (sValue.startsWith(
"Heading"))
3515 std::u16string_view intStr = sValue.subView(8);
3517 return headingLevel;
3529 OUString strHeading(
"heading-level:");
3533 strHeading +=
";level:";
const PropertyValue * pValues
o3tl::strong_int< sal_Int32, struct Tag_TextFrameIndex > TextFrameIndex
Denotes a character index in a text frame at a layout level, after extent mapping from a text node at...
constexpr OUStringLiteral sAccessibleServiceName
static uno::Sequence< OUString > const & getSupplementalAttributeNames()
static void SetPutRecursive(SfxItemSet &targetSet, const SfxItemSet &sourceSet)
static bool lcl_GetBackgroundColor(Color &rColor, const SwFrame *pFrame, SwCursorShell *pCursorSh)
constexpr OUStringLiteral sServiceName
static uno::Sequence< OUString > const & getAttributeNames()
constexpr OUStringLiteral sImplementationName
std::unordered_map< OUString, css::beans::PropertyValue > tAccParaPropValMap
virtual const SwRangeRedline * GetRedline(const SwPosition &rPos, SwRedlineTable::size_type *pFndPos) const =0
constexpr tools::Long Y() const
void setX(tools::Long nX)
void setY(tools::Long nY)
constexpr tools::Long X() const
constexpr tools::Long getX() const
constexpr tools::Long getY() const
const SfxPoolItem * Execute(sal_uInt16 nSlot, SfxCallMode nCall=SfxCallMode::SLOT, const SfxPoolItem **pArgs=nullptr, sal_uInt16 nModi=0, const SfxPoolItem **pInternalArgs=nullptr)
const o3tl::sorted_vector< const SfxItemPropertyMapEntry *, SfxItemPropertyMapCompare > & getPropertyEntries() const
const SfxItemPropertyMap & getPropertyMap() const
const SfxItemSet * GetParent() const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
void StartListening(SfxBroadcaster &rBroadcaster, DuplicateHandling eDuplicateHanding=DuplicateHandling::Unexpected)
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const
SfxDispatcher * GetDispatcher()
SfxViewFrame & GetViewFrame() const
constexpr tools::Long Width() const
const Color & GetColor() const
void FireStateChangedEvent(sal_Int64 nState, bool bNewState)
void FireVisibleDataEvent()
void SetName(const OUString &rName)
void FireAccessibleEvent(css::accessibility::AccessibleEventObject &rEvent)
virtual void GetStates(sal_Int64 &rStateSet)
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleParent() override
virtual sal_Int32 SAL_CALL getBackground() override
vcl::Window * GetWindow()
virtual sal_Int32 SAL_CALL getForeground() override
SwAccessibleMap * GetMap()
bool Select(SwPaM *pPaM, SdrObject *pObj, bool bAdd)
SwCursorShell * GetCursorShell()
convenience method to get SwCursorShell through accessibility map
SwViewShell * GetShell()
convenience method to get the SwViewShell through accessibility map
SwRect GetBounds(const SwAccessibleMap &rAccMap, const SwFrame *pFrame=nullptr)
const SwFrame * GetFrame() const
std::map< key_type, mapped_type, key_compare >::iterator iterator
void SetCursorContext(const ::rtl::Reference< SwAccessibleContext > &rCursorContext)
css::uno::Reference< css::accessibility::XAccessible > GetContext(const SwFrame *pFrame, bool bCreate=true)
virtual Point LogicToPixel(const Point &rPoint) const override
SwViewShell * GetShell() const
virtual sal_Int32 SAL_CALL getSelectedPortionCount() override
bool GetWordBoundary(css::i18n::Boundary &rBound, const OUString &rText, sal_Int32 nPos)
std::unique_ptr< SwParaChangeTrackingInfo > mpParaChangeTrackInfo
virtual sal_Int32 SAL_CALL getForeground() override
virtual sal_Bool SAL_CALL setText(const OUString &sText) override
virtual sal_Bool SAL_CALL insertText(const OUString &sText, sal_Int32 nIndex) override
static bool IsValidRange(sal_Int32 nBegin, sal_Int32 nEnd, sal_Int32 nLength)
virtual css::accessibility::TextSegment SAL_CALL getTextBeforeIndex(sal_Int32 nIndex, sal_Int16 aTextType) override
std::unique_ptr< SwAccessiblePortionData > m_pPortionData
bool GetCharBoundary(css::i18n::Boundary &rBound, std::u16string_view text, sal_Int32 nPos)
sal_Int32 m_nHeadingLevel
virtual css::uno::Any SAL_CALL getExtendedAttributes() override
static void OrderRange(sal_Int32 &nBegin, sal_Int32 &nEnd)
virtual void GetStates(sal_Int64 &rStateSet) override
static OUString GetDescription()
virtual void InvalidateContent_(bool bVisibleDataFired) override
virtual sal_Bool SAL_CALL scrollToPosition(const css::awt::Point &aPoint, sal_Bool isLeftTop) override
friend class SwAccessibleHyperlink
static bool GetParagraphBoundary(css::i18n::Boundary &rBound, std::u16string_view aText)
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getSelectedAccessibleChild(sal_Int64 nSelectedChildIndex) override
OUString GetFieldTypeNameAtIndex(sal_Int32 nIndex)
virtual sal_Bool SAL_CALL cutText(sal_Int32 nStartIndex, sal_Int32 nEndIndex) override
virtual sal_Int32 SAL_CALL getSelectionStart() override
rtl::Reference< SwXTextPortion > CreateUnoPortion(sal_Int32 nStart, sal_Int32 nEnd)
virtual void InvalidateCursorPos_() override
virtual sal_Bool SAL_CALL setCaretPosition(sal_Int32 nIndex) override
virtual sal_Int32 SAL_CALL addSelection(sal_Int32 selectionIndex, sal_Int32 startOffset, sal_Int32 endOffset) override
css::uno::Sequence< css::style::TabStop > GetCurrentTabStop(sal_Int32 nIndex)
virtual css::uno::Reference< css::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet() override
virtual sal_Bool SAL_CALL replaceText(sal_Int32 nStartIndex, sal_Int32 nEndIndex, const OUString &sReplacement) override
virtual sal_Bool SAL_CALL isAccessibleChildSelected(sal_Int64 nChildIndex) override
virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL getCharacterAttributes(sal_Int32 nIndex, const css::uno::Sequence< OUString > &aRequestedAttributes) override
virtual sal_Int32 SAL_CALL getBackground() override
bool GetSentenceBoundary(css::i18n::Boundary &rBound, const OUString &rText, sal_Int32 nPos)
virtual sal_Int32 SAL_CALL getLineNumberAtIndex(sal_Int32 nIndex) override
std::unique_ptr< SwAccessibleHyperTextData > m_pHyperTextData
virtual sal_Bool SAL_CALL pasteText(sal_Int32 nIndex) override
void ExecuteAtViewShell(sal_uInt16 nSlot)
virtual OUString SAL_CALL getText() override
SwAccessibleSelectionHelper m_aSelectionHelper
virtual css::accessibility::TextSegment SAL_CALL getTextBehindIndex(sal_Int32 nIndex, sal_Int16 aTextType) override
static bool IsValidPosition(sal_Int32 nPos, sal_Int32 nLength)
virtual bool HasCursor() override
virtual sal_Bool SAL_CALL scrollSubstringTo(sal_Int32 nStartIndex, sal_Int32 nEndIndex, css::accessibility::AccessibleScrollType aScrollType) override
bool GetGlyphBoundary(css::i18n::Boundary &rBound, const OUString &rText, sal_Int32 nPos)
virtual sal_Bool SAL_CALL setAttributes(sal_Int32 nStartIndex, sal_Int32 nEndIndex, const css::uno::Sequence< css::beans::PropertyValue > &aAttributeSet) override
SwAccessiblePortionData & GetPortionData()
virtual OUString SAL_CALL getAccessibleDescription() override
sal_Int32 GetRealHeadingLevel()
virtual css::lang::Locale SAL_CALL getLocale() override
Return the parents locale or throw exception if this object has no parent yet/anymore.
virtual css::accessibility::TextSegment SAL_CALL getTextAtLineNumber(sal_Int32 nLineNo) override
virtual void SAL_CALL clearAccessibleSelection() override
SwPaM * GetCursor(const bool _bForSelection)
virtual sal_Int64 SAL_CALL getSelectedAccessibleChildCount() override
virtual OUString SAL_CALL getTextRange(sal_Int32 nStartIndex, sal_Int32 nEndIndex) override
SwAccessibleParagraph(std::shared_ptr< SwAccessibleMap > const &pInitMap, const SwTextFrame &rTextFrame)
virtual ~SwAccessibleParagraph() override
static bool IsValidChar(sal_Int32 nPos, sal_Int32 nLength)
virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL getDefaultAttributes(const css::uno::Sequence< OUString > &aRequestedAttributes) override
virtual css::awt::Rectangle SAL_CALL getCharacterBounds(sal_Int32 nIndex) override
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
virtual OUString SAL_CALL getImplementationName() override
virtual void SAL_CALL deselectAccessibleChild(sal_Int64 nChildIndex) override
virtual sal_Int32 SAL_CALL getHyperLinkCount() override
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
bool GetAttributeBoundary(css::i18n::Boundary &rBound, sal_Int32 nPos)
virtual sal_Int16 SAL_CALL getAccessibleRole() override
OUString const & GetString()
get the (accessible) text string (requires frame; check before)
virtual sal_Bool SAL_CALL setSelection(sal_Int32 nStartIndex, sal_Int32 nEndIndex) override
virtual css::uno::Sequence< css::accessibility::TextSegment > SAL_CALL getTextMarkupAtIndex(sal_Int32 nCharIndex, sal_Int32 nTextMarkupType) override
virtual css::uno::Reference< css::accessibility::XAccessibleHyperlink > SAL_CALL getHyperLink(sal_Int32 nLinkIndex) override
virtual sal_Int32 SAL_CALL getSeletedPositionEnd(sal_Int32 nSelectedPortionIndex) override
virtual sal_Bool SAL_CALL copyText(sal_Int32 nStartIndex, sal_Int32 nEndIndex) override
bool GetLineBoundary(css::i18n::Boundary &rBound, std::u16string_view aText, sal_Int32 nPos)
virtual sal_Int32 SAL_CALL getSeletedPositionStart(sal_Int32 nSelectedPortionIndex) override
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &aType) override
virtual sal_Int32 SAL_CALL getNumberOfLineWithCaret() override
const SwRangeRedline * GetRedlineAtIndex()
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override
virtual sal_Int32 SAL_CALL getTextMarkupCount(sal_Int32 nTextMarkupType) override
virtual void SAL_CALL grabFocus() override
virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL getRunAttributes(sal_Int32 nIndex, const css::uno::Sequence< OUString > &aRequestedAttributes) override
void _getRunAttributesImpl(const sal_Int32 nIndex, const css::uno::Sequence< OUString > &aRequestedAttributes, tAccParaPropValMap &rRunAttrSeq)
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
virtual sal_Bool SAL_CALL supportsService(const OUString &sServiceName) override
Return whether the specified service is supported by this class.
virtual void SAL_CALL selectAccessibleChild(sal_Int64 nChildIndex) override
void _getDefaultAttributesImpl(const css::uno::Sequence< OUString > &aRequestedAttributes, tAccParaPropValMap &rDefAttrSeq, const bool bOnlyCharAttrs=false)
virtual css::accessibility::TextSegment SAL_CALL getTextMarkup(sal_Int32 nTextMarkupIndex, sal_Int32 nTextMarkupType) override
virtual sal_Bool SAL_CALL deleteText(sal_Int32 nStartIndex, sal_Int32 nEndIndex) override
virtual sal_Int32 SAL_CALL getIndexAtPoint(const css::awt::Point &aPoint) override
virtual sal_Unicode SAL_CALL getCharacter(sal_Int32 nIndex) override
virtual css::accessibility::TextSegment SAL_CALL getTextAtLineWithCaret() override
void _correctValues(const sal_Int32 nIndex, std::vector< css::beans::PropertyValue > &rValues)
virtual OUString SAL_CALL getSelectedText() override
virtual void SAL_CALL selectAllAccessibleChildren() override
virtual void InvalidateFocus_() override
virtual sal_Int32 SAL_CALL getCaretPosition() override
virtual css::accessibility::TextSegment SAL_CALL getTextAtIndex(sal_Int32 nIndex, sal_Int16 aTextType) override
bool GetTextBoundary(css::i18n::Boundary &rBound, const OUString &rText, sal_Int32 nPos, sal_Int16 aTextType)
virtual sal_Bool SAL_CALL removeSelection(sal_Int32 selectionIndex) override
bool GetSelectionAtIndex(sal_Int32 *pSelection, sal_Int32 &nStart, sal_Int32 &nEnd)
virtual sal_Int32 SAL_CALL getSelectionEnd() override
virtual sal_Int32 SAL_CALL getHyperLinkIndex(sal_Int32 nCharIndex) override
bool GetSelection(sal_Int32 &nStart, sal_Int32 &nEnd)
void _getSupplementalAttributesImpl(const css::uno::Sequence< OUString > &aRequestedAttributes, tAccParaPropValMap &rSupplementalAttrSeq)
virtual sal_Int32 SAL_CALL getCharacterCount() override
collect text portion data from the layout through SwPortionHandler interface
void GetBoundaryOfLine(const sal_Int32 nLineNo, css::i18n::Boundary &rLineBound)
bool IsIndexInFootnode(sal_Int32 nIndex)
sal_Int32 GetFieldIndex(sal_Int32 nPos) const
void GetSentenceBoundary(css::i18n::Boundary &rBound, sal_Int32 nPos)
void GetAttributeBoundary(css::i18n::Boundary &rBound, sal_Int32 nPos) const
bool IsInGrayPortion(sal_Int32 nPos)
bool GetEditableRange(sal_Int32 nStart, sal_Int32 nEnd, TextFrameIndex &rCoreStart, TextFrameIndex &rCoreEnd) const
Convert start and end positions into core positions.
TextFrameIndex GetCoreViewPosition(sal_Int32 nPos) const
get the position in the core view string for a given (accessibility) position
void GetLineBoundary(css::i18n::Boundary &rBound, sal_Int32 nPos) const
get the start & end positions of the sentence
void GetLastLineBoundary(css::i18n::Boundary &rBound) const
const OUString & GetAccessibleString() const
get the text string, as presented by the layout
sal_Int32 GetAccessiblePosition(TextFrameIndex nPos) const
get the position in the accessibility string for a given view position
TextFrameIndex FillSpecialPos(sal_Int32 nPos, SwSpecialPos &rPos, SwSpecialPos *&rpPos) const
fill a SwSpecialPos structure, suitable for calling SwTextFrame->GetCharRect Returns the core positio...
sal_Int32 GetLineNo(const sal_Int32 nPos) const
bool isAccessibleChildSelected(sal_Int64 nChildIndex)
void selectAccessibleChild(sal_Int64 nChildIndex)
void selectAllAccessibleChildren()
css::uno::Reference< css::accessibility::XAccessible > getSelectedAccessibleChild(sal_Int64 nSelectedChildIndex)
void deselectAccessibleChild(sal_Int64 nChildIndex)
sal_Int64 getSelectedAccessibleChildCount()
css::uno::Reference< css::i18n::XBreakIterator > const & GetBreakIter() const
const css::lang::Locale & GetLocale(const LanguageType aLang)
SwContentFrame is the layout for content nodes: a common base class for text (paragraph) and non-text...
bool HasSwAttrSet() const
const SwAttrSet * GetpSwAttrSet() const
const SwRect & GetCharRect() const
SwCursor * GetCursor(bool bMakeTableCursor=true) const
Return pointer to the current shell cursor.
SwPaM * CreateCursor()
delete the current cursor and make the following into the current
void EndAction(const bool bIdleEnd=false)
IDocumentRedlineAccess const & getIDocumentRedlineAccess() const
std::shared_ptr< SwUnoCursor > CreateUnoCursor(const SwPosition &rPos, bool bTableCursor=false)
const SwAttrPool & GetAttrPool() const
bool IsFrameSelected() const
size_t IsObjSelected() const
sal_uInt16 GetFormatCount(SwFieldTypesEnum nTypeId, bool bHtmlMode) const
void GetSubTypes(SwFieldTypesEnum nId, std::vector< OUString > &rToFill)
OUString GetFormatStr(SwFieldTypesEnum nTypeId, sal_uInt32 nFormatId) const
virtual OUString GetName() const
Only in derived classes.
static const OUString & GetTypeStr(SwFieldTypesEnum nTypeId)
Base class of all fields.
SwFieldTypesEnum GetTypeId() const
virtual sal_uInt16 GetSubType() const
sal_uInt32 GetFormat() const
Query parameters for dialog and for BASIC.
SwFieldType * GetTyp() const
general base class for all free-flowing frames
Base class of the Writer layout elements.
SwTextFrame * DynCastTextFrame()
SwContentFrame * FindPrevCnt()
SwFrameType GetType() const
bool IsRightToLeft() const
bool GetBackgroundBrush(drawinglayer::attribute::SdrAllFillAttributesHelperPtr &rFillAttributes, const SvxBrushItem *&rpBrush, std::optional< Color > &rxColor, SwRect &rOrigRect, bool bLowerMode, bool bConsiderTextBox) const
Determine the background brush for the frame: the background brush is taken from it-self or from its ...
SwLayoutFrame * GetUpper()
virtual css::uno::Sequence< css::style::TabStop > GetTabStopInfo(SwTwips)
SwContentFrame * FindNextCnt(const bool _bInSameFootnote=false)
virtual bool GetCharRect(SwRect &, const SwPosition &, SwCursorMoveState *=nullptr, bool bAllowFarAway=true) const
bool IsRefToNumItemCrossRefBookmark() const
bool IsRefToHeadingCrossRefBookmark() const
const AuthorCharAttr & GetFormatAuthorAttr() const
const AuthorCharAttr & GetDeletedAuthorAttr() const
const AuthorCharAttr & GetInsertAuthorAttr() const
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
SwNodeOffset GetIndex() const
PaM is Point and Mark: a selection of the document model.
const SwPosition * GetMark() const
virtual void SetMark()
Unless this is called, the getter method of Mark will return Point.
bool IsInFrontOfLabel() const
const SwPosition * End() const
const SwPosition * GetPoint() const
const SwPosition * Start() const
bool HasMark() const
A PaM marks a selection if Point and Mark are distinct positions.
RedlineType GetType(sal_uInt16 nPos=0) const
Of course Writer needs its own rectangles.
void Right(const tools::Long nRight)
void Pos(const Point &rNew)
bool Contains(const Point &rPOINT) const
void Left(const tools::Long nLeft)
A wrapper around SfxPoolItem to store the start position of (usually) a text portion,...
sal_Int32 GetAnyEnd() const
end (if available), else start
sal_Int32 GetStart() const
const SwFormatField & GetFormatField() const
Represents the visualization of a paragraph.
SwTextFrame * GetFollow()
SwPosition MapViewToModelPos(TextFrameIndex nIndex) const
LanguageType GetLangOfChar(TextFrameIndex nIndex, sal_uInt16 nScript, bool bNoChar=false) const
TextFrameIndex GetOffset() const
std::pair< SwTextNode *, sal_Int32 > MapViewToModel(TextFrameIndex nIndex) const
map position in potentially merged text frame to SwPosition
sw::MergedPara * GetMergedPara()
TextFrameIndex MapModelToView(SwTextNode const *pNode, sal_Int32 nIndex) const
void VisitPortions(SwPortionHandler &rPH) const
Visit all portions for Accessibility.
TextFrameIndex MapModelToViewPos(SwPosition const &rPos) const
bool IsInside(TextFrameIndex nPos) const
Respect the Follows.
SwTextNode * GetTextNodeFirst()
virtual bool GetCharRect(SwRect &rRect, const SwPosition &rPos, SwCursorMoveState *pCMS=nullptr, bool bAllowFarAway=true) const override
Returns the view rectangle for the rPos model position.
const OUString & GetText() const
Returns the text portion we want to edit (for inline see underneath)
SwTextNode const * GetTextNodeForParaProps() const
virtual bool GetModelPositionForViewPoint(SwPosition *, Point &, SwCursorMoveState *=nullptr, bool bTestBackground=false) const override
In nOffset returns the offset of the char within the set text buffer, which is closest to the positio...
SwTextNode is a paragraph in the document model.
bool HasBullet() const
Returns if this text node has a bullet.
virtual sal_Int32 Len() const override
const SfxPoolItem & GetAttr(sal_uInt16 nWhich, bool bInParent=true) const
End: Data collected during idle time.
bool IsOutline() const
Returns if this text node is an outline.
bool IsSymbolAt(sal_Int32 nBegin) const
in ndcopy.cxx
bool HasNumber(SwRootFrame const *pLayout=nullptr) const
Returns if this text node has a number.
SwTextFormatColl * GetTextColl() const
o3tl::span< const SfxItemPropertyMapEntry > GetPropertyMapEntries(sal_uInt16 PropertyId)
const SfxItemPropertySet * GetPropertySet(sal_uInt16 PropertyId)
const Color & GetFieldShadingsColor() const
bool IsOnlineSpell() const
Color GetRetoucheColor() const
const SwViewOption * GetViewOptions() const
SfxViewShell * GetSfxViewShell() const
bool InWrongWord(sal_Int32 &rChk, sal_Int32 &rLn) const
If a word is incorrectly selected, this method returns begin and length of it.
static bool implInitTextChangedEvent(std::u16string_view rOldString, std::u16string_view rNewString, css::uno::Any &rDeleted, css::uno::Any &rInserted)
css::uno::Sequence< css::uno::Type > SAL_CALL getTypes()
SwTextAttr const * NextAttr(SwTextNode const **ppNode=nullptr)
void MoveTo(value_type *pDestRing)
Removes this item from its current ring container and adds it to another ring container.
ring_container GetRingContainer()
constexpr ::Color COL_WHITE(0xFF, 0xFF, 0xFF)
constexpr ::Color COL_AUTO(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
constexpr ::Color COL_BLUE(0x00, 0x00, 0x80)
constexpr ::Color COL_BLACK(0x00, 0x00, 0x00)
constexpr ::Color COL_TRANSPARENT(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
void ScrollMDI(SwViewShell const *pVwSh, const SwRect &rRect, sal_uInt16 nRangeX, sal_uInt16 nRangeY)
constexpr sal_uInt16 RES_FRMATR_BEGIN(RES_PARATR_LIST_END)
constexpr sal_uInt16 RES_CHRATR_END(46)
constexpr sal_uInt16 RES_PARATR_BEGIN(RES_TXTATR_END)
constexpr TypedWhichId< SvxFirstLineIndentItem > RES_MARGIN_FIRSTLINE(91)
constexpr TypedWhichId< SfxInt16Item > RES_PARATR_LIST_LEVEL(83)
constexpr sal_uInt16 RES_FRMATR_END(141)
constexpr TypedWhichId< SwFormatINetFormat > RES_TXTATR_INETFMT(51)
constexpr TypedWhichId< SvxAdjustItem > RES_PARATR_ADJUST(64)
constexpr sal_uInt16 RES_PARATR_END(82)
constexpr TypedWhichId< SvxTabStopItem > RES_PARATR_TABSTOP(68)
constexpr TypedWhichId< SvxLineSpacingItem > RES_PARATR_LINESPACING(RES_PARATR_BEGIN)
constexpr TypedWhichId< SwFormatField > RES_TXTATR_ANNOTATION(60)
constexpr sal_uInt16 RES_CHRATR_BEGIN(HINT_BEGIN)
constexpr sal_uInt16 RES_PARATR_LIST_BEGIN(RES_PARATR_END)
constexpr TypedWhichId< SwNumRuleItem > RES_PARATR_NUMRULE(72)
constexpr TypedWhichId< SwFormatField > RES_TXTATR_FIELD(RES_TXTATR_NOEND_BEGIN)
constexpr sal_uInt16 RES_PARATR_LIST_END(88)
constexpr TypedWhichId< SvxRightMarginItem > RES_MARGIN_RIGHT(93)
constexpr TypedWhichId< SvxTextLeftMarginItem > RES_MARGIN_TEXTLEFT(92)
constexpr TypedWhichId< SwFormatRefMark > RES_TXTATR_REFMARK(RES_TXTATR_WITHEND_BEGIN)
constexpr TypedWhichId< SwFormatField > RES_TXTATR_INPUTFIELD(55)
constexpr TypedWhichId< SvxULSpaceItem > RES_UL_SPACE(98)
#define SAL_WARN_IF(condition, area, stream)
void GetCursorAttr(SwPaM &rPam, SfxItemSet &rSet, const bool bOnlyTextAttr=false, const bool bGetFromChrFormat=true)
double getLength(const B2DPolygon &rCandidate)
sal_Int32 findValue(const css::uno::Sequence< T1 > &_rList, const T2 &_rValue)
css::uno::Sequence< DstElementType > containerToSequence(const SrcType &i_Container)
css::uno::Sequence< typename M::mapped_type > mapValuesToSequence(M const &map)
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
std::shared_ptr< SdrAllFillAttributesHelper > SdrAllFillAttributesHelperPtr
sal_Int32 toInt32(std::u16string_view str, sal_Int16 radix=10)
sal_uInt32 iterateCodePoints(std::u16string_view string, sal_Int32 *indexUtf16, sal_Int32 incrementCodePoints=1)
static constexpr auto Items
bool FrameContainsNode(SwContentFrame const &rFrame, SwNodeOffset nNodeIndex)
TextFrameIndex MapModelToView(MergedPara const &, SwTextNode const *pNode, sal_Int32 nIndex)
SwNodeOffset min(const SwNodeOffset &a, const SwNodeOffset &b)
bool m_bRealHeight
should the real height be calculated?
SwSpecialPos * m_pSpecialPos
for positions inside fields
bool m_bRealWidth
Calculation of the width required.
bool m_bPosMatchesBounds
GetModelPositionForViewPoint should not return the next position if screen position is inside second ...
Marks a position in the document model.
SwNodeOffset GetNodeIndex() const
sal_Int32 GetContentIndex() const
SwDoc & GetDoc() const
Returns the document this position is in.
Describes parts of multiple text nodes, which will form a text frame, even when redlines are hidden a...
SwUnoPropertyMapProvider aSwMapProvider
#define PROPERTY_MAP_TEXT_CURSOR
#define PROPERTY_MAP_ACCESSIBILITY_TEXT_ATTRIBUTE
constexpr OUStringLiteral UNO_NAME_CHAR_CONTOURED
constexpr OUStringLiteral UNO_NAME_PARA_LEFT_MARGIN
constexpr OUStringLiteral UNO_NAME_CHAR_SHADOWED
constexpr OUStringLiteral UNO_NAME_PARA_RIGHT_MARGIN
constexpr OUStringLiteral UNO_NAME_CHAR_EMPHASIS
constexpr OUStringLiteral UNO_NAME_CHAR_BACK_COLOR
constexpr OUStringLiteral UNO_NAME_CHAR_UNDERLINE
constexpr OUStringLiteral UNO_NAME_PARA_FIRST_LINE_INDENT
constexpr OUStringLiteral UNO_NAME_PARA_STYLE_NAME
constexpr OUStringLiteral UNO_NAME_CHAR_POSTURE
constexpr OUStringLiteral UNO_NAME_TABSTOPS
constexpr OUStringLiteral UNO_NAME_WRITING_MODE
constexpr OUStringLiteral UNO_NAME_CHAR_COLOR
constexpr OUStringLiteral UNO_NAME_NUMBERING_LEVEL
constexpr OUStringLiteral UNO_NAME_CHAR_ESCAPEMENT
constexpr OUStringLiteral UNO_NAME_CHAR_STRIKEOUT
constexpr OUStringLiteral UNO_NAME_PARA_ADJUST
constexpr OUStringLiteral UNO_NAME_PARA_LINE_SPACING
constexpr OUStringLiteral UNO_NAME_CHAR_HEIGHT
constexpr OUStringLiteral UNO_NAME_PARA_BOTTOM_MARGIN
constexpr OUStringLiteral UNO_NAME_CHAR_FONT_NAME
constexpr OUStringLiteral UNO_NAME_CHAR_UNDERLINE_COLOR
constexpr OUStringLiteral UNO_NAME_CHAR_WEIGHT
constexpr OUStringLiteral UNO_NAME_NUMBERING_RULES