LibreOffice Module winaccessibility (master) 1
AccEventListener.hxx
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#pragma once
21
22#include <com/sun/star/accessibility/XAccessibleEventListener.hpp>
23#include <com/sun/star/accessibility/XAccessible.hpp>
24
26
28
34class AccEventListener : public ::cppu::WeakImplHelper<css::accessibility::XAccessibleEventListener>
35{
36protected:
37 //accessible owner's pointer
38 css::uno::Reference<css::accessibility::XAccessible> m_xAccessible;
39 //agent pointer for objects' manager
41
42public:
43 AccEventListener(css::accessibility::XAccessible* pAcc, AccObjectManagerAgent* Agent);
44 virtual ~AccEventListener() override;
45
46 // XEventListener
47 virtual void SAL_CALL disposing(const css::lang::EventObject& Source) override;
48
49 // XAccessibleEventListener
50 virtual void SAL_CALL
51 notifyEvent(const css::accessibility::AccessibleEventObject& aEvent) override;
52
53 //for name changed event
54 virtual void HandleNameChangedEvent(css::uno::Any name);
55
56 //for description changed event
57 virtual void HandleDescriptionChangedEvent();
58
59 //for state changed event
60 virtual void HandleStateChangedEvent(css::uno::Any oldValue, css::uno::Any newValue);
61 virtual void SetComponentState(sal_Int64 state, bool enable);
62 virtual void FireStatePropertyChange(sal_Int64 state, bool set);
63 virtual void FireStateFocusedChange(bool enable);
64
65 //for bound rect changed event
66 virtual void HandleBoundrectChangedEvent();
67
68 //for visible data changed event
69 virtual void HandleVisibleDataChangedEvent();
70
71 // get the accessible role of m_xAccessible
72 virtual short GetRole();
73 //get the accessible parent's role
74 virtual short GetParentRole();
75
76 void RemoveMeFromBroadcaster(bool isNotifyDestroy);
77};
78
79/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
AccEventListener is the general event listener for all controls.
virtual short GetRole()
get the role of accessible object which is observed
virtual void SetComponentState(sal_Int64 state, bool enable)
set the new state and fire the MSAA event
virtual void HandleDescriptionChangedEvent()
handle the DESCRIPTION_CHANGED event
virtual void HandleNameChangedEvent(css::uno::Any name)
handle the NAME_CHANGED event
virtual void HandleVisibleDataChangedEvent()
handle the VISIBLE_DATA_CHANGED event
virtual void FireStateFocusedChange(bool enable)
handle the focused event
virtual ~AccEventListener() override
virtual short GetParentRole()
get the role of accessible parent object which is observed
AccObjectManagerAgent * pAgent
virtual void SAL_CALL disposing(const css::lang::EventObject &Source) override
this method is invoked before listener is disposed
AccEventListener(css::accessibility::XAccessible *pAcc, AccObjectManagerAgent *Agent)
virtual void FireStatePropertyChange(sal_Int64 state, bool set)
fire the MSAA state changed event
virtual void HandleBoundrectChangedEvent()
handle the BOUNDRECT_CHANGED event
virtual void SAL_CALL notifyEvent(const css::accessibility::AccessibleEventObject &aEvent) override
Uno's event notifier when event is captured.
void RemoveMeFromBroadcaster(bool isNotifyDestroy)
remove the listener from accessible object
virtual void HandleStateChangedEvent(css::uno::Any oldValue, css::uno::Any newValue)
handle the STATE_CHANGED event
css::uno::Reference< css::accessibility::XAccessible > m_xAccessible