office-gobmx/accessibility/source/extended/AccessibleIconView.cxx
Michael Weghorn 2fdee9fd60 Unify/Port to use VCLUnoHelper for AWT <-> VCL conversions
Following

    Change-Id: Id48f81deb05aee2026509037f7d14575735e5be0
    Author: Michael Weghorn <m.weghorn@posteo.de>
    Date:   Wed Jul 10 14:49:03 2024 +0200

        VCLUnoHelper: Align AWT <-> VCL helpers with convert.hxx impl

, port all uses of the helper functions defined in
`include/toolkit/helper/convert.hxx` to use the
`VCLUnoHelper` equivalents instead, to unify usage
and avoid duplication.

Drop `include/toolkit/helper/convert.hxx` now that
it's unused.

Change-Id: I22695a93e40e47bb2b14d191a2e0a4eb7c856895
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170317
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2024-07-11 06:44:48 +02:00

54 lines
1.7 KiB
C++

/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#include <sal/config.h>
#include <com/sun/star/accessibility/AccessibleEventId.hpp>
#include <toolkit/helper/vclunohelper.hxx>
#include <vcl/event.hxx>
#include <extended/AccessibleIconView.hxx>
namespace accessibility
{
AccessibleIconView::AccessibleIconView(
SvTreeListBox const& _rListBox,
const css::uno::Reference<css::accessibility::XAccessible>& _xParent)
: AccessibleListBox(_rListBox, _xParent)
{
}
void AccessibleIconView::ProcessWindowEvent(const VclWindowEvent& rVclWindowEvent)
{
if (!isAlive())
return;
switch (rVclWindowEvent.GetId())
{
case VclEventId::WindowMouseMove:
if (MouseEvent* pMouseEvt = static_cast<MouseEvent*>(rVclWindowEvent.GetData()))
{
if (auto xChild = getAccessibleAtPoint(
VCLUnoHelper::ConvertToAWTPoint(pMouseEvt->GetPosPixel())))
{
// Allow announcing the element on mouse hover
css::uno::Any aNew(xChild);
NotifyAccessibleEvent(
css::accessibility::AccessibleEventId::ACTIVE_DESCENDANT_CHANGED, {}, aNew);
}
}
break;
default:
AccessibleListBox::ProcessWindowEvent(rVclWindowEvent);
}
}
} // namespace accessibility
/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */