1*5b190011SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*5b190011SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*5b190011SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*5b190011SAndrew Rist  * distributed with this work for additional information
6*5b190011SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*5b190011SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*5b190011SAndrew Rist  * "License"); you may not use this file except in compliance
9*5b190011SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*5b190011SAndrew Rist  *
11*5b190011SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*5b190011SAndrew Rist  *
13*5b190011SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*5b190011SAndrew Rist  * software distributed under the License is distributed on an
15*5b190011SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*5b190011SAndrew Rist  * KIND, either express or implied.  See the License for the
17*5b190011SAndrew Rist  * specific language governing permissions and limitations
18*5b190011SAndrew Rist  * under the License.
19*5b190011SAndrew Rist  *
20*5b190011SAndrew Rist  *************************************************************/
21*5b190011SAndrew Rist 
22*5b190011SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
25cdf0e10cSrcweir #include "precompiled_sd.hxx"
26cdf0e10cSrcweir #include "AccessibleDocumentViewBase.hxx"
27cdf0e10cSrcweir #include <com/sun/star/drawing/XDrawPage.hpp>
28cdf0e10cSrcweir #include <com/sun/star/drawing/XDrawView.hpp>
29cdf0e10cSrcweir #include <com/sun/star/drawing/XShapes.hpp>
30cdf0e10cSrcweir #include <com/sun/star/container/XChild.hpp>
31cdf0e10cSrcweir #include <com/sun/star/frame/XController.hpp>
32cdf0e10cSrcweir #include <com/sun/star/frame/XFrame.hpp>
33cdf0e10cSrcweir #include <com/sun/star/document/XEventBroadcaster.hpp>
34cdf0e10cSrcweir #include <com/sun/star/beans/XPropertySet.hpp>
35cdf0e10cSrcweir #include <com/sun/star/accessibility/AccessibleEventId.hpp>
36cdf0e10cSrcweir #include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
37cdf0e10cSrcweir #include <com/sun/star/lang/XMultiServiceFactory.hpp>
38cdf0e10cSrcweir #include <rtl/ustring.h>
39cdf0e10cSrcweir #include<sfx2/viewfrm.hxx>
40cdf0e10cSrcweir 
41cdf0e10cSrcweir #include <svx/AccessibleShape.hxx>
42cdf0e10cSrcweir 
43cdf0e10cSrcweir #include <svx/svdobj.hxx>
44cdf0e10cSrcweir #include <svx/svdmodel.hxx>
45cdf0e10cSrcweir #include <svx/unoapi.hxx>
46cdf0e10cSrcweir #include <toolkit/helper/vclunohelper.hxx>
47cdf0e10cSrcweir #include "Window.hxx"
48cdf0e10cSrcweir #include <vcl/svapp.hxx>
49cdf0e10cSrcweir 
50cdf0e10cSrcweir 
51cdf0e10cSrcweir #include "ViewShell.hxx"
52cdf0e10cSrcweir #include "View.hxx"
53cdf0e10cSrcweir #include <memory>
54cdf0e10cSrcweir 
55cdf0e10cSrcweir using ::rtl::OUString;
56cdf0e10cSrcweir using namespace ::com::sun::star;
57cdf0e10cSrcweir using namespace	::com::sun::star::accessibility;
58cdf0e10cSrcweir using ::com::sun::star::uno::Reference;
59cdf0e10cSrcweir 
60cdf0e10cSrcweir class SfxViewFrame;
61cdf0e10cSrcweir 
62cdf0e10cSrcweir namespace accessibility {
63cdf0e10cSrcweir 
64cdf0e10cSrcweir //=====  internal  ============================================================
65cdf0e10cSrcweir AccessibleDocumentViewBase::AccessibleDocumentViewBase (
66cdf0e10cSrcweir     ::sd::Window* pSdWindow,
67cdf0e10cSrcweir     ::sd::ViewShell* pViewShell,
68cdf0e10cSrcweir     const uno::Reference<frame::XController>& rxController,
69cdf0e10cSrcweir     const uno::Reference<XAccessible>& rxParent)
70cdf0e10cSrcweir     : AccessibleContextBase (rxParent, AccessibleRole::DOCUMENT),
71cdf0e10cSrcweir       mpWindow (pSdWindow),
72cdf0e10cSrcweir       mxController (rxController),
73cdf0e10cSrcweir       mxModel (NULL),
74cdf0e10cSrcweir       maViewForwarder (
75cdf0e10cSrcweir         static_cast<SdrPaintView*>(pViewShell->GetView()),
76cdf0e10cSrcweir         *static_cast<OutputDevice*>(pSdWindow))
77cdf0e10cSrcweir {
78cdf0e10cSrcweir     if (mxController.is())
79cdf0e10cSrcweir         mxModel = mxController->getModel();
80cdf0e10cSrcweir 
81cdf0e10cSrcweir     // Fill the shape tree info.
82cdf0e10cSrcweir     maShapeTreeInfo.SetModelBroadcaster (
83cdf0e10cSrcweir         uno::Reference<document::XEventBroadcaster>(
84cdf0e10cSrcweir             mxModel, uno::UNO_QUERY));
85cdf0e10cSrcweir     maShapeTreeInfo.SetController (mxController);
86cdf0e10cSrcweir     maShapeTreeInfo.SetSdrView (pViewShell->GetView());
87cdf0e10cSrcweir     maShapeTreeInfo.SetWindow (pSdWindow);
88cdf0e10cSrcweir     maShapeTreeInfo.SetViewForwarder (&maViewForwarder);
89cdf0e10cSrcweir 
90cdf0e10cSrcweir     mxWindow = ::VCLUnoHelper::GetInterface (pSdWindow);
91cdf0e10cSrcweir }
92cdf0e10cSrcweir 
93cdf0e10cSrcweir 
94cdf0e10cSrcweir 
95cdf0e10cSrcweir 
96cdf0e10cSrcweir AccessibleDocumentViewBase::~AccessibleDocumentViewBase (void)
97cdf0e10cSrcweir {
98cdf0e10cSrcweir     // At this place we should be disposed.  You may want to add a
99cdf0e10cSrcweir     // corresponding assertion into the destructor of a derived class.
100cdf0e10cSrcweir }
101cdf0e10cSrcweir 
102cdf0e10cSrcweir 
103cdf0e10cSrcweir 
104cdf0e10cSrcweir 
105cdf0e10cSrcweir void AccessibleDocumentViewBase::Init (void)
106cdf0e10cSrcweir {
107cdf0e10cSrcweir     // Finish the initialization of the shape tree info container.
108cdf0e10cSrcweir     maShapeTreeInfo.SetDocumentWindow (this);
109cdf0e10cSrcweir 
110cdf0e10cSrcweir     // Register as window listener to stay up to date with its size and
111cdf0e10cSrcweir     // position.
112cdf0e10cSrcweir     mxWindow->addWindowListener (this);
113cdf0e10cSrcweir     // Register as focus listener to
114cdf0e10cSrcweir     mxWindow->addFocusListener (this);
115cdf0e10cSrcweir 
116cdf0e10cSrcweir     // Determine the list of shapes on the current page.
117cdf0e10cSrcweir     uno::Reference<drawing::XShapes> xShapeList;
118cdf0e10cSrcweir     uno::Reference<drawing::XDrawView> xView (mxController, uno::UNO_QUERY);
119cdf0e10cSrcweir     if (xView.is())
120cdf0e10cSrcweir         xShapeList = uno::Reference<drawing::XShapes> (
121cdf0e10cSrcweir             xView->getCurrentPage(), uno::UNO_QUERY);
122cdf0e10cSrcweir 
123cdf0e10cSrcweir     // Register this object as dispose event listener at the model.
124cdf0e10cSrcweir 	if (mxModel.is())
125cdf0e10cSrcweir 		mxModel->addEventListener (
126cdf0e10cSrcweir             static_cast<awt::XWindowListener*>(this));
127cdf0e10cSrcweir 
128cdf0e10cSrcweir     // Register as property change listener at the controller.
129cdf0e10cSrcweir     uno::Reference<beans::XPropertySet> xSet (mxController, uno::UNO_QUERY);
130cdf0e10cSrcweir     if (xSet.is())
131cdf0e10cSrcweir         xSet->addPropertyChangeListener (
132cdf0e10cSrcweir             OUString (RTL_CONSTASCII_USTRINGPARAM("")),
133cdf0e10cSrcweir             static_cast<beans::XPropertyChangeListener*>(this));
134cdf0e10cSrcweir 
135cdf0e10cSrcweir     // Register this object as dispose event listener at the controller.
136cdf0e10cSrcweir     if (mxController.is())
137cdf0e10cSrcweir         mxController->addEventListener (
138cdf0e10cSrcweir             static_cast<awt::XWindowListener*>(this));
139cdf0e10cSrcweir 
140cdf0e10cSrcweir     // Register at VCL Window to be informed of activated and deactivated
141cdf0e10cSrcweir     // OLE objects.
142cdf0e10cSrcweir     Window* pWindow = maShapeTreeInfo.GetWindow();
143cdf0e10cSrcweir     if (pWindow != NULL)
144cdf0e10cSrcweir     {
145cdf0e10cSrcweir         maWindowLink = LINK(
146cdf0e10cSrcweir             this, AccessibleDocumentViewBase, WindowChildEventListener);
147cdf0e10cSrcweir 
148cdf0e10cSrcweir         pWindow->AddChildEventListener (maWindowLink);
149cdf0e10cSrcweir 
150cdf0e10cSrcweir         sal_uInt16 nCount = pWindow->GetChildCount();
151cdf0e10cSrcweir         for (sal_uInt16 i=0; i<nCount; i++)
152cdf0e10cSrcweir         {
153cdf0e10cSrcweir             Window* pChildWindow = pWindow->GetChild (i);
154cdf0e10cSrcweir             if (pChildWindow &&
155cdf0e10cSrcweir                 (AccessibleRole::EMBEDDED_OBJECT
156cdf0e10cSrcweir                     ==pChildWindow->GetAccessibleRole()))
157cdf0e10cSrcweir             {
158cdf0e10cSrcweir                 SetAccessibleOLEObject (pChildWindow->GetAccessible());
159cdf0e10cSrcweir             }
160cdf0e10cSrcweir         }
161cdf0e10cSrcweir     }
162cdf0e10cSrcweir }
163cdf0e10cSrcweir 
164cdf0e10cSrcweir 
165cdf0e10cSrcweir 
166cdf0e10cSrcweir 
167cdf0e10cSrcweir IMPL_LINK(AccessibleDocumentViewBase, WindowChildEventListener,
168cdf0e10cSrcweir     VclSimpleEvent*, pEvent)
169cdf0e10cSrcweir {
170cdf0e10cSrcweir     OSL_ASSERT(pEvent!=NULL && pEvent->ISA(VclWindowEvent));
171cdf0e10cSrcweir     if (pEvent!=NULL && pEvent->ISA(VclWindowEvent))
172cdf0e10cSrcweir     {
173cdf0e10cSrcweir         VclWindowEvent* pWindowEvent = static_cast<VclWindowEvent*>(pEvent);
174cdf0e10cSrcweir         //      DBG_ASSERT( pVclEvent->GetWindow(), "Window???" );
175cdf0e10cSrcweir         switch (pWindowEvent->GetId())
176cdf0e10cSrcweir         {
177cdf0e10cSrcweir             case VCLEVENT_OBJECT_DYING:
178cdf0e10cSrcweir             {
179cdf0e10cSrcweir                 // Window is dying.  Unregister from VCL Window.
180cdf0e10cSrcweir                 // This is also attempted in the disposing() method.
181cdf0e10cSrcweir                 Window* pWindow = maShapeTreeInfo.GetWindow();
182cdf0e10cSrcweir                 Window* pDyingWindow = static_cast<Window*>(
183cdf0e10cSrcweir                     pWindowEvent->GetWindow());
184cdf0e10cSrcweir                 if (pWindow==pDyingWindow && pWindow!=NULL && maWindowLink.IsSet())
185cdf0e10cSrcweir                 {
186cdf0e10cSrcweir                     pWindow->RemoveChildEventListener (maWindowLink);
187cdf0e10cSrcweir                     maWindowLink = Link();
188cdf0e10cSrcweir                 }
189cdf0e10cSrcweir             }
190cdf0e10cSrcweir             break;
191cdf0e10cSrcweir 
192cdf0e10cSrcweir             case VCLEVENT_WINDOW_SHOW:
193cdf0e10cSrcweir             {
194cdf0e10cSrcweir                 // A new window has been created.  Is it an OLE object?
195cdf0e10cSrcweir                 Window* pChildWindow = static_cast<Window*>(
196cdf0e10cSrcweir                     pWindowEvent->GetData());
197cdf0e10cSrcweir                 if (pChildWindow!=NULL
198cdf0e10cSrcweir                     && (pChildWindow->GetAccessibleRole()
199cdf0e10cSrcweir                         == AccessibleRole::EMBEDDED_OBJECT))
200cdf0e10cSrcweir                 {
201cdf0e10cSrcweir                     SetAccessibleOLEObject (pChildWindow->GetAccessible());
202cdf0e10cSrcweir                 }
203cdf0e10cSrcweir             }
204cdf0e10cSrcweir             break;
205cdf0e10cSrcweir 
206cdf0e10cSrcweir             case VCLEVENT_WINDOW_HIDE:
207cdf0e10cSrcweir             {
208cdf0e10cSrcweir                 // A window has been destroyed.  Has that been an OLE
209cdf0e10cSrcweir                 // object?
210cdf0e10cSrcweir                 Window* pChildWindow = static_cast<Window*>(
211cdf0e10cSrcweir                     pWindowEvent->GetData());
212cdf0e10cSrcweir                 if (pChildWindow!=NULL
213cdf0e10cSrcweir                     && (pChildWindow->GetAccessibleRole()
214cdf0e10cSrcweir                         == AccessibleRole::EMBEDDED_OBJECT))
215cdf0e10cSrcweir                 {
216cdf0e10cSrcweir                     SetAccessibleOLEObject (NULL);
217cdf0e10cSrcweir                 }
218cdf0e10cSrcweir             }
219cdf0e10cSrcweir             break;
220cdf0e10cSrcweir         }
221cdf0e10cSrcweir     }
222cdf0e10cSrcweir 
223cdf0e10cSrcweir     return 0;
224cdf0e10cSrcweir }
225cdf0e10cSrcweir 
226cdf0e10cSrcweir 
227cdf0e10cSrcweir 
228cdf0e10cSrcweir 
229cdf0e10cSrcweir //=====  IAccessibleViewForwarderListener  ====================================
230cdf0e10cSrcweir 
231cdf0e10cSrcweir void AccessibleDocumentViewBase::ViewForwarderChanged(ChangeType, const IAccessibleViewForwarder* )
232cdf0e10cSrcweir {
233cdf0e10cSrcweir     // Empty
234cdf0e10cSrcweir }
235cdf0e10cSrcweir 
236cdf0e10cSrcweir 
237cdf0e10cSrcweir 
238cdf0e10cSrcweir 
239cdf0e10cSrcweir //=====  XAccessibleContext  ==================================================
240cdf0e10cSrcweir 
241cdf0e10cSrcweir Reference<XAccessible> SAL_CALL
242cdf0e10cSrcweir    	AccessibleDocumentViewBase::getAccessibleParent (void)
243cdf0e10cSrcweir     throw (uno::RuntimeException)
244cdf0e10cSrcweir {
245cdf0e10cSrcweir     ThrowIfDisposed ();
246cdf0e10cSrcweir 
247cdf0e10cSrcweir     return AccessibleContextBase::getAccessibleParent();
248cdf0e10cSrcweir }
249cdf0e10cSrcweir 
250cdf0e10cSrcweir 
251cdf0e10cSrcweir 
252cdf0e10cSrcweir sal_Int32 SAL_CALL
253cdf0e10cSrcweir     AccessibleDocumentViewBase::getAccessibleChildCount (void)
254cdf0e10cSrcweir     throw (uno::RuntimeException)
255cdf0e10cSrcweir {
256cdf0e10cSrcweir     ThrowIfDisposed ();
257cdf0e10cSrcweir 
258cdf0e10cSrcweir     if (mxAccessibleOLEObject.is())
259cdf0e10cSrcweir         return 1;
260cdf0e10cSrcweir     else
261cdf0e10cSrcweir         return 0;
262cdf0e10cSrcweir }
263cdf0e10cSrcweir 
264cdf0e10cSrcweir 
265cdf0e10cSrcweir 
266cdf0e10cSrcweir 
267cdf0e10cSrcweir Reference<XAccessible> SAL_CALL
268cdf0e10cSrcweir     AccessibleDocumentViewBase::getAccessibleChild (sal_Int32 nIndex)
269cdf0e10cSrcweir     throw (uno::RuntimeException, lang::IndexOutOfBoundsException)
270cdf0e10cSrcweir {
271cdf0e10cSrcweir     ThrowIfDisposed ();
272cdf0e10cSrcweir 
273cdf0e10cSrcweir     ::osl::MutexGuard aGuard (maMutex);
274cdf0e10cSrcweir     if (mxAccessibleOLEObject.is())
275cdf0e10cSrcweir         if (nIndex == 0)
276cdf0e10cSrcweir             return mxAccessibleOLEObject;
277cdf0e10cSrcweir 
278cdf0e10cSrcweir     throw lang::IndexOutOfBoundsException (
279cdf0e10cSrcweir         ::rtl::OUString::createFromAscii ("no child with index ")
280cdf0e10cSrcweir         + rtl::OUString::valueOf(nIndex),
281cdf0e10cSrcweir 		NULL);
282cdf0e10cSrcweir }
283cdf0e10cSrcweir 
284cdf0e10cSrcweir 
285cdf0e10cSrcweir 
286cdf0e10cSrcweir 
287cdf0e10cSrcweir //=====  XAccessibleComponent  ================================================
288cdf0e10cSrcweir 
289cdf0e10cSrcweir /** Iterate over all children and test whether the specified point lies
290cdf0e10cSrcweir     within one of their bounding boxes.  Return the first child for which
291cdf0e10cSrcweir     this is true.
292cdf0e10cSrcweir */
293cdf0e10cSrcweir uno::Reference<XAccessible > SAL_CALL
294cdf0e10cSrcweir     AccessibleDocumentViewBase::getAccessibleAtPoint (
295cdf0e10cSrcweir         const awt::Point& aPoint)
296cdf0e10cSrcweir     throw (uno::RuntimeException)
297cdf0e10cSrcweir {
298cdf0e10cSrcweir     ThrowIfDisposed ();
299cdf0e10cSrcweir 
300cdf0e10cSrcweir     ::osl::MutexGuard aGuard (maMutex);
301cdf0e10cSrcweir     uno::Reference<XAccessible> xChildAtPosition;
302cdf0e10cSrcweir 
303cdf0e10cSrcweir     sal_Int32 nChildCount = getAccessibleChildCount ();
304cdf0e10cSrcweir     for (sal_Int32 i=nChildCount-1; i>=0; --i)
305cdf0e10cSrcweir     {
306cdf0e10cSrcweir         Reference<XAccessible> xChild (getAccessibleChild (i));
307cdf0e10cSrcweir         if (xChild.is())
308cdf0e10cSrcweir         {
309cdf0e10cSrcweir             Reference<XAccessibleComponent> xChildComponent (
310cdf0e10cSrcweir                 xChild->getAccessibleContext(), uno::UNO_QUERY);
311cdf0e10cSrcweir             if (xChildComponent.is())
312cdf0e10cSrcweir             {
313cdf0e10cSrcweir                 awt::Rectangle aBBox (xChildComponent->getBounds());
314cdf0e10cSrcweir                 if ( (aPoint.X >= aBBox.X)
315cdf0e10cSrcweir                     && (aPoint.Y >= aBBox.Y)
316cdf0e10cSrcweir                     && (aPoint.X < aBBox.X+aBBox.Width)
317cdf0e10cSrcweir                     && (aPoint.Y < aBBox.Y+aBBox.Height) )
318cdf0e10cSrcweir                 {
319cdf0e10cSrcweir                     xChildAtPosition = xChild;
320cdf0e10cSrcweir                     break;
321cdf0e10cSrcweir                 }
322cdf0e10cSrcweir             }
323cdf0e10cSrcweir         }
324cdf0e10cSrcweir     }
325cdf0e10cSrcweir 
326cdf0e10cSrcweir     // Have not found a child under the given point.  Returning empty
327cdf0e10cSrcweir     // reference to indicate this.
328cdf0e10cSrcweir     return xChildAtPosition;
329cdf0e10cSrcweir }
330cdf0e10cSrcweir 
331cdf0e10cSrcweir 
332cdf0e10cSrcweir 
333cdf0e10cSrcweir 
334cdf0e10cSrcweir awt::Rectangle SAL_CALL
335cdf0e10cSrcweir     AccessibleDocumentViewBase::getBounds (void)
336cdf0e10cSrcweir     throw (::com::sun::star::uno::RuntimeException)
337cdf0e10cSrcweir {
338cdf0e10cSrcweir     ThrowIfDisposed ();
339cdf0e10cSrcweir 
340cdf0e10cSrcweir     // Transform visible area into screen coordinates.
341cdf0e10cSrcweir     ::Rectangle aVisibleArea (
342cdf0e10cSrcweir         maShapeTreeInfo.GetViewForwarder()->GetVisibleArea());
343cdf0e10cSrcweir     ::Point aPixelTopLeft (
344cdf0e10cSrcweir         maShapeTreeInfo.GetViewForwarder()->LogicToPixel (
345cdf0e10cSrcweir             aVisibleArea.TopLeft()));
346cdf0e10cSrcweir     ::Point aPixelSize (
347cdf0e10cSrcweir         maShapeTreeInfo.GetViewForwarder()->LogicToPixel (
348cdf0e10cSrcweir             aVisibleArea.BottomRight())
349cdf0e10cSrcweir         - aPixelTopLeft);
350cdf0e10cSrcweir 
351cdf0e10cSrcweir     // Prepare to subtract the parent position to transform into relative
352cdf0e10cSrcweir     // coordinates.
353cdf0e10cSrcweir     awt::Point aParentPosition;
354cdf0e10cSrcweir     Reference<XAccessible> xParent = getAccessibleParent ();
355cdf0e10cSrcweir     if (xParent.is())
356cdf0e10cSrcweir     {
357cdf0e10cSrcweir         Reference<XAccessibleComponent> xParentComponent (
358cdf0e10cSrcweir             xParent->getAccessibleContext(), uno::UNO_QUERY);
359cdf0e10cSrcweir         if (xParentComponent.is())
360cdf0e10cSrcweir             aParentPosition = xParentComponent->getLocationOnScreen();
361cdf0e10cSrcweir     }
362cdf0e10cSrcweir 
363cdf0e10cSrcweir     return awt::Rectangle (
364cdf0e10cSrcweir         aPixelTopLeft.X() - aParentPosition.X,
365cdf0e10cSrcweir         aPixelTopLeft.Y() - aParentPosition.Y,
366cdf0e10cSrcweir         aPixelSize.X(),
367cdf0e10cSrcweir         aPixelSize.Y());
368cdf0e10cSrcweir }
369cdf0e10cSrcweir 
370cdf0e10cSrcweir 
371cdf0e10cSrcweir 
372cdf0e10cSrcweir 
373cdf0e10cSrcweir awt::Point SAL_CALL
374cdf0e10cSrcweir     AccessibleDocumentViewBase::getLocation (void)
375cdf0e10cSrcweir     throw (uno::RuntimeException)
376cdf0e10cSrcweir {
377cdf0e10cSrcweir     ThrowIfDisposed ();
378cdf0e10cSrcweir     awt::Rectangle aBoundingBox (getBounds());
379cdf0e10cSrcweir     return awt::Point (aBoundingBox.X, aBoundingBox.Y);
380cdf0e10cSrcweir }
381cdf0e10cSrcweir 
382cdf0e10cSrcweir 
383cdf0e10cSrcweir 
384cdf0e10cSrcweir 
385cdf0e10cSrcweir awt::Point SAL_CALL
386cdf0e10cSrcweir     AccessibleDocumentViewBase::getLocationOnScreen (void)
387cdf0e10cSrcweir     throw (uno::RuntimeException)
388cdf0e10cSrcweir {
389cdf0e10cSrcweir     ThrowIfDisposed ();
390cdf0e10cSrcweir     ::Point aLogicalPoint (maShapeTreeInfo.GetViewForwarder()->GetVisibleArea().TopLeft());
391cdf0e10cSrcweir     ::Point aPixelPoint (maShapeTreeInfo.GetViewForwarder()->LogicToPixel (aLogicalPoint));
392cdf0e10cSrcweir     return awt::Point (aPixelPoint.X(), aPixelPoint.Y());
393cdf0e10cSrcweir }
394cdf0e10cSrcweir 
395cdf0e10cSrcweir 
396cdf0e10cSrcweir 
397cdf0e10cSrcweir 
398cdf0e10cSrcweir awt::Size SAL_CALL
399cdf0e10cSrcweir     AccessibleDocumentViewBase::getSize (void)
400cdf0e10cSrcweir     throw (uno::RuntimeException)
401cdf0e10cSrcweir {
402cdf0e10cSrcweir     ThrowIfDisposed ();
403cdf0e10cSrcweir 
404cdf0e10cSrcweir     // Transform visible area into screen coordinates.
405cdf0e10cSrcweir     ::Rectangle aVisibleArea (
406cdf0e10cSrcweir         maShapeTreeInfo.GetViewForwarder()->GetVisibleArea());
407cdf0e10cSrcweir     ::Point aPixelTopLeft (
408cdf0e10cSrcweir         maShapeTreeInfo.GetViewForwarder()->LogicToPixel (
409cdf0e10cSrcweir             aVisibleArea.TopLeft()));
410cdf0e10cSrcweir     ::Point aPixelSize (
411cdf0e10cSrcweir         maShapeTreeInfo.GetViewForwarder()->LogicToPixel (
412cdf0e10cSrcweir             aVisibleArea.BottomRight())
413cdf0e10cSrcweir         - aPixelTopLeft);
414cdf0e10cSrcweir 
415cdf0e10cSrcweir     return awt::Size (aPixelSize.X(), aPixelSize.Y());
416cdf0e10cSrcweir }
417cdf0e10cSrcweir 
418cdf0e10cSrcweir 
419cdf0e10cSrcweir 
420cdf0e10cSrcweir 
421cdf0e10cSrcweir //=====  XInterface  ==========================================================
422cdf0e10cSrcweir 
423cdf0e10cSrcweir uno::Any SAL_CALL
424cdf0e10cSrcweir     AccessibleDocumentViewBase::queryInterface (const uno::Type & rType)
425cdf0e10cSrcweir     throw (uno::RuntimeException)
426cdf0e10cSrcweir {
427cdf0e10cSrcweir     uno::Any aReturn = AccessibleContextBase::queryInterface (rType);
428cdf0e10cSrcweir     if ( ! aReturn.hasValue())
429cdf0e10cSrcweir         aReturn = ::cppu::queryInterface (rType,
430cdf0e10cSrcweir             static_cast<XAccessibleComponent*>(this),
431cdf0e10cSrcweir             static_cast<XAccessibleSelection*>(this),
432cdf0e10cSrcweir             static_cast<lang::XEventListener*>(
433cdf0e10cSrcweir                 static_cast<awt::XWindowListener*>(this)),
434cdf0e10cSrcweir             static_cast<beans::XPropertyChangeListener*>(this),
435cdf0e10cSrcweir             static_cast<awt::XWindowListener*>(this),
436cdf0e10cSrcweir             static_cast<awt::XFocusListener*>(this)
437cdf0e10cSrcweir             );
438cdf0e10cSrcweir     return aReturn;
439cdf0e10cSrcweir }
440cdf0e10cSrcweir 
441cdf0e10cSrcweir 
442cdf0e10cSrcweir 
443cdf0e10cSrcweir 
444cdf0e10cSrcweir void SAL_CALL
445cdf0e10cSrcweir     AccessibleDocumentViewBase::acquire (void)
446cdf0e10cSrcweir     throw ()
447cdf0e10cSrcweir {
448cdf0e10cSrcweir     AccessibleContextBase::acquire ();
449cdf0e10cSrcweir }
450cdf0e10cSrcweir 
451cdf0e10cSrcweir 
452cdf0e10cSrcweir 
453cdf0e10cSrcweir 
454cdf0e10cSrcweir void SAL_CALL
455cdf0e10cSrcweir     AccessibleDocumentViewBase::release (void)
456cdf0e10cSrcweir     throw ()
457cdf0e10cSrcweir {
458cdf0e10cSrcweir     AccessibleContextBase::release ();
459cdf0e10cSrcweir }
460cdf0e10cSrcweir 
461cdf0e10cSrcweir 
462cdf0e10cSrcweir 
463cdf0e10cSrcweir 
464cdf0e10cSrcweir //=====  XServiceInfo  ========================================================
465cdf0e10cSrcweir 
466cdf0e10cSrcweir ::rtl::OUString SAL_CALL
467cdf0e10cSrcweir     AccessibleDocumentViewBase::getImplementationName (void)
468cdf0e10cSrcweir     throw (::com::sun::star::uno::RuntimeException)
469cdf0e10cSrcweir {
470cdf0e10cSrcweir 	return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("AccessibleDocumentViewBase"));
471cdf0e10cSrcweir }
472cdf0e10cSrcweir 
473cdf0e10cSrcweir 
474cdf0e10cSrcweir 
475cdf0e10cSrcweir 
476cdf0e10cSrcweir ::com::sun::star::uno::Sequence< ::rtl::OUString> SAL_CALL
477cdf0e10cSrcweir     AccessibleDocumentViewBase::getSupportedServiceNames (void)
478cdf0e10cSrcweir     throw (::com::sun::star::uno::RuntimeException)
479cdf0e10cSrcweir {
480cdf0e10cSrcweir     ThrowIfDisposed ();
481cdf0e10cSrcweir     return AccessibleContextBase::getSupportedServiceNames ();
482cdf0e10cSrcweir }
483cdf0e10cSrcweir 
484cdf0e10cSrcweir 
485cdf0e10cSrcweir 
486cdf0e10cSrcweir 
487cdf0e10cSrcweir 
488cdf0e10cSrcweir //=====  XTypeProvider  =======================================================
489cdf0e10cSrcweir 
490cdf0e10cSrcweir ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type> SAL_CALL
491cdf0e10cSrcweir     AccessibleDocumentViewBase::getTypes (void)
492cdf0e10cSrcweir     throw (::com::sun::star::uno::RuntimeException)
493cdf0e10cSrcweir {
494cdf0e10cSrcweir     ThrowIfDisposed ();
495cdf0e10cSrcweir 
496cdf0e10cSrcweir     // Get list of types from the context base implementation, ...
497cdf0e10cSrcweir 	uno::Sequence<uno::Type> aTypeList (AccessibleContextBase::getTypes());
498cdf0e10cSrcweir     // ... get list of types from component base implementation, ...
499cdf0e10cSrcweir 	uno::Sequence<uno::Type> aComponentTypeList (AccessibleComponentBase::getTypes());
500cdf0e10cSrcweir 
501cdf0e10cSrcweir 
502cdf0e10cSrcweir     // ...and add the additional type for the component, ...
503cdf0e10cSrcweir     const uno::Type aLangEventListenerType =
504cdf0e10cSrcweir      	::getCppuType((const uno::Reference<lang::XEventListener>*)0);
505cdf0e10cSrcweir     const uno::Type aPropertyChangeListenerType =
506cdf0e10cSrcweir      	::getCppuType((const uno::Reference<beans::XPropertyChangeListener>*)0);
507cdf0e10cSrcweir     const uno::Type aWindowListenerType =
508cdf0e10cSrcweir      	::getCppuType((const uno::Reference<awt::XWindowListener>*)0);
509cdf0e10cSrcweir     const uno::Type aFocusListenerType =
510cdf0e10cSrcweir      	::getCppuType((const uno::Reference<awt::XFocusListener>*)0);
511cdf0e10cSrcweir     const uno::Type aEventBroadcaster =
512cdf0e10cSrcweir      	::getCppuType((const uno::Reference<XAccessibleEventBroadcaster>*)0);
513cdf0e10cSrcweir 
514cdf0e10cSrcweir     // ... and merge them all into one list.
515cdf0e10cSrcweir     sal_Int32 nTypeCount (aTypeList.getLength()),
516cdf0e10cSrcweir         nComponentTypeCount (aComponentTypeList.getLength()),
517cdf0e10cSrcweir         i;
518cdf0e10cSrcweir 
519cdf0e10cSrcweir     aTypeList.realloc (nTypeCount + nComponentTypeCount + 5);
520cdf0e10cSrcweir 
521cdf0e10cSrcweir     for (i=0; i<nComponentTypeCount; i++)
522cdf0e10cSrcweir         aTypeList[nTypeCount + i] = aComponentTypeList[i];
523cdf0e10cSrcweir 
524cdf0e10cSrcweir     aTypeList[nTypeCount + i++ ] = aLangEventListenerType;
525cdf0e10cSrcweir     aTypeList[nTypeCount + i++] = aPropertyChangeListenerType;
526cdf0e10cSrcweir     aTypeList[nTypeCount + i++] = aWindowListenerType;
527cdf0e10cSrcweir     aTypeList[nTypeCount + i++] = aFocusListenerType;
528cdf0e10cSrcweir     aTypeList[nTypeCount + i++] = aEventBroadcaster;
529cdf0e10cSrcweir 
530cdf0e10cSrcweir 	return aTypeList;
531cdf0e10cSrcweir }
532cdf0e10cSrcweir 
533cdf0e10cSrcweir 
534cdf0e10cSrcweir 
535cdf0e10cSrcweir 
536cdf0e10cSrcweir void AccessibleDocumentViewBase::impl_dispose()
537cdf0e10cSrcweir {
538cdf0e10cSrcweir     // Unregister from VCL Window.
539cdf0e10cSrcweir     Window* pWindow = maShapeTreeInfo.GetWindow();
540cdf0e10cSrcweir     if (maWindowLink.IsSet())
541cdf0e10cSrcweir     {
542cdf0e10cSrcweir         if (pWindow)
543cdf0e10cSrcweir             pWindow->RemoveChildEventListener (maWindowLink);
544cdf0e10cSrcweir         maWindowLink = Link();
545cdf0e10cSrcweir     }
546cdf0e10cSrcweir     else
547cdf0e10cSrcweir     {
548cdf0e10cSrcweir         DBG_ASSERT (pWindow, "AccessibleDocumentViewBase::disposing");
549cdf0e10cSrcweir     }
550cdf0e10cSrcweir 
551cdf0e10cSrcweir     // Unregister from window.
552cdf0e10cSrcweir     if (mxWindow.is())
553cdf0e10cSrcweir     {
554cdf0e10cSrcweir         mxWindow->removeWindowListener (this);
555cdf0e10cSrcweir         mxWindow->removeFocusListener (this);
556cdf0e10cSrcweir         mxWindow = NULL;
557cdf0e10cSrcweir     }
558cdf0e10cSrcweir 
559cdf0e10cSrcweir     // Unregister form the model.
560cdf0e10cSrcweir     if (mxModel.is())
561cdf0e10cSrcweir         mxModel->removeEventListener (
562cdf0e10cSrcweir             static_cast<awt::XWindowListener*>(this));
563cdf0e10cSrcweir 
564cdf0e10cSrcweir     // Unregister from the controller.
565cdf0e10cSrcweir     if (mxController.is())
566cdf0e10cSrcweir     {
567cdf0e10cSrcweir         uno::Reference<beans::XPropertySet> xSet (mxController, uno::UNO_QUERY);
568cdf0e10cSrcweir         if (xSet.is())
569cdf0e10cSrcweir             xSet->removePropertyChangeListener (
570cdf0e10cSrcweir                 OUString (RTL_CONSTASCII_USTRINGPARAM("")),
571cdf0e10cSrcweir                 static_cast<beans::XPropertyChangeListener*>(this));
572cdf0e10cSrcweir 
573cdf0e10cSrcweir         mxController->removeEventListener (
574cdf0e10cSrcweir             static_cast<awt::XWindowListener*>(this));
575cdf0e10cSrcweir     }
576cdf0e10cSrcweir 
577cdf0e10cSrcweir     // Propagate change of controller down the shape tree.
578cdf0e10cSrcweir     maShapeTreeInfo.SetControllerBroadcaster (NULL);
579cdf0e10cSrcweir 
580cdf0e10cSrcweir     // Reset the model reference.
581cdf0e10cSrcweir     mxModel = NULL;
582cdf0e10cSrcweir     // Reset the model reference.
583cdf0e10cSrcweir     mxController = NULL;
584cdf0e10cSrcweir 
585cdf0e10cSrcweir     maShapeTreeInfo.SetDocumentWindow (NULL);
586cdf0e10cSrcweir }
587cdf0e10cSrcweir 
588cdf0e10cSrcweir 
589cdf0e10cSrcweir 
590cdf0e10cSrcweir 
591cdf0e10cSrcweir //=====  XEventListener  ======================================================
592cdf0e10cSrcweir 
593cdf0e10cSrcweir void SAL_CALL
594cdf0e10cSrcweir     AccessibleDocumentViewBase::disposing (const lang::EventObject& rEventObject)
595cdf0e10cSrcweir     throw (::com::sun::star::uno::RuntimeException)
596cdf0e10cSrcweir {
597cdf0e10cSrcweir     ThrowIfDisposed ();
598cdf0e10cSrcweir 
599cdf0e10cSrcweir     // Register this object as dispose event and document::XEventListener
600cdf0e10cSrcweir     // listener at the model.
601cdf0e10cSrcweir 
602cdf0e10cSrcweir     if ( ! rEventObject.Source.is())
603cdf0e10cSrcweir     {
604cdf0e10cSrcweir         // Paranoia. Can this really happen?
605cdf0e10cSrcweir     }
606cdf0e10cSrcweir     else if (rEventObject.Source == mxModel || rEventObject.Source == mxController)
607cdf0e10cSrcweir     {
608cdf0e10cSrcweir         impl_dispose();
609cdf0e10cSrcweir     }
610cdf0e10cSrcweir }
611cdf0e10cSrcweir 
612cdf0e10cSrcweir //=====  XPropertyChangeListener  =============================================
613cdf0e10cSrcweir 
614cdf0e10cSrcweir void SAL_CALL AccessibleDocumentViewBase::propertyChange (const beans::PropertyChangeEvent& )
615cdf0e10cSrcweir     throw (::com::sun::star::uno::RuntimeException)
616cdf0e10cSrcweir {
617cdf0e10cSrcweir     // Empty
618cdf0e10cSrcweir }
619cdf0e10cSrcweir 
620cdf0e10cSrcweir 
621cdf0e10cSrcweir 
622cdf0e10cSrcweir 
623cdf0e10cSrcweir //=====  XWindowListener  =====================================================
624cdf0e10cSrcweir 
625cdf0e10cSrcweir void SAL_CALL
626cdf0e10cSrcweir     AccessibleDocumentViewBase::windowResized (const ::com::sun::star::awt::WindowEvent& )
627cdf0e10cSrcweir     throw (::com::sun::star::uno::RuntimeException)
628cdf0e10cSrcweir {
629cdf0e10cSrcweir     if( IsDisposed() )
630cdf0e10cSrcweir         return;
631cdf0e10cSrcweir 
632cdf0e10cSrcweir     ViewForwarderChanged (
633cdf0e10cSrcweir         IAccessibleViewForwarderListener::VISIBLE_AREA,
634cdf0e10cSrcweir         &maViewForwarder);
635cdf0e10cSrcweir }
636cdf0e10cSrcweir 
637cdf0e10cSrcweir 
638cdf0e10cSrcweir 
639cdf0e10cSrcweir 
640cdf0e10cSrcweir void SAL_CALL
641cdf0e10cSrcweir     AccessibleDocumentViewBase::windowMoved (const ::com::sun::star::awt::WindowEvent& )
642cdf0e10cSrcweir     throw (::com::sun::star::uno::RuntimeException)
643cdf0e10cSrcweir {
644cdf0e10cSrcweir     if( IsDisposed() )
645cdf0e10cSrcweir         return;
646cdf0e10cSrcweir 
647cdf0e10cSrcweir     ViewForwarderChanged (
648cdf0e10cSrcweir         IAccessibleViewForwarderListener::VISIBLE_AREA,
649cdf0e10cSrcweir         &maViewForwarder);
650cdf0e10cSrcweir }
651cdf0e10cSrcweir 
652cdf0e10cSrcweir 
653cdf0e10cSrcweir 
654cdf0e10cSrcweir 
655cdf0e10cSrcweir void SAL_CALL
656cdf0e10cSrcweir     AccessibleDocumentViewBase::windowShown (const ::com::sun::star::lang::EventObject& )
657cdf0e10cSrcweir     throw (::com::sun::star::uno::RuntimeException)
658cdf0e10cSrcweir {
659cdf0e10cSrcweir     if( IsDisposed() )
660cdf0e10cSrcweir         return;
661cdf0e10cSrcweir 
662cdf0e10cSrcweir     ViewForwarderChanged (
663cdf0e10cSrcweir         IAccessibleViewForwarderListener::VISIBLE_AREA,
664cdf0e10cSrcweir         &maViewForwarder);
665cdf0e10cSrcweir }
666cdf0e10cSrcweir 
667cdf0e10cSrcweir 
668cdf0e10cSrcweir 
669cdf0e10cSrcweir 
670cdf0e10cSrcweir void SAL_CALL
671cdf0e10cSrcweir     AccessibleDocumentViewBase::windowHidden (const ::com::sun::star::lang::EventObject& )
672cdf0e10cSrcweir     throw (::com::sun::star::uno::RuntimeException)
673cdf0e10cSrcweir {
674cdf0e10cSrcweir     if( IsDisposed() )
675cdf0e10cSrcweir         return;
676cdf0e10cSrcweir 
677cdf0e10cSrcweir     ViewForwarderChanged (
678cdf0e10cSrcweir         IAccessibleViewForwarderListener::VISIBLE_AREA,
679cdf0e10cSrcweir         &maViewForwarder);
680cdf0e10cSrcweir }
681cdf0e10cSrcweir 
682cdf0e10cSrcweir 
683cdf0e10cSrcweir 
684cdf0e10cSrcweir 
685cdf0e10cSrcweir //=====  XFocusListener  ==================================================
686cdf0e10cSrcweir 
687cdf0e10cSrcweir void AccessibleDocumentViewBase::focusGained (const ::com::sun::star::awt::FocusEvent& e)
688cdf0e10cSrcweir     throw (::com::sun::star::uno::RuntimeException)
689cdf0e10cSrcweir {
690cdf0e10cSrcweir     ThrowIfDisposed ();
691cdf0e10cSrcweir     if (e.Source == mxWindow)
692cdf0e10cSrcweir         Activated ();
693cdf0e10cSrcweir }
694cdf0e10cSrcweir 
695cdf0e10cSrcweir void AccessibleDocumentViewBase::focusLost (const ::com::sun::star::awt::FocusEvent& e)
696cdf0e10cSrcweir     throw (::com::sun::star::uno::RuntimeException)
697cdf0e10cSrcweir {
698cdf0e10cSrcweir     ThrowIfDisposed ();
699cdf0e10cSrcweir     if (e.Source == mxWindow)
700cdf0e10cSrcweir         Deactivated ();
701cdf0e10cSrcweir }
702cdf0e10cSrcweir 
703cdf0e10cSrcweir 
704cdf0e10cSrcweir 
705cdf0e10cSrcweir 
706cdf0e10cSrcweir //=====  protected internal  ==================================================
707cdf0e10cSrcweir 
708cdf0e10cSrcweir // This method is called from the component helper base class while disposing.
709cdf0e10cSrcweir void SAL_CALL AccessibleDocumentViewBase::disposing (void)
710cdf0e10cSrcweir {
711cdf0e10cSrcweir     impl_dispose();
712cdf0e10cSrcweir 
713cdf0e10cSrcweir     AccessibleContextBase::disposing ();
714cdf0e10cSrcweir }
715cdf0e10cSrcweir 
716cdf0e10cSrcweir 
717cdf0e10cSrcweir 
718cdf0e10cSrcweir 
719cdf0e10cSrcweir ///	Create a name for this view.
720cdf0e10cSrcweir ::rtl::OUString
721cdf0e10cSrcweir     AccessibleDocumentViewBase::CreateAccessibleName (void)
722cdf0e10cSrcweir     throw (::com::sun::star::uno::RuntimeException)
723cdf0e10cSrcweir {
724cdf0e10cSrcweir 	return ::rtl::OUString (
725cdf0e10cSrcweir         RTL_CONSTASCII_USTRINGPARAM("AccessibleDocumentViewBase"));
726cdf0e10cSrcweir }
727cdf0e10cSrcweir 
728cdf0e10cSrcweir 
729cdf0e10cSrcweir 
730cdf0e10cSrcweir 
731cdf0e10cSrcweir /** Create a description for this view.  Use the model's description or URL
732cdf0e10cSrcweir     if a description is not available.
733cdf0e10cSrcweir */
734cdf0e10cSrcweir ::rtl::OUString
735cdf0e10cSrcweir     AccessibleDocumentViewBase::CreateAccessibleDescription (void)
736cdf0e10cSrcweir     throw (::com::sun::star::uno::RuntimeException)
737cdf0e10cSrcweir {
738cdf0e10cSrcweir 	rtl::OUString sDescription;
739cdf0e10cSrcweir 
740cdf0e10cSrcweir     uno::Reference<lang::XServiceInfo> xInfo (mxController, uno::UNO_QUERY);
741cdf0e10cSrcweir     if (xInfo.is())
742cdf0e10cSrcweir     {
743cdf0e10cSrcweir         OUString sFirstService = xInfo->getSupportedServiceNames()[0];
744cdf0e10cSrcweir         if (sFirstService == OUString (
745cdf0e10cSrcweir                 RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.DrawingDocumentDrawView")))
746cdf0e10cSrcweir         {
747cdf0e10cSrcweir             sDescription = OUString (RTL_CONSTASCII_USTRINGPARAM("Draw Document"));
748cdf0e10cSrcweir         }
749cdf0e10cSrcweir         else
750cdf0e10cSrcweir             sDescription = sFirstService;
751cdf0e10cSrcweir     }
752cdf0e10cSrcweir     else
753cdf0e10cSrcweir         sDescription = OUString (
754cdf0e10cSrcweir             RTL_CONSTASCII_USTRINGPARAM("Accessible Draw Document"));
755cdf0e10cSrcweir 	return sDescription;
756cdf0e10cSrcweir }
757cdf0e10cSrcweir 
758cdf0e10cSrcweir 
759cdf0e10cSrcweir 
760cdf0e10cSrcweir 
761cdf0e10cSrcweir void AccessibleDocumentViewBase::Activated (void)
762cdf0e10cSrcweir {
763cdf0e10cSrcweir     // Empty.  Overwrite to do something usefull.
764cdf0e10cSrcweir }
765cdf0e10cSrcweir 
766cdf0e10cSrcweir 
767cdf0e10cSrcweir 
768cdf0e10cSrcweir 
769cdf0e10cSrcweir void AccessibleDocumentViewBase::Deactivated (void)
770cdf0e10cSrcweir {
771cdf0e10cSrcweir     // Empty.  Overwrite to do something usefull.
772cdf0e10cSrcweir }
773cdf0e10cSrcweir 
774cdf0e10cSrcweir 
775cdf0e10cSrcweir 
776cdf0e10cSrcweir 
777cdf0e10cSrcweir void AccessibleDocumentViewBase::SetAccessibleOLEObject (
778cdf0e10cSrcweir     const Reference <XAccessible>& xOLEObject)
779cdf0e10cSrcweir {
780cdf0e10cSrcweir     // Send child event about removed accessible OLE object if necessary.
781cdf0e10cSrcweir     if (mxAccessibleOLEObject != xOLEObject)
782cdf0e10cSrcweir         if (mxAccessibleOLEObject.is())
783cdf0e10cSrcweir             CommitChange (
784cdf0e10cSrcweir                 AccessibleEventId::CHILD,
785cdf0e10cSrcweir                 uno::Any(),
786cdf0e10cSrcweir                 uno::makeAny (mxAccessibleOLEObject));
787cdf0e10cSrcweir 
788cdf0e10cSrcweir     // Assume that the accessible OLE Object disposes itself correctly.
789cdf0e10cSrcweir 
790cdf0e10cSrcweir     {
791cdf0e10cSrcweir         ::osl::MutexGuard aGuard (maMutex);
792cdf0e10cSrcweir         mxAccessibleOLEObject = xOLEObject;
793cdf0e10cSrcweir     }
794cdf0e10cSrcweir 
795cdf0e10cSrcweir     // Send child event about new accessible OLE object if necessary.
796cdf0e10cSrcweir     if (mxAccessibleOLEObject.is())
797cdf0e10cSrcweir         CommitChange (
798cdf0e10cSrcweir             AccessibleEventId::CHILD,
799cdf0e10cSrcweir             uno::makeAny (mxAccessibleOLEObject),
800cdf0e10cSrcweir             uno::Any());
801cdf0e10cSrcweir }
802cdf0e10cSrcweir 
803cdf0e10cSrcweir 
804cdf0e10cSrcweir 
805cdf0e10cSrcweir 
806cdf0e10cSrcweir //=====  methods from AccessibleSelectionBase ==================================================
807cdf0e10cSrcweir 
808cdf0e10cSrcweir // return the member maMutex;
809cdf0e10cSrcweir ::osl::Mutex&
810cdf0e10cSrcweir     AccessibleDocumentViewBase::implGetMutex()
811cdf0e10cSrcweir {
812cdf0e10cSrcweir     return( maMutex );
813cdf0e10cSrcweir }
814cdf0e10cSrcweir 
815cdf0e10cSrcweir // return ourself as context in default case
816cdf0e10cSrcweir uno::Reference< XAccessibleContext >
817cdf0e10cSrcweir     AccessibleDocumentViewBase::implGetAccessibleContext()
818cdf0e10cSrcweir     throw (uno::RuntimeException)
819cdf0e10cSrcweir {
820cdf0e10cSrcweir     return( this );
821cdf0e10cSrcweir }
822cdf0e10cSrcweir 
823cdf0e10cSrcweir // return sal_False in default case
824cdf0e10cSrcweir sal_Bool
825cdf0e10cSrcweir     AccessibleDocumentViewBase::implIsSelected( sal_Int32 )
826cdf0e10cSrcweir     throw (uno::RuntimeException)
827cdf0e10cSrcweir {
828cdf0e10cSrcweir     return( sal_False );
829cdf0e10cSrcweir }
830cdf0e10cSrcweir 
831cdf0e10cSrcweir // return nothing in default case
832cdf0e10cSrcweir void
833cdf0e10cSrcweir     AccessibleDocumentViewBase::implSelect( sal_Int32, sal_Bool )
834cdf0e10cSrcweir     throw (lang::IndexOutOfBoundsException, uno::RuntimeException)
835cdf0e10cSrcweir {
836cdf0e10cSrcweir }
837cdf0e10cSrcweir 
838cdf0e10cSrcweir } // end of namespace accessibility
839