LibreOffice Module winaccessibility (master) 1
AccTreeEventListener.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
20#include <com/sun/star/accessibility/XAccessible.hpp>
21#include <com/sun/star/accessibility/AccessibleStateType.hpp>
22#include <com/sun/star/accessibility/AccessibleEventId.hpp>
23#include <com/sun/star/accessibility/AccessibleRole.hpp>
24#include <com/sun/star/accessibility/XAccessibleEventBroadcaster.hpp>
25
26#include <vcl/svapp.hxx>
27
30#include <unomsaaevent.hxx>
31
32using namespace com::sun::star::uno;
33using namespace com::sun::star::accessibility;
34
35AccTreeEventListener::AccTreeEventListener(css::accessibility::XAccessible* pAcc, AccObjectManagerAgent* Agent)
37{}
39{
40}
41
46void AccTreeEventListener::notifyEvent( const css::accessibility::AccessibleEventObject& aEvent )
47{
49
50 switch (aEvent.EventId)
51 {
52 case AccessibleEventId::ACTIVE_DESCENDANT_CHANGED:
54 break;
55 default:
57 break;
58 }
59}
60
67{
69 if(newValue >>= xChild )
70 {
71 if(xChild.is())
72 {
73 XAccessible* pAcc = xChild.get();
74 pAgent->InsertAccObj(pAcc, m_xAccessible.get());
76 }
77 }
78 if (oldValue >>= xChild)
79 {
80 //delete an existing child
81 if(xChild.is())
82 {
83 XAccessible* pAcc = xChild.get();
84 pAgent->DeleteAccObj( pAcc );
85 }
86 }
87
88}
89
90/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
AnyEventRef aEvent
AccDescendantManagerEventListener is inherited from AccComponentEventListener.
virtual void SAL_CALL notifyEvent(const css::accessibility::AccessibleEventObject &aEvent) override
Uno's event notifier when event is captured.
AccObjectManagerAgent * pAgent
css::uno::Reference< css::accessibility::XAccessible > m_xAccessible
virtual void DeleteAccObj(css::accessibility::XAccessible *pXAcc)
When a new UNO XAccessible object is destroyed, we delete its corresponding com object and remove it ...
virtual bool InsertAccObj(css::accessibility::XAccessible *pXAcc, css::accessibility::XAccessible *pParentXAcc, HWND hWnd=nullptr)
When a new UNO XAccessible object is found by listener, we create a corresponding com object and inse...
bool NotifyAccEvent(UnoMSAAEvent eEvent, css::accessibility::XAccessible *pXAcc=nullptr)
Interface of notify MSAA event when some UNO event occurred.
virtual void HandleActiveDescendantChangedEvent(css::uno::Any oldValue, css::uno::Any newValue)
handle the ACTIVE_DESCENDANT_CHANGED event
virtual void SAL_CALL notifyEvent(const css::accessibility::AccessibleEventObject &aEvent) override
Uno's event notifier when event is captured.
AccTreeEventListener(css::accessibility::XAccessible *pAcc, AccObjectManagerAgent *Agent)
virtual ~AccTreeEventListener() override
@ ACTIVE_DESCENDANT_CHANGED