20 #include <com/sun/star/accessibility/AccessibleStateType.hpp>
21 #include <com/sun/star/accessibility/AccessibleEventId.hpp>
50 if(
auto pFESh = dynamic_cast<const SwFEShell*>(pVSh) )
52 const SwFrame *pFlyFrame = pFESh->GetSelectedFlyFrame();
68 if (dynamic_cast<const SwFEShell*>(pVSh))
71 rStateSet.
AddState(AccessibleStateType::SELECTABLE);
73 rStateSet.
AddState(AccessibleStateType::FOCUSABLE);
79 rStateSet.
AddState( AccessibleStateType::SELECTED );
86 rStateSet.
AddState( AccessibleStateType::FOCUSED );
89 rStateSet.
AddState( AccessibleStateType::SELECTED );
95 if( pFlyFrame->
Lower() )
122 std::shared_ptr<SwAccessibleMap>
const& pInitMap,
126 m_bIsSelected(
false )
130 StartListening(const_cast<SwFrameFormat*>(pFrameFormat)->GetNotifier());
143 std::scoped_lock aGuard(
m_Mutex );
156 if( bOldSelected == bNewSelected )
160 if( pWin && pWin->
HasFocus() && bNewSelected )
162 if( pWin && pWin->
HasFocus() && !bNewSelected )
173 AccessibleEventObject
aEvent;
174 aEvent.EventId = AccessibleEventId::SELECTION_CHANGED;
175 uno::Reference< XAccessible > xChild(
this);
176 aEvent.NewValue <<= xChild;
190 std::scoped_lock aGuard(
m_Mutex );
193 assert(bSelected &&
"focus object should be selected");
201 std::scoped_lock aGuard(
m_Mutex );
211 if(rHint.
GetId() == SfxHintId::Dying)
215 else if (rHint.
GetId() == SfxHintId::SwLegacyModify)
218 const sal_uInt16 nWhich = pLegacyModifyHint->
GetWhich();
224 const OUString sOldName(
GetName() );
225 assert( !pLegacyModifyHint->m_pOld ||
226 static_cast<const SwStringMsgPoolItem *>(pLegacyModifyHint->m_pOld)->GetString() ==
GetName());
229 assert( !pLegacyModifyHint->m_pNew ||
230 static_cast<const SwStringMsgPoolItem *>(pLegacyModifyHint->m_pNew)->GetString() ==
GetName());
234 AccessibleEventObject
aEvent;
235 aEvent.EventId = AccessibleEventId::NAME_CHANGED;
236 aEvent.OldValue <<= sOldName;
256 SwPaM* pCursor =
nullptr;
258 if( pCursorShell !=
nullptr && !pCursorShell->
IsTableMode() )
265 pCursor = pCursorShell->
GetCursor(
false );
278 if(
GetMap()->IsDocumentSelAll())
294 if( pCursor !=
nullptr )
300 SwPaM* pRingStart = pCursor;
311 if( ( nHere >= nStartIndex ) && (nHere <= nEndIndex) )
313 if( rAnchor.
GetAnchorId() == RndStdIds::FLY_AS_CHAR )
315 if( ((nHere == nStartIndex) && (nIndex >= pStart->
nContent.
GetIndex())) || (nHere > nStartIndex) )
316 if( ((nHere == nEndIndex) && (nIndex < pEnd->
nContent.
GetIndex())) || (nHere < nEndIndex) )
319 else if( rAnchor.
GetAnchorId() == RndStdIds::FLY_AT_PARA )
324 else if (rAnchor.
GetAnchorId() == RndStdIds::FLY_AT_CHAR)
340 while( pCursor != pRingStart );
Base class of the Writer layout elements.
void FireAccessibleEvent(css::accessibility::AccessibleEventObject &rEvent)
virtual const SwFlyFrameFormat * GetFormat() const override
Marks a position in the document model.
sal_uInt16 GetWhich() const
virtual void GetStates(::utl::AccessibleStateSetHelper &rStateSet) override
virtual void InvalidateFocus_() override
SwAccessibleFrameBase(std::shared_ptr< SwAccessibleMap > const &pInitMap, sal_Int16 nInitRole, const SwFlyFrame *pFlyFrame)
vcl::Window * GetWindow()
virtual void Notify(const SfxHint &) override
bool IsSelectFrameAnchoredAtPara(SwPosition const &rAnchorPos, SwPosition const &rStart, SwPosition const &rEnd, DelContentType const nDelContentType)
is a fly anchored at paragraph at rAnchorPos selected?
Content, content of frame (header, footer, fly).
bool IsDestroyFrameAnchoredAtChar(SwPosition const &rAnchorPos, SwPosition const &rStart, SwPosition const &rEnd, DelContentType const nDelContentType)
will DelContentIndex destroy a frame anchored at character at rAnchorPos?
virtual bool SetSelectedState(bool bSelected) override
SwCursorShell * GetCursorShell()
convenience method to get SwCursorShell through accessibility map
SwViewShell * GetShell() const
SwNodeType GetNodeType() const
const SwFrame * GetFrame() const
virtual bool HasCursor() override
SwNodeOffset GetIndex() const
SwFlyFrame * getFlyFrame() const
void FireStateChangedEvent(sal_Int16 nState, bool bNewState)
PaM is Point and Mark: a selection of the document model.
const OUString & GetName() const
const SwFrame * Lower() const
SwContentNode * GetContentNode()
SwNodeOffset GetIndex() const
bool HasMark() const
A PaM marks a selection if Point and Mark are distinct positions.
Marks a node in the document model.
bool StartListening(SvtBroadcaster &rBroadcaster)
static SwNodeType GetNodeType(const SwFlyFrame *pFlyFrame)
const SwPosition * Start() const
const SwNodeIndex * GetContentIdx() const
virtual void InvalidateCursorPos_() override
SwTextNode is a paragraph in the document model.
const SwContentNode * GetNode() const
SwCursor * GetCursor(bool bMakeTableCursor=true) const
Return pointer to the current shell cursor.
general base class for all free-flowing frames
virtual ~SwAccessibleFrameBase() override
#define SAL_WARN_IF(condition, area, stream)
virtual void Dispose(bool bRecursive, bool bCanSkipInvisible=true)
const SwNodes & GetNodes() const
virtual void GetStates(::utl::AccessibleStateSetHelper &rStateSet)
sal_Int32 GetIndex() const
bool IsNoTextFrame() const
const SwPosition * End() const
size_t IsObjSelected() const
css::uno::Reference< css::accessibility::XAccessible > GetWeakParent() const
SwAccessibleMap * GetMap()
constexpr TypedWhichId< SwStringMsgPoolItem > RES_NAME_CHANGED(187)
void SetCursorContext(const ::rtl::Reference< SwAccessibleContext > &rCursorContext)
void AddState(sal_Int16 aState)
void SetName(const OUString &rName)
bool IsFrameSelected() const
virtual void Dispose(bool bRecursive, bool bCanSkipInvisible=true) override
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
bool m_bDetectedRangeSegmentation false