1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #include <com/sun/star/accessibility/AccessibleRole.hpp>
21 #include <com/sun/star/accessibility/AccessibleEventId.hpp>
22 #include <com/sun/star/accessibility/AccessibleStateType.hpp>
23 #include <com/sun/star/lang/DisposedException.hpp>
24 #include <com/sun/star/beans/PropertyChangeEvent.hpp>
25 #include <com/sun/star/awt/XWindow.hpp>
26 #include <unotools/accessiblestatesethelper.hxx>
27 #include <cppuhelper/supportsservice.hxx>
28 #include <cppuhelper/typeprovider.hxx>
29 #include <toolkit/helper/vclunohelper.hxx>
30 #include <vcl/svapp.hxx>
31 #include <vcl/settings.hxx>
32 #include <osl/mutex.hxx>
33 #include <tools/gen.hxx>
34 #include <svl/smplhint.hxx>
35 #include <toolkit/helper/convert.hxx>
36 #include <svtools/colorcfg.hxx>
37 #include <comphelper/accessibleeventnotifier.hxx>
38 #include <svx/sdrpaintwindow.hxx>
40 #include <svx/ShapeTypeHandler.hxx>
41 #include <svx/AccessibleShapeInfo.hxx>
42 #include "GraphCtlAccessibleContext.hxx"
43 #include <svx/graphctl.hxx>
44 #include <svx/dialogs.hrc>
45 #include "accessibility.hrc"
46 #include <svx/svdpage.hxx>
47 #include <svx/unomod.hxx>
48 #include <svx/dialmgr.hxx>
49 #include <svx/svdetc.hxx>
50 #include <svx/sdrhittesthelper.hxx>
53 using namespace ::cppu
;
54 using namespace ::osl
;
55 using namespace ::accessibility
;
56 using namespace ::com::sun::star
;
57 using namespace ::com::sun::star::uno
;
58 using namespace ::com::sun::star::drawing
;
59 using namespace ::com::sun::star::lang
;
60 using namespace ::com::sun::star::accessibility
;
63 /** initialize this component and set default values */
64 SvxGraphCtrlAccessibleContext::SvxGraphCtrlAccessibleContext(
65 const Reference
< XAccessible
>& rxParent
,
67 const OUString
* pName
,
68 const OUString
* pDesc
) :
70 SvxGraphCtrlAccessibleContext_Base( m_aMutex
),
79 if (mpControl
!= nullptr)
81 mpModel
= mpControl
->GetSdrModel();
83 mpPage
= mpModel
->GetPage( 0 );
84 mpView
= mpControl
->GetSdrView();
86 if( mpModel
== NULL
|| mpPage
== NULL
|| mpView
== NULL
)
89 // Set all the pointers to NULL just in case they are used as
103 ::SolarMutexGuard aSolarGuard
;
104 msName
= SVX_RESSTR( RID_SVXSTR_GRAPHCTRL_ACC_NAME
);
109 msDescription
= *pDesc
;
113 ::SolarMutexGuard aSolarGuard
;
114 msDescription
= SVX_RESSTR( RID_SVXSTR_GRAPHCTRL_ACC_DESCRIPTION
);
117 maTreeInfo
.SetSdrView( mpView
);
118 maTreeInfo
.SetWindow( mpControl
);
119 maTreeInfo
.SetViewForwarder( this );
124 /** on destruction, this component is disposed and all dispose listeners
125 are called, except if this component was already disposed */
126 SvxGraphCtrlAccessibleContext::~SvxGraphCtrlAccessibleContext()
133 /** returns the XAccessible interface for a given SdrObject.
134 Multiple calls for the same SdrObject return the same XAccessible.
136 Reference
< XAccessible
> SAL_CALL
SvxGraphCtrlAccessibleContext::getAccessible( const SdrObject
* pObj
)
138 Reference
<XAccessible
> xAccessibleShape
;
142 // see if we already created an XAccessible for the given SdrObject
143 ShapesMapType::iterator iter
= mxShapes
.find( pObj
);
145 if( iter
!= mxShapes
.end() )
147 // if we already have one, return it
148 xAccessibleShape
= (*iter
).second
;
152 // create a new one and remember in our internal map
153 Reference
< XShape
> xShape( Reference
< XShape
>::query( (const_cast<SdrObject
*>(pObj
))->getUnoShape() ) );
155 AccessibleShapeInfo
aShapeInfo (xShape
,mxParent
);
156 // Create accessible object that corresponds to the descriptor's shape.
157 AccessibleShape
* pAcc
= ShapeTypeHandler::Instance().CreateAccessibleObject(
158 aShapeInfo
, maTreeInfo
);
159 xAccessibleShape
= pAcc
;
163 // Now that we acquired the new accessible shape we can
164 // safely call its Init() method.
167 mxShapes
[pObj
] = pAcc
;
169 // Create event and inform listeners of the object creation.
170 CommitChange( AccessibleEventId::CHILD
, makeAny( xAccessibleShape
), makeAny( Reference
<XAccessible
>() ) );
174 return xAccessibleShape
;
178 Reference
< XAccessibleContext
> SAL_CALL
SvxGraphCtrlAccessibleContext::getAccessibleContext() throw( RuntimeException
, std::exception
)
183 // XAccessibleComponent
184 sal_Bool SAL_CALL
SvxGraphCtrlAccessibleContext::containsPoint( const awt::Point
& rPoint
) throw( RuntimeException
, std::exception
)
186 // no guard -> done in getSize()
187 awt::Size
aSize (getSize());
188 return (rPoint
.X
>= 0)
189 && (rPoint
.X
< aSize
.Width
)
191 && (rPoint
.Y
< aSize
.Height
);
196 Reference
< XAccessible
> SAL_CALL
SvxGraphCtrlAccessibleContext::getAccessibleAtPoint( const awt::Point
& rPoint
) throw( RuntimeException
, std::exception
)
198 ::osl::MutexGuard
aGuard( m_aMutex
);
200 Reference
< XAccessible
> xAccessible
;
204 Point
aPnt( rPoint
.X
, rPoint
.Y
);
205 mpControl
->PixelToLogic( aPnt
);
209 if(mpView
&& mpView
->GetSdrPageView())
211 pObj
= SdrObjListPrimitiveHit(*mpPage
, aPnt
, 1, *mpView
->GetSdrPageView(), 0, false);
215 xAccessible
= getAccessible( pObj
);
219 throw DisposedException();
227 awt::Rectangle SAL_CALL
SvxGraphCtrlAccessibleContext::getBounds() throw( RuntimeException
, std::exception
)
229 // no guard -> done in GetBoundingBox()
230 Rectangle
aCoreBounds( GetBoundingBox() );
231 awt::Rectangle aBounds
;
232 aBounds
.X
= aCoreBounds
.getX();
233 aBounds
.Y
= aCoreBounds
.getY();
234 aBounds
.Width
= aCoreBounds
.getWidth();
235 aBounds
.Height
= aCoreBounds
.getHeight();
241 awt::Point SAL_CALL
SvxGraphCtrlAccessibleContext::getLocation() throw( RuntimeException
, std::exception
)
243 // no guard -> done in GetBoundingBox()
244 Rectangle
aRect( GetBoundingBox() );
245 return awt::Point( aRect
.getX(), aRect
.getY() );
250 awt::Point SAL_CALL
SvxGraphCtrlAccessibleContext::getLocationOnScreen() throw( RuntimeException
, std::exception
)
252 // no guard -> done in GetBoundingBoxOnScreen()
253 Rectangle
aRect( GetBoundingBoxOnScreen() );
254 return awt::Point( aRect
.getX(), aRect
.getY() );
259 awt::Size SAL_CALL
SvxGraphCtrlAccessibleContext::getSize() throw( RuntimeException
, std::exception
)
261 // no guard -> done in GetBoundingBox()
262 Rectangle
aRect( GetBoundingBox() );
263 return awt::Size( aRect
.getWidth(), aRect
.getHeight() );
266 // XAccessibleContext
267 sal_Int32 SAL_CALL
SvxGraphCtrlAccessibleContext::getAccessibleChildCount() throw( RuntimeException
, std::exception
)
269 ::SolarMutexGuard aGuard
;
272 throw DisposedException();
274 return mpPage
->GetObjCount();
279 /** returns the SdrObject at index nIndex from the model of this graph */
280 SdrObject
* SvxGraphCtrlAccessibleContext::getSdrObject( sal_Int32 nIndex
)
281 throw( RuntimeException
, lang::IndexOutOfBoundsException
)
283 ::SolarMutexGuard aGuard
;
286 throw DisposedException();
288 if( (nIndex
< 0) || ( static_cast<size_t>(nIndex
) >= mpPage
->GetObjCount() ) )
289 throw lang::IndexOutOfBoundsException();
291 return mpPage
->GetObj( nIndex
);
296 /** sends an AccessibleEventObject to all added XAccessibleEventListeners */
297 void SvxGraphCtrlAccessibleContext::CommitChange (
299 const uno::Any
& rNewValue
,
300 const uno::Any
& rOldValue
)
302 AccessibleEventObject
aEvent (
303 static_cast<uno::XWeak
*>(this),
311 /** sends an AccessibleEventObject to all added XAccessibleEventListeners */
312 void SvxGraphCtrlAccessibleContext::FireEvent (const AccessibleEventObject
& aEvent
)
315 comphelper::AccessibleEventNotifier::addEvent( mnClientId
, aEvent
);
320 Reference
< XAccessible
> SAL_CALL
SvxGraphCtrlAccessibleContext::getAccessibleChild( sal_Int32 nIndex
)
321 throw( RuntimeException
, lang::IndexOutOfBoundsException
, std::exception
)
323 ::SolarMutexGuard aGuard
;
325 return getAccessible( getSdrObject( nIndex
) );
330 Reference
< XAccessible
> SAL_CALL
SvxGraphCtrlAccessibleContext::getAccessibleParent() throw( RuntimeException
, std::exception
)
337 sal_Int32 SAL_CALL
SvxGraphCtrlAccessibleContext::getAccessibleIndexInParent() throw( RuntimeException
, std::exception
)
339 ::SolarMutexGuard aGuard
;
340 // Use a simple but slow solution for now. Optimize later.
342 // Iterate over all the parent's children and search for this object.
345 Reference
< XAccessibleContext
> xParentContext( mxParent
->getAccessibleContext() );
346 if( xParentContext
.is() )
348 sal_Int32 nChildCount
= xParentContext
->getAccessibleChildCount();
349 for( sal_Int32 i
= 0 ; i
< nChildCount
; ++i
)
351 Reference
< XAccessible
> xChild( xParentContext
->getAccessibleChild( i
) );
354 Reference
< XAccessibleContext
> xChildContext
= xChild
->getAccessibleContext();
355 if( xChildContext
== ( XAccessibleContext
* ) this )
362 // Return -1 to indicate that this object's parent does not know about the
369 sal_Int16 SAL_CALL
SvxGraphCtrlAccessibleContext::getAccessibleRole() throw( RuntimeException
, std::exception
)
371 return AccessibleRole::PANEL
;
376 OUString SAL_CALL
SvxGraphCtrlAccessibleContext::getAccessibleDescription() throw( RuntimeException
, std::exception
)
378 ::SolarMutexGuard aGuard
;
379 return msDescription
;
384 OUString SAL_CALL
SvxGraphCtrlAccessibleContext::getAccessibleName() throw( RuntimeException
, std::exception
)
386 ::SolarMutexGuard aGuard
;
392 /** Return empty reference to indicate that the relation set is not
395 Reference
< XAccessibleRelationSet
> SAL_CALL
SvxGraphCtrlAccessibleContext::getAccessibleRelationSet() throw( RuntimeException
, std::exception
)
397 return Reference
< XAccessibleRelationSet
>();
402 Reference
< XAccessibleStateSet
> SAL_CALL
SvxGraphCtrlAccessibleContext::getAccessibleStateSet() throw( RuntimeException
, std::exception
)
404 ::SolarMutexGuard aGuard
;
406 utl::AccessibleStateSetHelper
* pStateSetHelper
= new utl::AccessibleStateSetHelper
;
408 if ( rBHelper
.bDisposed
|| mbDisposed
)
410 pStateSetHelper
->AddState( AccessibleStateType::DEFUNC
);
414 pStateSetHelper
->AddState( AccessibleStateType::FOCUSABLE
);
415 if( mpControl
->HasFocus() )
416 pStateSetHelper
->AddState( AccessibleStateType::FOCUSED
);
417 pStateSetHelper
->AddState( AccessibleStateType::OPAQUE
);
418 pStateSetHelper
->AddState( AccessibleStateType::SHOWING
);
419 pStateSetHelper
->AddState( AccessibleStateType::VISIBLE
);
422 return pStateSetHelper
;
427 lang::Locale SAL_CALL
SvxGraphCtrlAccessibleContext::getLocale() throw( IllegalAccessibleComponentStateException
, RuntimeException
, std::exception
)
429 ::SolarMutexGuard aGuard
;
433 Reference
< XAccessibleContext
> xParentContext( mxParent
->getAccessibleContext() );
434 if( xParentContext
.is() )
435 return xParentContext
->getLocale();
438 // No parent. Therefore throw exception to indicate this cluelessness.
439 throw IllegalAccessibleComponentStateException();
442 // XAccessibleEventListener
443 void SAL_CALL
SvxGraphCtrlAccessibleContext::addAccessibleEventListener( const Reference
< XAccessibleEventListener
>& xListener
)
444 throw( RuntimeException
, std::exception
)
448 ::SolarMutexGuard aGuard
;
450 mnClientId
= comphelper::AccessibleEventNotifier::registerClient( );
451 comphelper::AccessibleEventNotifier::addEventListener( mnClientId
, xListener
);
457 void SAL_CALL
SvxGraphCtrlAccessibleContext::removeAccessibleEventListener( const Reference
< XAccessibleEventListener
>& xListener
)
458 throw( RuntimeException
, std::exception
)
462 ::SolarMutexGuard aGuard
;
464 sal_Int32 nListenerCount
= comphelper::AccessibleEventNotifier::removeEventListener( mnClientId
, xListener
);
465 if ( !nListenerCount
)
467 // no listeners anymore
468 // -> revoke ourself. This may lead to the notifier thread dying (if we were the last client),
469 // and at least to us not firing any events anymore, in case somebody calls
470 // NotifyAccessibleEvent, again
471 comphelper::AccessibleEventNotifier::revokeClient( mnClientId
);
477 void SAL_CALL
SvxGraphCtrlAccessibleContext::grabFocus() throw( RuntimeException
, std::exception
)
479 ::SolarMutexGuard aGuard
;
481 if( nullptr == mpControl
)
482 throw DisposedException();
484 mpControl
->GrabFocus();
487 sal_Int32 SAL_CALL
SvxGraphCtrlAccessibleContext::getForeground()
488 throw (::com::sun::star::uno::RuntimeException
, std::exception
)
490 svtools::ColorConfig aColorConfig
;
491 sal_uInt32 nColor
= aColorConfig
.GetColorValue( svtools::FONTCOLOR
).nColor
;
492 return static_cast<sal_Int32
>(nColor
);
495 sal_Int32 SAL_CALL
SvxGraphCtrlAccessibleContext::getBackground()
496 throw (::com::sun::star::uno::RuntimeException
, std::exception
)
498 sal_uInt32 nColor
= Application::GetSettings().GetStyleSettings().GetWindowColor().GetColor();
499 return static_cast<sal_Int32
>(nColor
);
503 OUString SAL_CALL
SvxGraphCtrlAccessibleContext::getImplementationName() throw( RuntimeException
, std::exception
)
505 return OUString( "com.sun.star.comp.ui.SvxGraphCtrlAccessibleContext" );
508 sal_Bool SAL_CALL
SvxGraphCtrlAccessibleContext::supportsService( const OUString
& sServiceName
) throw( RuntimeException
, std::exception
)
510 return cppu::supportsService(this, sServiceName
);
513 Sequence
< OUString
> SAL_CALL
SvxGraphCtrlAccessibleContext::getSupportedServiceNames() throw( RuntimeException
, std::exception
)
515 Sequence
< OUString
> aSNs( 3 );
517 aSNs
[0] = "com.sun.star.accessibility.Accessible";
518 aSNs
[1] = "com.sun.star.accessibility.AccessibleContext";
519 aSNs
[2] = "com.sun.star.drawing.AccessibleGraphControl";
525 Sequence
<sal_Int8
> SAL_CALL
SvxGraphCtrlAccessibleContext::getImplementationId() throw( RuntimeException
, std::exception
)
527 return css::uno::Sequence
<sal_Int8
>();
531 OUString
SvxGraphCtrlAccessibleContext::getServiceName() throw( RuntimeException
, std::exception
)
533 return OUString( "com.sun.star.accessibility.AccessibleContext" );
536 // XAccessibleSelection
537 void SAL_CALL
SvxGraphCtrlAccessibleContext::selectAccessibleChild( sal_Int32 nIndex
) throw( lang::IndexOutOfBoundsException
, RuntimeException
, std::exception
)
539 ::SolarMutexGuard aGuard
;
542 throw DisposedException();
544 SdrObject
* pObj
= getSdrObject( nIndex
);
547 mpView
->MarkObj( pObj
, mpView
->GetSdrPageView());
552 sal_Bool SAL_CALL
SvxGraphCtrlAccessibleContext::isAccessibleChildSelected( sal_Int32 nIndex
) throw( lang::IndexOutOfBoundsException
, RuntimeException
, std::exception
)
554 ::SolarMutexGuard aGuard
;
557 throw DisposedException();
559 return mpView
->IsObjMarked( getSdrObject( nIndex
) );
564 void SAL_CALL
SvxGraphCtrlAccessibleContext::clearAccessibleSelection() throw( RuntimeException
, std::exception
)
566 ::SolarMutexGuard aGuard
;
569 throw DisposedException();
571 mpView
->UnmarkAllObj();
576 void SAL_CALL
SvxGraphCtrlAccessibleContext::selectAllAccessibleChildren() throw( RuntimeException
, std::exception
)
578 ::SolarMutexGuard aGuard
;
581 throw DisposedException();
583 mpView
->MarkAllObj();
588 sal_Int32 SAL_CALL
SvxGraphCtrlAccessibleContext::getSelectedAccessibleChildCount() throw( RuntimeException
, std::exception
)
590 ::SolarMutexGuard aGuard
;
593 throw DisposedException();
595 const SdrMarkList
& rList
= mpView
->GetMarkedObjectList();
596 return static_cast<sal_Int32
>(rList
.GetMarkCount());
601 Reference
< XAccessible
> SAL_CALL
SvxGraphCtrlAccessibleContext::getSelectedAccessibleChild( sal_Int32 nIndex
)
602 throw( lang::IndexOutOfBoundsException
, RuntimeException
, std::exception
)
604 ::SolarMutexGuard aGuard
;
606 checkChildIndexOnSelection( nIndex
);
608 Reference
< XAccessible
> xAccessible
;
610 const SdrMarkList
& rList
= mpView
->GetMarkedObjectList();
611 SdrObject
* pObj
= rList
.GetMark(static_cast<size_t>(nIndex
))->GetMarkedSdrObj();
613 xAccessible
= getAccessible( pObj
);
620 void SAL_CALL
SvxGraphCtrlAccessibleContext::deselectAccessibleChild( sal_Int32 nIndex
) throw( lang::IndexOutOfBoundsException
, RuntimeException
, std::exception
)
622 ::SolarMutexGuard aGuard
;
624 checkChildIndexOnSelection( nIndex
);
628 const SdrMarkList
& rList
= mpView
->GetMarkedObjectList();
630 SdrObject
* pObj
= getSdrObject( nIndex
);
633 SdrMarkList
aRefList( rList
);
635 SdrPageView
* pPV
= mpView
->GetSdrPageView();
636 mpView
->UnmarkAllObj( pPV
);
638 const size_t nCount
= aRefList
.GetMarkCount();
639 for( size_t nMark
= 0; nMark
< nCount
; ++nMark
)
641 if( aRefList
.GetMark(nMark
)->GetMarkedSdrObj() != pObj
)
642 mpView
->MarkObj( aRefList
.GetMark(nMark
)->GetMarkedSdrObj(), pPV
);
649 void SvxGraphCtrlAccessibleContext::checkChildIndexOnSelection( long nIndex
) throw( lang::IndexOutOfBoundsException
)
651 if( nIndex
< 0 || nIndex
>= getSelectedAccessibleChildCount() )
652 throw lang::IndexOutOfBoundsException();
657 /** Replace the model, page, and view pointers by the ones provided
658 (explicitly and implicitly).
660 void SvxGraphCtrlAccessibleContext::setModelAndView (
664 ::SolarMutexGuard aGuard
;
668 mpPage
= mpModel
->GetPage( 0 );
671 if (mpModel
== NULL
|| mpPage
== NULL
|| mpView
== NULL
)
675 // Set all the pointers to NULL just in case they are used as
682 maTreeInfo
.SetSdrView (mpView
);
689 void SAL_CALL
SvxGraphCtrlAccessibleContext::disposing()
691 ::SolarMutexGuard aGuard
;
698 mpControl
= NULL
; // object dies with representation
703 ShapesMapType::iterator I
;
705 for (I
=mxShapes
.begin(); I
!=mxShapes
.end(); ++I
)
707 XAccessible
* pAcc
= (*I
).second
;
708 Reference
< XComponent
> xComp( pAcc
, UNO_QUERY
);
712 (*I
).second
->release();
718 // Send a disposing to all listeners.
721 comphelper::AccessibleEventNotifier::revokeClientNotifyDisposing( mnClientId
, *this );
728 Rectangle
SvxGraphCtrlAccessibleContext::GetBoundingBoxOnScreen() throw( RuntimeException
)
730 ::SolarMutexGuard aGuard
;
732 if( nullptr == mpControl
)
733 throw DisposedException();
736 mpControl
->GetAccessibleParentWindow()->OutputToAbsoluteScreenPixel(
737 mpControl
->GetPosPixel() ),
738 mpControl
->GetSizePixel() );
743 /** Calculate the relative coordinates of the bounding box as difference
744 between the absolute coordinates of the bounding boxes of this control
745 and its parent in the accessibility tree.
747 Rectangle
SvxGraphCtrlAccessibleContext::GetBoundingBox() throw( RuntimeException
)
749 ::SolarMutexGuard aGuard
;
751 Rectangle
aBounds ( 0, 0, 0, 0 );
753 vcl::Window
* pWindow
= mpControl
;
756 aBounds
= pWindow
->GetWindowExtentsRelative (NULL
);
757 vcl::Window
* pParent
= pWindow
->GetAccessibleParentWindow();
760 Rectangle aParentRect
= pParent
->GetWindowExtentsRelative (NULL
);
761 aBounds
-= aParentRect
.TopLeft();
765 throw DisposedException();
770 void SvxGraphCtrlAccessibleContext::Notify( SfxBroadcaster
& /*rBC*/, const SfxHint
& rHint
)
772 const SdrHint
* pSdrHint
= dynamic_cast<const SdrHint
*>( &rHint
);
776 switch( pSdrHint
->GetKind() )
780 ShapesMapType::iterator iter
= mxShapes
.find( pSdrHint
->GetObject() );
782 if( iter
!= mxShapes
.end() )
784 // if we already have one, return it
785 AccessibleShape
* pShape
= (*iter
).second
;
788 pShape
->CommitChange( AccessibleEventId::VISIBLE_DATA_CHANGED
, uno::Any(), uno::Any() );
793 case HINT_OBJINSERTED
:
794 CommitChange( AccessibleEventId::CHILD
, makeAny( getAccessible( pSdrHint
->GetObject() ) ) , uno::Any());
796 case HINT_OBJREMOVED
:
797 CommitChange( AccessibleEventId::CHILD
, uno::Any(), makeAny( getAccessible( pSdrHint
->GetObject() ) ) );
799 case HINT_MODELCLEARED
:
808 const SfxSimpleHint
* pSfxHint
= dynamic_cast<const SfxSimpleHint
*>( &rHint
);
810 // Has our SdDrawDocument just died?
811 if(pSfxHint
&& pSfxHint
->GetId() == SFX_HINT_DYING
)
818 // IAccessibleViewforwarder
819 bool SvxGraphCtrlAccessibleContext::IsValid() const
826 Rectangle
SvxGraphCtrlAccessibleContext::GetVisibleArea() const
830 if( mpView
&& mpView
->PaintWindowCount())
832 SdrPaintWindow
* pPaintWindow
= mpView
->GetPaintWindow(0L);
833 aVisArea
= pPaintWindow
->GetVisibleArea();
841 Point
SvxGraphCtrlAccessibleContext::LogicToPixel (const Point
& rPoint
) const
845 Rectangle
aBBox(mpControl
->GetWindowExtentsRelative(NULL
));
846 return mpControl
->LogicToPixel (rPoint
) + aBBox
.TopLeft();
856 Size
SvxGraphCtrlAccessibleContext::LogicToPixel (const Size
& rSize
) const
859 return mpControl
->LogicToPixel (rSize
);
866 Point
SvxGraphCtrlAccessibleContext::PixelToLogic (const Point
& rPoint
) const
869 return mpControl
->PixelToLogic (rPoint
);
876 Size
SvxGraphCtrlAccessibleContext::PixelToLogic (const Size
& rSize
) const
879 return mpControl
->PixelToLogic (rSize
);
884 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */