21#include <com/sun/star/drawing/XDrawView.hpp>
22#include <com/sun/star/frame/XController.hpp>
23#include <com/sun/star/document/XShapeEventBroadcaster.hpp>
24#include <com/sun/star/beans/XPropertySet.hpp>
25#include <com/sun/star/accessibility/AccessibleEventId.hpp>
26#include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
27#include <rtl/ustrbuf.hxx>
29#include <com/sun/star/accessibility/AccessibleStateType.hpp>
30#include <com/sun/star/accessibility/AccessibleRole.hpp>
55using ::com::sun::star::uno::Reference;
63 uno::Reference<frame::XController> xController,
64 const uno::Reference<XAccessible>& rxParent)
67 AccessibleRole::DOCUMENT_PRESENTATION :
72 *pSdWindow->GetOutDev())
79 uno::Reference<document::XShapeEventBroadcaster>(
80 mxModel, uno::UNO_QUERY_THROW));
108 uno::Reference<drawing::XShapes> xShapeList;
109 uno::Reference<drawing::XDrawView> xView (
mxController, uno::UNO_QUERY);
111 xShapeList = xView->getCurrentPage();
116 static_cast<awt::XWindowListener*
>(
this));
119 uno::Reference<beans::XPropertySet> xSet (
mxController, uno::UNO_QUERY);
121 xSet->addPropertyChangeListener (
123 static_cast<beans::XPropertyChangeListener*
>(
this));
128 static_cast<awt::XWindowListener*
>(
this));
133 if (pWindow !=
nullptr)
145 (AccessibleRole::EMBEDDED_OBJECT
154 SetState(AccessibleStateType::EDITABLE);
161 switch (rEvent.GetId())
163 case VclEventId::ObjectDying:
167 vcl::Window* pWindow = maShapeTreeInfo.GetWindow();
169 if (pWindow==pDyingWindow && pWindow!=
nullptr && maWindowLink.IsSet())
177 case VclEventId::WindowShow:
182 if (pChildWindow!=
nullptr
184 == AccessibleRole::EMBEDDED_OBJECT))
191 case VclEventId::WindowHide:
197 if (pChildWindow!=
nullptr
199 == AccessibleRole::EMBEDDED_OBJECT))
201 SetAccessibleOLEObject (
nullptr);
219Reference<XAccessible> SAL_CALL
238Reference<XAccessible> SAL_CALL
243 ::osl::MutexGuard aGuard (
m_aMutex);
248 throw lang::IndexOutOfBoundsException (
"no child with index " + OUString::number(
nIndex) );
257uno::Reference<XAccessible > SAL_CALL
259 const awt::Point& aPoint)
263 ::osl::MutexGuard aGuard (
m_aMutex);
264 uno::Reference<XAccessible> xChildAtPosition;
267 for (sal_Int64
i=nChildCount-1;
i>=0; --
i)
272 Reference<XAccessibleComponent> xChildComponent (
273 xChild->getAccessibleContext(), uno::UNO_QUERY);
274 if (xChildComponent.is())
276 awt::Rectangle aBBox (xChildComponent->getBounds());
277 if ( (aPoint.X >= aBBox.X)
278 && (aPoint.Y >= aBBox.Y)
279 && (aPoint.X < aBBox.X+aBBox.Width)
280 && (aPoint.Y < aBBox.Y+aBBox.Height) )
282 xChildAtPosition = xChild;
291 return xChildAtPosition;
294awt::Rectangle SAL_CALL
312 awt::Point aParentPosition;
316 Reference<XAccessibleComponent> xParentComponent (
317 xParent->getAccessibleContext(), uno::UNO_QUERY);
318 if (xParentComponent.is())
319 aParentPosition = xParentComponent->getLocationOnScreen();
322 return awt::Rectangle (
323 aPixelTopLeft.
X() - aParentPosition.X,
324 aPixelTopLeft.
Y() - aParentPosition.Y,
333 awt::Rectangle aBoundingBox (
getBounds());
334 return awt::Point (aBoundingBox.X, aBoundingBox.Y);
343 return awt::Point (aPixelPoint.
X(), aPixelPoint.
Y());
362 return awt::Size (aPixelSize.
X(), aPixelSize.
Y());
370 uno::Any aReturn = AccessibleContextBase::queryInterface (rType);
372 aReturn = ::cppu::queryInterface (rType,
373 static_cast<XAccessibleComponent*
>(
this),
374 static_cast<XAccessibleSelection*
>(
this),
375 static_cast<lang::XEventListener*
>(
376 static_cast<awt::XWindowListener*
>(
this)),
377 static_cast<beans::XPropertyChangeListener*
>(
this),
378 static_cast<awt::XWindowListener*
>(
this),
379 static_cast<awt::XFocusListener*
>(
this)
380 ,
static_cast<XAccessibleExtendedAttributes*
>(
this)
389 AccessibleContextBase::acquire ();
396 AccessibleContextBase::release ();
404 return "AccessibleDocumentViewBase";
407css::uno::Sequence< OUString> SAL_CALL
416css::uno::Sequence< css::uno::Type> SAL_CALL
423 AccessibleContextBase::getTypes(),
447 DBG_ASSERT (pWindow,
"AccessibleDocumentViewBase::disposing");
453 mxWindow->removeWindowListener (
this);
454 mxWindow->removeFocusListener (
this);
461 static_cast<awt::XWindowListener*
>(
this));
466 uno::Reference<beans::XPropertySet> xSet (
mxController, uno::UNO_QUERY);
468 xSet->removePropertyChangeListener (
"",
static_cast<beans::XPropertyChangeListener*
>(
this));
471 static_cast<awt::XWindowListener*
>(
this));
497 if ( ! rEventObject.Source.is())
582 return "AccessibleDocumentViewBase";
596 const Reference <XAccessible>& xOLEObject)
602 AccessibleEventId::CHILD,
609 ::osl::MutexGuard aGuard (
m_aMutex);
616 AccessibleEventId::CHILD,
631uno::Reference< XAccessibleContext >
652 ::osl::MutexGuard aGuard (
m_aMutex);
655 OUStringBuffer sValue;
659 OUString
sName =
"page-name:";
663 sDisplay = pDrViewSh->getCurrentPage()->GetName();
671 + OUString::number(
static_cast<sal_Int32
>(
static_cast<sal_uInt16
>((pDrViewSh->getCurrentPage()->GetPageNum()-1)>>1) + 1))
673 + OUString::number(
static_cast<sal_Int32
>(pDrViewSh->GetPageTabControl().GetPageCount()))
675 if(pDrViewSh->IsLayerModeActive() && pDrViewSh->GetLayerTabControl())
677 sName =
"page-name:";
679 OUString sLayerName(pDrViewSh->GetLayerTabControl()->GetLayerName(pDrViewSh->GetLayerTabControl()->GetCurPageId()) );
680 sDisplay = pDrViewSh->GetLayerTabControl()->GetPageText(pDrViewSh->GetLayerTabControl()->GetCurPageId());
687 const OUString& layerAltText = aSdrLayer->
GetTitle();
688 if (!layerAltText.isEmpty())
702 + OUString::number(
static_cast<sal_Int32
>(pDrViewSh->GetActiveTabLayerIndex()+1))
704 + OUString::number(
static_cast<sal_Int32
>(pDrViewSh->GetLayerTabControl()->GetPageCount()))
710 SdPage* pCurrPge = pPresViewSh->getCurrentPage();
721 sValue.append(
"note:");
725 OUString strNote = rEdit.
GetText(
i);
726 strNote = strNote.replaceFirst(
"\\",
"\\\\" );
727 strNote = strNote.replaceFirst(
"=",
"\\=" );
728 strNote = strNote.replaceFirst(
";",
"\\;" );
729 strNote = strNote.replaceFirst(
",",
"\\," );
730 strNote = strNote.replaceFirst(
":",
"\\:" );
731 sValue.append(strNote
752 + OUString::number(
static_cast<sal_Int32
>(
static_cast<sal_uInt16
>((pCurrPge->
GetPageNum()-1)>>1) + 1))
758 if (sValue.getLength())
759 anyAttribute <<= sValue.makeStringAndClear();
771 ::osl::MutexGuard aGuard (
m_aMutex);
virtual sal_Int32 GetParagraphCount() const=0
virtual OUString GetText(sal_Int32 nPara) const=0
const EditTextObject & GetTextObject() const
constexpr tools::Long Y() const
constexpr tools::Long X() const
SdPage * GetSdPage(sal_uInt16 nPgNum, PageKind ePgKind) const
sal_uInt16 GetSdPageCount(PageKind ePgKind) const
SdrObject * GetPresObj(PresObjKind eObjKind, int nIndex=1, bool bFuzzySearch=false)
returns the nIndex'th object from the given PresObjKind, index starts with 1
const OUString & GetName() const
SdrLayer * GetLayer(sal_uInt16 i)
const OUString & GetTitle() const
const SdrLayerAdmin & GetLayerAdmin() const
virtual OutlinerParaObject * GetOutlinerParaObject() const
sal_uInt16 GetPageNum() const
const svtools::ColorConfig & getColorConfig() const
virtual SfxObjectShell * GetObjectShell() override
static css::uno::Reference< css::awt::XWindow > GetInterface(vcl::Window *pWindow)
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes()
virtual bool SetState(sal_Int64 aState)
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleParent() override
void CommitChange(sal_Int16 aEventId, const css::uno::Any &rNewValue, const css::uno::Any &rOldValue, sal_Int32 nValueIndex)
virtual void SAL_CALL disposing() override
Base class for the various document views of the Draw and Impress applications.
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleParent() override
virtual void SAL_CALL windowShown(const css::lang::EventObject &e) override
virtual sal_Int32 SAL_CALL getBackground() override
virtual void SAL_CALL release() noexcept override
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild(sal_Int64 nIndex) override
This implementation either returns the active accessible OLE object if it exists and the given index ...
virtual void SAL_CALL focusLost(const css::awt::FocusEvent &e) override
virtual void SAL_CALL windowHidden(const css::lang::EventObject &e) override
void SetAccessibleOLEObject(const css::uno::Reference< css::accessibility::XAccessible > &xOLEObject)
Set or remove the currently active accessible OLE object.
virtual css::awt::Rectangle SAL_CALL getBounds() override
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint(const css::awt::Point &aPoint) override
Iterate over all children and test whether the specified point lies within one of their bounding boxe...
virtual css::awt::Size SAL_CALL getSize() override
virtual void SAL_CALL disposing() override
virtual sal_Int32 SAL_CALL getForeground() override
AccessibleDocumentViewBase(::sd::Window *pSdWindow, ::sd::ViewShell *pViewShell, css::uno::Reference< css::frame::XController > xController, const css::uno::Reference< css::accessibility::XAccessible > &rxParent)
Create a new object.
virtual css::awt::Point SAL_CALL getLocation() override
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
virtual sal_Int64 SAL_CALL getAccessibleChildCount() override
This implementation returns either 1 or 0 depending on whether there is an active accessible OLE obje...
virtual void Deactivated()
This method is called when (before or after?) the frame containing this document has been deactivated...
virtual void Activated()
This method is called when (after) the frame containing this document has been activated.
virtual css::uno::Any SAL_CALL getExtendedAttributes() override
virtual bool implIsSelected(sal_Int64 nAccessibleChildIndex) override
virtual void ViewForwarderChanged() override
A view forwarder change is signalled for instance when any of the window events is received.
virtual void SAL_CALL propertyChange(const css::beans::PropertyChangeEvent &rEventObject) override
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType) override
virtual css::uno::Reference< css::accessibility::XAccessibleContext > implGetAccessibleContext() override
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
virtual void implSelect(sal_Int64 nAccessibleChildIndex, bool bSelect) override
::sd::ViewShell * mpViewShell
virtual void Init()
Initialize a new object.
css::uno::Reference< css::awt::XWindow > mxWindow
The API window that is made accessible.
css::uno::Reference< css::frame::XModel > mxModel
Model of the document.
css::uno::Reference< css::frame::XController > mxController
The controller of the window in which this view is displayed.
virtual void SAL_CALL focusGained(const css::awt::FocusEvent &e) override
virtual ::osl::Mutex & implGetMutex() override
Link< VclWindowEvent &, void > maWindowLink
virtual void SAL_CALL windowMoved(const css::awt::WindowEvent &e) override
virtual void impl_dispose()
css::uno::Reference< css::accessibility::XAccessible > mxAccessibleOLEObject
Accessible OLE object.
AccessibleViewForwarder maViewForwarder
The view forwarder passed to the children manager.
virtual OUString SAL_CALL getImplementationName() override
Returns an identifier for the implementation of this object.
virtual css::awt::Point SAL_CALL getLocationOnScreen() override
virtual void SAL_CALL acquire() noexcept override
virtual OUString CreateAccessibleName() override
Create a name string.
virtual void SAL_CALL windowResized(const css::awt::WindowEvent &e) override
AccessibleShapeTreeInfo maShapeTreeInfo
virtual ~AccessibleDocumentViewBase() override
const IAccessibleViewForwarder * GetViewForwarder() const
void SetViewForwarder(const IAccessibleViewForwarder *pViewForwarder)
void SetSdrView(SdrView *pView)
void SetWindow(vcl::Window *pWindow)
void SetModelBroadcaster(const css::uno::Reference< css::document::XShapeEventBroadcaster > &rxModelBroadcaster)
vcl::Window * GetWindow() const
void SetDocumentWindow(const css::uno::Reference< css::accessibility::XAccessibleComponent > &rxViewWindow)
void SetController(const css::uno::Reference< css::frame::XController > &rxController)
virtual Point LogicToPixel(const Point &rPoint) const=0
virtual tools::Rectangle GetVisibleArea() const=0
css::uno::Type const & get()
Base class of the stacked shells that provide graphical views to Draw and Impress documents and editi...
Show a textual overview of the text contents of all slides.
This view shell is responsible for showing the presentation of an Impress document.
Base class of the stacked shell hierarchy.
SdDrawDocument * GetDoc() const
virtual SdPage * GetActualPage()=0
::sd::View * GetView() const
SD_DLLPUBLIC SfxViewFrame * GetViewFrame() const
An SdWindow contains the actual working area of ViewShell.
sal_uInt16 GetAccessibleRole() const
sal_uInt16 GetChildCount() const
void AddChildEventListener(const Link< VclWindowEvent &, void > &rEventListener)
css::uno::Reference< css::accessibility::XAccessible > GetAccessible(bool bCreate=true)
void RemoveChildEventListener(const Link< VclWindowEvent &, void > &rEventListener)
vcl::Window * GetChild(sal_uInt16 nChild) const
constexpr ::Color COL_BLACK(0x00, 0x00, 0x00)
#define DBG_ASSERT(sCon, aError)
#define LINK(Instance, Class, Member)
IMPL_LINK(AccessibleListBoxEntry, WindowEventListener, VclWindowEvent &, rEvent, void)
css::uno::Sequence< T > concatSequences(const css::uno::Sequence< T > &rS1, const Ss &... rSn)
Reference< XController > xController