LibreOffice Module sd (master) 1
AccessibleSlideSorterView.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
22
23#include <SlideSorter.hxx>
31
32#include <ViewShell.hxx>
33#include <ViewShellHint.hxx>
34#include <sdpage.hxx>
35#include <drawdoc.hxx>
36
37#include <sdresid.hxx>
38#include <strings.hrc>
39#include <com/sun/star/accessibility/AccessibleRole.hpp>
40#include <com/sun/star/accessibility/AccessibleEventId.hpp>
41#include <com/sun/star/accessibility/AccessibleStateType.hpp>
42#include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
45#include <o3tl/safeint.hxx>
46#include <rtl/ref.hxx>
47#include <sal/log.hxx>
49
50#include <vcl/settings.hxx>
51#include <vcl/svapp.hxx>
52
53using namespace ::com::sun::star;
54using namespace ::com::sun::star::uno;
55using namespace ::com::sun::star::accessibility;
56
57namespace accessibility {
58
68 : public SfxListener
69{
70public:
72 AccessibleSlideSorterView& rAccessibleSlideSorter,
74 vcl::Window* pWindow);
75 virtual ~Implementation() override;
76
78 void Clear();
79 sal_Int32 GetVisibleChildCount() const;
82
83 void ConnectListeners();
84 void ReleaseListeners();
85 void Notify (SfxBroadcaster& rBroadcaster, const SfxHint& rHint) override;
86 DECL_LINK(WindowEventListener, VclWindowEvent&, void);
87 DECL_LINK(SelectionChangeListener, LinkParamNone*, void);
88 DECL_LINK(BroadcastSelectionChange, void*, void);
89 DECL_LINK(FocusChangeListener, LinkParamNone*, void);
90 DECL_LINK(VisibilityChangeListener, LinkParamNone*, void);
91 DECL_LINK(UpdateChildrenCallback, void*, void);
92
93 void Activated();
94private:
97 typedef ::std::vector<rtl::Reference<AccessibleSlideSorterObject> > PageObjectList;
103 sal_Int32 mnFocusedIndex;
107
108 void UpdateChildren();
109};
110
111//===== AccessibleSlideSorterView =============================================
112
114 ::sd::slidesorter::SlideSorter& rSlideSorter,
115 vcl::Window* pContentWindow)
117 mrSlideSorter(rSlideSorter),
118 mnClientId(0),
119 mpContentWindow(pContentWindow)
120{
121}
122
124{
126}
127
129{
130 Destroyed ();
131}
132
134 short nEventId,
135 const uno::Any& rOldValue,
136 const uno::Any& rNewValue )
137{
138 if (mnClientId != 0)
139 {
140 AccessibleEventObject aEventObject;
141
142 aEventObject.Source = Reference<XWeak>(this);
143 aEventObject.EventId = nEventId;
144 aEventObject.NewValue = rNewValue;
145 aEventObject.OldValue = rOldValue;
146
148 }
149}
150
152{
153 if (mnClientId != 0)
154 {
156 mnClientId = 0;
157 }
158 mpImpl.reset();
159}
160
162 sal_Int32 nIndex)
163{
164 AccessibleSlideSorterObject* pResult = nullptr;
165 ::osl::MutexGuard aGuard (m_aMutex);
166
167 if (nIndex>=0 && nIndex<mpImpl->GetVisibleChildCount())
168 pResult = mpImpl->GetVisibleChild(nIndex);
169
170 return pResult;
171}
172
174{
175 ::osl::MutexGuard aGuard (m_aMutex);
176
177 // Send a disposing to all listeners.
178 if (mnClientId != 0)
179 {
181 mnClientId = 0;
182 }
183}
184
185//===== XAccessible =========================================================
186
187Reference<XAccessibleContext > SAL_CALL
189{
191 return this;
192}
193
194//===== XAccessibleContext ==================================================
195
197{
199 ::osl::MutexGuard aGuard (m_aMutex);
200 return mpImpl->GetVisibleChildCount();
201}
202
203Reference<XAccessible > SAL_CALL
205{
207 ::osl::MutexGuard aGuard (m_aMutex);
208
209 if (nIndex<0 || nIndex>=mpImpl->GetVisibleChildCount())
210 throw lang::IndexOutOfBoundsException();
211
212 return mpImpl->GetVisibleChild(nIndex);
213}
214
215Reference<XAccessible > SAL_CALL AccessibleSlideSorterView::getAccessibleParent()
216{
218 const SolarMutexGuard aSolarGuard;
219 Reference<XAccessible> xParent;
220
221 if (mpContentWindow != nullptr)
222 {
223 vcl::Window* pParent = mpContentWindow->GetAccessibleParentWindow();
224 if (pParent != nullptr)
225 xParent = pParent->GetAccessible();
226 }
227
228 return xParent;
229}
230
232{
233 OSL_ASSERT(getAccessibleParent().is());
235 const SolarMutexGuard aSolarGuard;
236 sal_Int64 nIndexInParent(-1);
237
238 Reference<XAccessibleContext> xParentContext (getAccessibleParent()->getAccessibleContext());
239 if (xParentContext.is())
240 {
241 sal_Int64 nChildCount (xParentContext->getAccessibleChildCount());
242 for (sal_Int64 i=0; i<nChildCount; ++i)
243 if (xParentContext->getAccessibleChild(i).get()
244 == static_cast<XAccessible*>(this))
245 {
246 nIndexInParent = i;
247 break;
248 }
249 }
250
251 return nIndexInParent;
252}
253
255{
257 return AccessibleRole::DOCUMENT;
258}
259
261{
263 SolarMutexGuard aGuard;
264
265 return SdResId(SID_SD_A11Y_I_SLIDEVIEW_D);
266}
267
269{
271 SolarMutexGuard aGuard;
272
273 return SdResId(SID_SD_A11Y_I_SLIDEVIEW_N);
274}
275
276Reference<XAccessibleRelationSet> SAL_CALL
278{
279 return Reference<XAccessibleRelationSet>();
280}
281
283{
285 const SolarMutexGuard aSolarGuard;
286 sal_Int64 nStateSet = 0;
287
288 nStateSet |= AccessibleStateType::FOCUSABLE;
289 nStateSet |= AccessibleStateType::SELECTABLE;
290 nStateSet |= AccessibleStateType::ENABLED;
291 nStateSet |= AccessibleStateType::ACTIVE;
292 nStateSet |= AccessibleStateType::MULTI_SELECTABLE;
293 nStateSet |= AccessibleStateType::OPAQUE;
294 if (mpContentWindow!=nullptr)
295 {
296 if (mpContentWindow->IsVisible())
297 nStateSet |= AccessibleStateType::VISIBLE;
298 if (mpContentWindow->IsReallyVisible())
299 nStateSet |= AccessibleStateType::SHOWING;
300 }
301
302 return nStateSet;
303}
304
306{
308 Reference<XAccessibleContext> xParentContext;
309 Reference<XAccessible> xParent (getAccessibleParent());
310 if (xParent.is())
311 xParentContext = xParent->getAccessibleContext();
312
313 if (xParentContext.is())
314 return xParentContext->getLocale();
315 else
316 // Strange, no parent! Anyway, return the default locale.
318}
319
321 const Reference<XAccessibleEventListener >& rxListener)
322{
323 if (!rxListener.is())
324 return;
325
326 const osl::MutexGuard aGuard(m_aMutex);
327
328 if (rBHelper.bDisposed || rBHelper.bInDispose)
329 {
330 uno::Reference<uno::XInterface> x (static_cast<lang::XComponent *>(this), uno::UNO_QUERY);
331 rxListener->disposing (lang::EventObject (x));
332 }
333 else
334 {
335 if ( ! mnClientId)
338 }
339}
340
342 const Reference<XAccessibleEventListener >& rxListener)
343{
345 if (!rxListener.is())
346 return;
347
348 const osl::MutexGuard aGuard(m_aMutex);
349
350 if (mnClientId == 0)
351 return;
352
354 mnClientId, rxListener );
355 if ( !nListenerCount )
356 {
357 // no listeners anymore -> revoke ourself. This may lead to
358 // the notifier thread dying (if we were the last client),
359 // and at least to us not firing any events anymore, in case
360 // somebody calls NotifyAccessibleEvent, again
362 mnClientId = 0;
363 }
364}
365
366//===== XAccessibleComponent ==================================================
367
368sal_Bool SAL_CALL AccessibleSlideSorterView::containsPoint (const awt::Point& aPoint)
369{
371 const awt::Rectangle aBBox (getBounds());
372 return (aPoint.X >= 0)
373 && (aPoint.X < aBBox.Width)
374 && (aPoint.Y >= 0)
375 && (aPoint.Y < aBBox.Height);
376}
377
378Reference<XAccessible> SAL_CALL
380{
382 Reference<XAccessible> xAccessible;
383 const SolarMutexGuard aSolarGuard;
384
385 const Point aTestPoint (aPoint.X, aPoint.Y);
388 if (pHitDescriptor)
389 xAccessible = mpImpl->GetAccessibleChild(
390 (pHitDescriptor->GetPage()->GetPageNum()-1)/2);
391
392 return xAccessible;
393}
394
396{
398 const SolarMutexGuard aSolarGuard;
399 awt::Rectangle aBBox;
400
401 if (mpContentWindow != nullptr)
402 {
403 const Point aPosition (mpContentWindow->GetPosPixel());
404 const Size aSize (mpContentWindow->GetOutputSizePixel());
405
406 aBBox.X = aPosition.X();
407 aBBox.Y = aPosition.Y();
408 aBBox.Width = aSize.Width();
409 aBBox.Height = aSize.Height();
410 }
411
412 return aBBox;
413}
414
416{
418 awt::Point aLocation;
419
420 if (mpContentWindow != nullptr)
421 {
422 const Point aPosition (mpContentWindow->GetPosPixel());
423 aLocation.X = aPosition.X();
424 aLocation.Y = aPosition.Y();
425 }
426
427 return aLocation;
428}
429
434{
436 const SolarMutexGuard aSolarGuard;
437 awt::Point aParentLocationOnScreen;
438
439 Reference<XAccessible> xParent (getAccessibleParent());
440 if (xParent.is())
441 {
442 Reference<XAccessibleComponent> xParentComponent (
443 xParent->getAccessibleContext(), uno::UNO_QUERY);
444 if (xParentComponent.is())
445 aParentLocationOnScreen = xParentComponent->getLocationOnScreen();
446 }
447
448 awt::Point aLocationOnScreen (getLocation());
449 aLocationOnScreen.X += aParentLocationOnScreen.X;
450 aLocationOnScreen.Y += aParentLocationOnScreen.Y;
451
452 return aLocationOnScreen;
453}
454
456{
458 awt::Size aSize;
459
460 if (mpContentWindow != nullptr)
461 {
462 const Size aOutputSize (mpContentWindow->GetOutputSizePixel());
463 aSize.Width = aOutputSize.Width();
464 aSize.Height = aOutputSize.Height();
465 }
466
467 return aSize;
468}
469
471{
473 const SolarMutexGuard aSolarGuard;
474
475 if (mpContentWindow)
476 mpContentWindow->GrabFocus();
477}
478
480{
482 svtools::ColorConfig aColorConfig;
483 Color nColor = aColorConfig.GetColorValue( svtools::FONTCOLOR ).nColor;
484 return static_cast<sal_Int32>(nColor);
485}
486
488{
491 return sal_Int32(nColor);
492}
493
494//===== XAccessibleSelection ==================================================
495
496void SAL_CALL AccessibleSlideSorterView::selectAccessibleChild (sal_Int64 nChildIndex)
497{
499 const SolarMutexGuard aSolarGuard;
500
501 if (nChildIndex < 0 || nChildIndex >= getAccessibleChildCount())
502 throw lang::IndexOutOfBoundsException();
503
504 AccessibleSlideSorterObject* pChild = mpImpl->GetAccessibleChild(nChildIndex);
505 if (pChild == nullptr)
506 throw lang::IndexOutOfBoundsException();
507
509}
510
512{
514 bool bIsSelected = false;
515 const SolarMutexGuard aSolarGuard;
516
517 if (nChildIndex < 0 || nChildIndex >= getAccessibleChildCount())
518 throw lang::IndexOutOfBoundsException();
519
520 AccessibleSlideSorterObject* pChild = mpImpl->GetAccessibleChild(nChildIndex);
521 if (pChild == nullptr)
522 throw lang::IndexOutOfBoundsException();
523
525 pChild->GetPageNumber());
526
527 return bIsSelected;
528}
529
531{
533 const SolarMutexGuard aSolarGuard;
534
536}
537
539{
541 const SolarMutexGuard aSolarGuard;
542
544}
545
547{
549 const SolarMutexGuard aSolarGuard;
551}
552
553Reference<XAccessible > SAL_CALL
555{
557 const SolarMutexGuard aSolarGuard;
558
559 if (nSelectedChildIndex < 0 || nSelectedChildIndex >= getSelectedAccessibleChildCount())
560 throw lang::IndexOutOfBoundsException();
561
562 Reference<XAccessible> xChild;
563
566 sal_Int32 nPageCount(rSelector.GetPageCount());
567 sal_Int32 nSelectedCount = 0;
568 for (sal_Int32 i=0; i<nPageCount; i++)
569 if (rSelector.IsPageSelected(i))
570 {
571 if (nSelectedCount == nSelectedChildIndex)
572 {
573 xChild = mpImpl->GetAccessibleChild(i);
574 break;
575 }
576 ++nSelectedCount;
577 }
578
579 if ( ! xChild.is() )
580 throw lang::IndexOutOfBoundsException();
581
582 return xChild;
583}
584
585void SAL_CALL AccessibleSlideSorterView::deselectAccessibleChild (sal_Int64 nChildIndex)
586{
588 const SolarMutexGuard aSolarGuard;
589
590 if (nChildIndex < 0 || nChildIndex >= getAccessibleChildCount())
591 throw lang::IndexOutOfBoundsException();
592
593 AccessibleSlideSorterObject* pChild = mpImpl->GetAccessibleChild(nChildIndex);
594 if (pChild == nullptr)
595 throw lang::IndexOutOfBoundsException();
596
598}
599
600// XServiceInfo
601OUString SAL_CALL
603{
604 return "AccessibleSlideSorterView";
605}
606
607sal_Bool SAL_CALL AccessibleSlideSorterView::supportsService (const OUString& sServiceName)
608{
610}
611
612uno::Sequence< OUString> SAL_CALL
614{
616
617 return uno::Sequence<OUString> {
618 OUString("com.sun.star.accessibility.Accessible"),
619 OUString("com.sun.star.accessibility.AccessibleContext"),
620 OUString("com.sun.star.drawing.AccessibleSlideSorterView")
621 };
622}
623
625{
626 if (rBHelper.bDisposed || rBHelper.bInDispose)
627 {
628 SAL_WARN("sd", "Calling disposed object. Throwing exception:");
629 throw lang::DisposedException ("object has been already disposed",
630 static_cast<uno::XWeak*>(this));
631 }
632}
633
634//===== AccessibleSlideSorterView::Implementation =============================
635
637 AccessibleSlideSorterView& rAccessibleSlideSorter,
638 ::sd::slidesorter::SlideSorter& rSlideSorter,
639 vcl::Window* pWindow)
640 : mrAccessibleSlideSorter(rAccessibleSlideSorter),
641 mrSlideSorter(rSlideSorter),
642 mnFirstVisibleChild(0),
643 mnLastVisibleChild(-1),
644 mbListeningToDocument(false),
645 mpWindow(pWindow),
646 mnFocusedIndex(-1),
647 mbModelChangeLocked(false),
648 mnUpdateChildrenUserEventId(nullptr),
649 mnSelectionChangeUserEventId(nullptr)
650{
653}
654
656{
657 if (mnUpdateChildrenUserEventId != nullptr)
658 Application::RemoveUserEvent(mnUpdateChildrenUserEventId);
659 if (mnSelectionChangeUserEventId != nullptr)
660 Application::RemoveUserEvent(mnSelectionChangeUserEventId);
661 ReleaseListeners();
662 Clear();
663}
664
666{
667 if (mnUpdateChildrenUserEventId == nullptr)
668 mnUpdateChildrenUserEventId = Application::PostUserEvent(
670 UpdateChildrenCallback));
671}
672
674{
675 //By default, all children should be accessible. So here workaround is to make all children visible.
676 // MT: This was in UpdateVisibility, which has some similarity, and hg merge automatically has put it here. Correct?!
677 // In the IA2 CWS, also setting mnFirst/LastVisibleChild was commented out!
678 mnLastVisibleChild = maPageObjects.size();
679
680 if (mbModelChangeLocked)
681 {
682 // Do nothing right now. When the flag is reset, this method is
683 // called again.
684 return;
685 }
686
688 mnFirstVisibleChild = aRange.Min();
689 mnLastVisibleChild = aRange.Max();
690
691 // Release all children.
692 Clear();
693
694 // Create new children for the modified visible range.
695 maPageObjects.resize(mrSlideSorter.GetModel().GetPageCount());
696
697 // No Visible children
698 if (mnFirstVisibleChild == -1 && mnLastVisibleChild == -1)
699 return;
700
701 for (sal_Int32 nIndex(mnFirstVisibleChild); nIndex<=mnLastVisibleChild; ++nIndex)
702 GetAccessibleChild(nIndex);
703}
704
706{
707 for (auto& rxPageObject : maPageObjects)
708 if (rxPageObject != nullptr)
709 {
710 mrAccessibleSlideSorter.FireAccessibleEvent(
711 AccessibleEventId::CHILD,
712 Any(Reference<XAccessible>(rxPageObject)),
713 Any());
714
715 Reference<XComponent> xComponent (Reference<XWeak>(rxPageObject), UNO_QUERY);
716 if (xComponent.is())
717 xComponent->dispose();
718 rxPageObject = nullptr;
719 }
720 maPageObjects.clear();
721}
722
724{
725 if (mnFirstVisibleChild<=mnLastVisibleChild && mnFirstVisibleChild>=0)
726 return mnLastVisibleChild - mnFirstVisibleChild + 1;
727 else
728 return 0;
729}
730
732 sal_Int32 nIndex)
733{
734 assert(nIndex>=0 && nIndex<GetVisibleChildCount());
735
736 return GetAccessibleChild(nIndex+mnFirstVisibleChild);
737}
738
740 sal_Int32 nIndex)
741{
742 AccessibleSlideSorterObject* pChild = nullptr;
743
744 if (nIndex>=0 && o3tl::make_unsigned(nIndex)<maPageObjects.size())
745 {
746 if (maPageObjects[nIndex] == nullptr)
747 {
750 if (pDescriptor)
751 {
752 maPageObjects[nIndex] = new AccessibleSlideSorterObject(
753 &mrAccessibleSlideSorter,
755 (pDescriptor->GetPage()->GetPageNum()-1)/2);
756
757 mrAccessibleSlideSorter.FireAccessibleEvent(
758 AccessibleEventId::CHILD,
759 Any(),
760 Any(Reference<XAccessible>(maPageObjects[nIndex])));
761 }
762
763 }
764
765 pChild = maPageObjects[nIndex].get();
766 }
767 else
768 {
769 OSL_ASSERT(nIndex>=0 && o3tl::make_unsigned(nIndex)<maPageObjects.size());
770 }
771
772 return pChild;
773}
774
776{
778 if (mrSlideSorter.GetViewShell() != nullptr)
780 mbListeningToDocument = true;
781
782 if (mpWindow != nullptr)
783 mpWindow->AddEventListener(
784 LINK(this,AccessibleSlideSorterView::Implementation,WindowEventListener));
785
786 mrSlideSorter.GetController().GetSelectionManager()->AddSelectionChangeListener(
787 LINK(this,AccessibleSlideSorterView::Implementation,SelectionChangeListener));
789 LINK(this,AccessibleSlideSorterView::Implementation,FocusChangeListener));
791 LINK(this,AccessibleSlideSorterView::Implementation,VisibilityChangeListener));
792}
793
795{
797 LINK(this,AccessibleSlideSorterView::Implementation,FocusChangeListener));
798 mrSlideSorter.GetController().GetSelectionManager()->RemoveSelectionChangeListener(
799 LINK(this,AccessibleSlideSorterView::Implementation,SelectionChangeListener));
801 LINK(this,AccessibleSlideSorterView::Implementation,VisibilityChangeListener));
802
803 if (mpWindow != nullptr)
804 mpWindow->RemoveEventListener(
805 LINK(this,AccessibleSlideSorterView::Implementation,WindowEventListener));
806
807 if (mbListeningToDocument)
808 {
809 if (mrSlideSorter.GetViewShell() != nullptr && !IsListening(*mrSlideSorter.GetViewShell()))
810 { // ??? is it even possible that ConnectListeners is called with no
811 // view shell and this one with a view shell?
813 }
814 EndListening (*mrSlideSorter.GetModel().GetDocument());
815 mbListeningToDocument = false;
816 }
817}
818
821 const SfxHint& rHint)
822{
823 if (rHint.GetId() == SfxHintId::ThisIsAnSdrHint)
824 {
825 const SdrHint* pSdrHint = static_cast<const SdrHint*>(&rHint);
826 switch (pSdrHint->GetKind())
827 {
828 case SdrHintKind::PageOrderChange:
829 RequestUpdateChildren();
830 break;
831 default:
832 break;
833 }
834 }
835 else if (auto pViewShellHint = dynamic_cast<const sd::ViewShellHint*>(&rHint))
836 {
837 switch (pViewShellHint->GetHintId())
838 {
840 mbModelChangeLocked = true;
841 break;
842
844 mbModelChangeLocked = false;
845 RequestUpdateChildren();
846 break;
847 default:
848 break;
849 }
850 }
851}
852
854{
855 // Firstly, set focus to view
856 FireAccessibleEvent(AccessibleEventId::STATE_CHANGED,
857 Any(),
858 Any(AccessibleStateType::FOCUSED));
859
860 mpImpl->Activated();
861}
862
864{
866
867}
868
870{
871 switch (rEvent.GetId())
872 {
873 case VclEventId::WindowMove:
874 case VclEventId::WindowResize:
875 RequestUpdateChildren();
876 break;
877
878 case VclEventId::WindowGetFocus:
879 case VclEventId::WindowLoseFocus:
880 mrAccessibleSlideSorter.FireAccessibleEvent(
881 AccessibleEventId::SELECTION_CHANGED,
882 Any(),
883 Any());
884 break;
885 default:
886 break;
887 }
888}
889
891{
892 if (mnSelectionChangeUserEventId == nullptr)
893 mnSelectionChangeUserEventId = Application::PostUserEvent(
894 LINK(this, AccessibleSlideSorterView::Implementation, BroadcastSelectionChange));
895}
896
897IMPL_LINK_NOARG(AccessibleSlideSorterView::Implementation, BroadcastSelectionChange, void*, void)
898{
899 mnSelectionChangeUserEventId = nullptr;
900 mrAccessibleSlideSorter.FireAccessibleEvent(
901 AccessibleEventId::SELECTION_CHANGED,
902 Any(),
903 Any());
904}
905
907{
908 sal_Int32 nNewFocusedIndex (
910
912 if (!bHasFocus)
913 nNewFocusedIndex = -1;
914
915 // add a checker whether the focus event is sent out. Only after sent, the mnFocusedIndex should be updated.
916 bool bSentFocus = false;
917 if (nNewFocusedIndex == mnFocusedIndex)
918 return;
919
920 if (mnFocusedIndex >= 0)
921 {
922 AccessibleSlideSorterObject* pObject = GetAccessibleChild(mnFocusedIndex);
923 if (pObject != nullptr)
924 {
925 pObject->FireAccessibleEvent(
926 AccessibleEventId::STATE_CHANGED,
927 Any(AccessibleStateType::FOCUSED),
928 Any());
929 bSentFocus = true;
930 }
931 }
932 if (nNewFocusedIndex >= 0)
933 {
934 AccessibleSlideSorterObject* pObject = GetAccessibleChild(nNewFocusedIndex);
935 if (pObject != nullptr)
936 {
937 pObject->FireAccessibleEvent(
938 AccessibleEventId::STATE_CHANGED,
939 Any(),
940 Any(AccessibleStateType::FOCUSED));
941 bSentFocus = true;
942 }
943 }
944 if (bSentFocus)
945 mnFocusedIndex = nNewFocusedIndex;
946}
947
949{
950 mnUpdateChildrenUserEventId = nullptr;
951 UpdateChildren();
952}
953
955{
956 UpdateChildren();
957}
958
959} // end of namespace ::accessibility
960
961/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SlideSorter & mrSlideSorter
constexpr OUStringLiteral sServiceName
const LanguageTag & GetLanguageTag() const
const StyleSettings & GetStyleSettings() const
static const AllSettings & GetSettings()
static ImplSVEvent * PostUserEvent(const Link< void *, void > &rLink, void *pCaller=nullptr, bool bReferenceLink=false)
static void RemoveUserEvent(ImplSVEvent *nUserEvent)
const css::lang::Locale & getLocale(bool bResolveSystem=true) const
constexpr tools::Long Y() const
constexpr tools::Long X() const
tools::Long Max() const
tools::Long Min() const
SdrHintKind GetKind() const
SfxHintId GetId() const
constexpr tools::Long Height() const
constexpr tools::Long Width() const
const Color & GetWindowColor() const
This class makes page objects of the slide sorter accessible.
sal_uInt16 GetPageNumber() const
The page number as given to the constructor.
Inner implementation class of the AccessibleSlideSorterView.
Implementation(AccessibleSlideSorterView &rAccessibleSlideSorter, ::sd::slidesorter::SlideSorter &rSlideSorter, vcl::Window *pWindow)
DECL_LINK(FocusChangeListener, LinkParamNone *, void)
DECL_LINK(UpdateChildrenCallback, void *, void)
DECL_LINK(VisibilityChangeListener, LinkParamNone *, void)
DECL_LINK(SelectionChangeListener, LinkParamNone *, void)
AccessibleSlideSorterObject * GetVisibleChild(sal_Int32 nIndex)
::std::vector< rtl::Reference< AccessibleSlideSorterObject > > PageObjectList
DECL_LINK(WindowEventListener, VclWindowEvent &, void)
DECL_LINK(BroadcastSelectionChange, void *, void)
void Notify(SfxBroadcaster &rBroadcaster, const SfxHint &rHint) override
AccessibleSlideSorterObject * GetAccessibleChild(sal_Int32 nIndex)
This class makes the SlideSorterViewShell accessible.
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild(sal_Int64 nIndex) override
Return the specified child or throw exception.
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getSelectedAccessibleChild(sal_Int64 nSelectedChildIndex) override
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleParent() override
Return a reference to the parent.
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint(const css::awt::Point &aPoint) override
The default implementation returns an empty reference.
virtual css::lang::Locale SAL_CALL getLocale() override
Return the parents locale or throw exception if this object has no parent yet/anymore.
virtual sal_Bool SAL_CALL isAccessibleChildSelected(sal_Int64 nChildIndex) override
virtual void SAL_CALL deselectAccessibleChild(sal_Int64 nSelectedChildIndex) override
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Returns a list of all supported services.
virtual css::uno::Reference< css::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet() override
Return NULL to indicate that an empty relation set.
void ThrowIfDisposed()
Check whether or not the object has been disposed (or is in the state of being disposed).
virtual sal_Bool SAL_CALL containsPoint(const css::awt::Point &aPoint) override
The default implementation uses the result of <member>getBounds</member> to determine whether the giv...
virtual sal_Int16 SAL_CALL getAccessibleRole() override
Return this object's role.
::std::unique_ptr< Implementation > mpImpl
virtual OUString SAL_CALL getImplementationName() override
Returns an identifier for the implementation of this object.
virtual OUString SAL_CALL getAccessibleDescription() override
Return this object's description.
virtual css::awt::Point SAL_CALL getLocationOnScreen() override
The default implementation returns an empty position, i.e.
virtual css::awt::Point SAL_CALL getLocation() override
The default implementation uses the result of <member>getBounds</member> to determine the location.
virtual sal_Int64 SAL_CALL getSelectedAccessibleChildCount() override
virtual sal_Int64 SAL_CALL getAccessibleChildCount() override
Return the number of currently visible children.
virtual void SAL_CALL selectAllAccessibleChildren() override
virtual sal_Int64 SAL_CALL getAccessibleStateSet() override
Return the set of current states.
virtual css::uno::Reference< css::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext() override
virtual void SAL_CALL selectAccessibleChild(sal_Int64 nChildIndex) override
virtual css::awt::Rectangle SAL_CALL getBounds() override
The default implementation returns an empty rectangle.
virtual sal_Int64 SAL_CALL getAccessibleIndexInParent() override
Return this objects index among the parents children.
virtual sal_Int32 SAL_CALL getForeground() override
Returns black as the default foreground color.
virtual sal_Bool SAL_CALL supportsService(const OUString &sServiceName) override
Return whether the specified service is supported by this class.
void FireAccessibleEvent(short nEventId, const css::uno::Any &rOldValue, const css::uno::Any &rNewValue)
virtual OUString SAL_CALL getAccessibleName() override
Return the object's current name.
virtual void SAL_CALL grabFocus() override
The default implementation does nothing.
AccessibleSlideSorterObject * GetAccessibleChildImplementation(sal_Int32 nIndex)
Return the implementation object of the specified child.
AccessibleSlideSorterView(::sd::slidesorter::SlideSorter &rSlideSorter, vcl::Window *pParentWindow)
virtual void SAL_CALL removeAccessibleEventListener(const css::uno::Reference< css::accessibility::XAccessibleEventListener > &rxListener) override
virtual css::awt::Size SAL_CALL getSize() override
The default implementation uses the result of <member>getBounds</member> to determine the size.
void Destroyed()
This method acts like a dispose call.
virtual void SAL_CALL addAccessibleEventListener(const css::uno::Reference< css::accessibility::XAccessibleEventListener > &rxListener) override
virtual sal_Int32 SAL_CALL getBackground() override
Returns white as the default background color.
virtual void SAL_CALL clearAccessibleSelection() override
static sal_Int32 addEventListener(const TClientId _nClient, const css::uno::Reference< css::accessibility::XAccessibleEventListener > &_rxListener)
static void addEvent(const TClientId _nClient, const css::accessibility::AccessibleEventObject &_rEvent)
static sal_Int32 removeEventListener(const TClientId _nClient, const css::uno::Reference< css::accessibility::XAccessibleEventListener > &_rxListener)
static void revokeClient(const TClientId _nClient)
static void revokeClientNotifyDisposing(const TClientId _nClient, const css::uno::Reference< css::uno::XInterface > &_rxEventSource)
mutable::osl::Mutex m_aMutex
Local derivation of the SfxHint class that defines some hint ids that are used by the ViewShell class...
Show previews for all the slides in a document and allow the user to insert or delete slides and modi...
Definition: SlideSorter.hxx:62
SD_DLLPUBLIC controller::SlideSorterController & GetController() const
ViewShell * GetViewShell() const
Return the view shell that was given at construction.
model::SlideSorterModel & GetModel() const
view::SlideSorterView & GetView() const
void RemoveFocusChangeListener(const Link< LinkParamNone *, void > &rListener)
Remove a focus change listener.
void ShowFocus(const bool bScrollToFocus=true)
Show the focus indicator of the current slide.
void AddFocusChangeListener(const Link< LinkParamNone *, void > &rListener)
Add a listener that is called when the focus is shown or hidden or set to another page object.
bool IsFocusShowing() const
Return <TRUE> when the focus indicator is currently shown.
sal_Int32 GetFocusedPageIndex() const
Return the index of the page that currently has the focus as it is accepted by the slide sorter model...
A sub-controller that handles page selection of the slide browser.
void DeselectPage(int nPageIndex)
Deselect the descriptor that is associated with the given page.
SD_DLLPUBLIC bool IsPageSelected(int nPageIndex)
Return whether the specified page is selected.
int GetPageCount() const
This convenience method returns the same number of pages that SlideSorterModel.GetPageCount() returns...
void SelectPage(int nPageIndex)
Select the specified descriptor.
model::SharedPageDescriptor GetPageAt(const Point &rPixelPosition)
Return the descriptor of the page that is rendered under the given position.
std::shared_ptr< SelectionManager > const & GetSelectionManager() const
SdDrawDocument * GetDocument()
This method is present to let the view create a ShowView for displaying slides.
sal_Int32 GetPageCount() const
Return the number of slides in the document regardless of whether they are visible or not or whether ...
SharedPageDescriptor GetPageDescriptor(const sal_Int32 nPageIndex, const bool bCreate=true) const
Return a page descriptor for the page with the specified index.
void RemoveVisibilityChangeListener(const Link< LinkParamNone *, void > &rListener)
Remove a listener that is called when the set of visible slides changes.
Range const & GetVisiblePageRange()
Return the range of currently visible page objects including the first and last one in that range.
void AddVisibilityChangeListener(const Link< LinkParamNone *, void > &rListener)
Add a shape to the page.
ColorConfigValue GetColorValue(ColorConfigEntry eEntry, bool bSmart=true) const
css::uno::Reference< css::accessibility::XAccessible > GetAccessible(bool bCreate=true)
float x
EmbeddedObjectRef * pObject
std::mutex m_aMutex
sal_Int32 nIndex
#define SAL_WARN(area, stream)
void Clear(EHistoryType eHistory)
::cppu::WeakComponentImplHelper< css::accessibility::XAccessible, css::accessibility::XAccessibleEventBroadcaster, css::accessibility::XAccessibleContext, css::accessibility::XAccessibleComponent, css::accessibility::XAccessibleSelection, css::lang::XServiceInfo > AccessibleSlideSorterViewBase
IMPL_LINK(AccessibleListBoxEntry, WindowEventListener, VclWindowEvent &, rEvent, void)
IMPL_LINK_NOARG(AccessibleSlideSorterView::Implementation, SelectionChangeListener, LinkParamNone *, void)
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
int i
constexpr std::enable_if_t< std::is_signed_v< T >, std::make_unsigned_t< T > > make_unsigned(T value)
std::shared_ptr< PageDescriptor > SharedPageDescriptor
OUString SdResId(TranslateId aId)
Definition: sdmod.cxx:83
unsigned char sal_Bool
@ VISIBLE
Definition: unolayer.hxx:37
VclPtr< vcl::Window > mpWindow