diff options
author | Michael Weghorn <m.weghorn@posteo.de> | 2023-10-11 08:38:55 +0200 |
---|---|---|
committer | Michael Weghorn <m.weghorn@posteo.de> | 2023-10-12 12:19:05 +0200 |
commit | b9b3d49dfe2de62612cdebbc465c8322acf410b1 (patch) | |
tree | 789106fc9d4b2a67b884d0eb879ec8a866b5a434 /include | |
parent | d5c19ef9d30cde052e8cd2486ac9395e62d9c9a9 (diff) |
tdf#157696 vcl a11y: Move qt's translation to IA2 text attrs for reuse
Qt expects the text attributes to be reported as IAccessible2
attributes. Therefore, there is a translation/conversion
from the LO-internal text attributes to IAccessible2 text
attributes in `QtAccessibleWidget::attributes`.
Move the logic from the qt-VCL-specific code into a new
VCL helper class `AccessibleTextAttributeHelper`, so
it can be reused in winaccessibility in following commits.
Change-Id: I434481faa53c74bae95cae5b2c9f0907b87fb1bb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157804
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Diffstat (limited to 'include')
-rw-r--r-- | include/vcl/accessibility/AccessibleTextAttributeHelper.hxx | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/include/vcl/accessibility/AccessibleTextAttributeHelper.hxx b/include/vcl/accessibility/AccessibleTextAttributeHelper.hxx new file mode 100644 index 000000000000..6f8ef6dab66e --- /dev/null +++ b/include/vcl/accessibility/AccessibleTextAttributeHelper.hxx @@ -0,0 +1,39 @@ +/* -*- 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/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#pragma once + +#include <com/sun/star/beans/PropertyValue.hdl> +#include <com/sun/star/uno/Sequence.hxx> +#include <rtl/ustring.hxx> +#include <vcl/dllapi.h> + +class VCL_DLLPUBLIC AccessibleTextAttributeHelper +{ +public: + /** Converts UNO text attribute properties to a string holding + * the corresponding IAccessible2 text attributes. + * @param rUnoAttributes A sequence holding the UNO text attributes. + * @returns String holding the corresponding IAccessible2 text properties. + */ + static OUString ConvertUnoToIAccessible2TextAttributes( + const css::uno::Sequence<css::beans::PropertyValue>& rUnoAttributes); +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ |