summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2018-10-04 15:11:27 +0200
committerSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2018-10-08 08:12:23 +0200
commited1eff2bcbc6324f8ea635e0a11512ff0f117019 (patch)
treecc62fb581fe344ce556f9d53dc9cb9e43f3454a0
parent1a6397030381a45f27ab7a2a02e6e6d0f9987c84 (diff)
Qt5AccessibleWidget: Add stub for QAccessibleTextInterface
Change-Id: Iee80b40d2c33a0464abfc285360e76774c644b32 Reviewed-on: https://gerrit.libreoffice.org/61372 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
-rw-r--r--vcl/Library_vclplug_qt5.mk1
-rw-r--r--vcl/inc/qt5/Qt5AccessibleText.hxx62
-rw-r--r--vcl/inc/qt5/Qt5AccessibleWidget.hxx2
-rw-r--r--vcl/qt5/Qt5AccessibleText.cxx99
-rw-r--r--vcl/qt5/Qt5AccessibleWidget.cxx6
5 files changed, 170 insertions, 0 deletions
diff --git a/vcl/Library_vclplug_qt5.mk b/vcl/Library_vclplug_qt5.mk
index be237f37f232..1bb360e2a760 100644
--- a/vcl/Library_vclplug_qt5.mk
+++ b/vcl/Library_vclplug_qt5.mk
@@ -80,6 +80,7 @@ $(eval $(call gb_Library_add_libs,vclplug_qt5,\
endif
$(eval $(call gb_Library_add_exception_objects,vclplug_qt5,\
+ vcl/qt5/Qt5AccessibleText \
vcl/qt5/Qt5AccessibleValue \
vcl/qt5/Qt5AccessibleWidget \
vcl/qt5/Qt5Bitmap \
diff --git a/vcl/inc/qt5/Qt5AccessibleText.hxx b/vcl/inc/qt5/Qt5AccessibleText.hxx
new file mode 100644
index 000000000000..2f9e50381009
--- /dev/null
+++ b/vcl/inc/qt5/Qt5AccessibleText.hxx
@@ -0,0 +1,62 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * 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/.
+ */
+
+#pragma once
+
+#include <vclpluginapi.h>
+
+#include "Qt5AccessibleWidget.hxx"
+
+#include <QtCore/QObject>
+#include <QtCore/QPair>
+#include <QtCore/QString>
+#include <QtCore/QStringList>
+#include <QtCore/QVector>
+#include <QtGui/QAccessible>
+#include <QtGui/QAccessibleActionInterface>
+#include <QtGui/QAccessibleInterface>
+#include <QtGui/QAccessibleValueInterface>
+#include <QtGui/QColor>
+#include <QtGui/QWindow>
+
+#include <com/sun/star/accessibility/XAccessible.hpp>
+
+class Qt5Frame;
+class Qt5Widget;
+
+class VCLPLUG_QT5_PUBLIC Qt5AccessibleText : public QAccessibleTextInterface
+{
+public:
+ Qt5AccessibleText(const css::uno::Reference<css::accessibility::XAccessible> xAccessible);
+
+ void addSelection(int startOffset, int endOffset) override;
+ QString attributes(int offset, int* startOffset, int* endOffset) const override;
+ int characterCount() const override;
+ QRect characterRect(int offset) const override;
+ int cursorPosition() const override;
+ int offsetAtPoint(const QPoint& point) const override;
+ void removeSelection(int selectionIndex) override;
+ void scrollToSubstring(int startIndex, int endIndex) override;
+ void selection(int selectionIndex, int* startOffset, int* endOffset) const override;
+ int selectionCount() const override;
+ void setCursorPosition(int position) override;
+ void setSelection(int selectionIndex, int startOffset, int endOffset) override;
+ QString text(int startOffset, int endOffset) const override;
+ QString textAfterOffset(int offset, QAccessible::TextBoundaryType boundaryType,
+ int* startOffset, int* endOffset) const override;
+ QString textAtOffset(int offset, QAccessible::TextBoundaryType boundaryType, int* startOffset,
+ int* endOffset) const override;
+ QString textBeforeOffset(int offset, QAccessible::TextBoundaryType boundaryType,
+ int* startOffset, int* endOffset) const override;
+
+private:
+ css::uno::Reference<css::accessibility::XAccessible> m_xAccessible;
+};
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/qt5/Qt5AccessibleWidget.hxx b/vcl/inc/qt5/Qt5AccessibleWidget.hxx
index 980c464b9658..1e372479e479 100644
--- a/vcl/inc/qt5/Qt5AccessibleWidget.hxx
+++ b/vcl/inc/qt5/Qt5AccessibleWidget.hxx
@@ -19,6 +19,7 @@
#include <QtGui/QAccessible>
#include <QtGui/QAccessibleActionInterface>
#include <QtGui/QAccessibleInterface>
+#include <QtGui/QAccessibleTextInterface>
#include <QtGui/QAccessibleValueInterface>
#include <QtGui/QColor>
#include <QtGui/QWindow>
@@ -68,6 +69,7 @@ public:
QStringList keyBindingsForAction(const QString& actionName) const override;
QAccessibleValueInterface* valueInterface();
+ QAccessibleTextInterface* textInterface();
// Factory
static QAccessibleInterface* customFactory(const QString& classname, QObject* object);
diff --git a/vcl/qt5/Qt5AccessibleText.cxx b/vcl/qt5/Qt5AccessibleText.cxx
new file mode 100644
index 000000000000..07e3350369d9
--- /dev/null
+++ b/vcl/qt5/Qt5AccessibleText.cxx
@@ -0,0 +1,99 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * 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 .
+ */
+
+#include <Qt5AccessibleText.hxx>
+
+#include <QtGui/QAccessibleInterface>
+
+#include <Qt5Frame.hxx>
+#include <Qt5Tools.hxx>
+#include <Qt5Widget.hxx>
+#include <Qt5XAccessible.hxx>
+
+#include <com/sun/star/accessibility/AccessibleRelationType.hpp>
+#include <com/sun/star/accessibility/AccessibleRole.hpp>
+#include <com/sun/star/accessibility/AccessibleStateType.hpp>
+#include <com/sun/star/accessibility/XAccessible.hpp>
+#include <com/sun/star/accessibility/XAccessibleAction.hpp>
+#include <com/sun/star/accessibility/XAccessibleComponent.hpp>
+#include <com/sun/star/accessibility/XAccessibleKeyBinding.hpp>
+#include <com/sun/star/accessibility/XAccessibleRelationSet.hpp>
+#include <com/sun/star/accessibility/XAccessibleStateSet.hpp>
+#include <com/sun/star/accessibility/XAccessibleValue.hpp>
+#include <com/sun/star/uno/Sequence.hxx>
+
+#include <comphelper/AccessibleImplementationHelper.hxx>
+#include <sal/log.hxx>
+#include <vcl/popupmenuwindow.hxx>
+
+using namespace css;
+using namespace css::accessibility;
+using namespace css::uno;
+
+Qt5AccessibleText::Qt5AccessibleText(const Reference<XAccessible> xAccessible)
+ : m_xAccessible(xAccessible)
+{
+}
+
+void Qt5AccessibleText::addSelection(int /* startOffset */, int /* endOffset */) {}
+QString Qt5AccessibleText::attributes(int /* offset */, int* /* startOffset */,
+ int* /* endOffset */) const
+{
+ return QString();
+}
+int Qt5AccessibleText::characterCount() const { return 0; }
+QRect Qt5AccessibleText::characterRect(int /* offset */) const { return QRect(); }
+int Qt5AccessibleText::cursorPosition() const { return 0; }
+int Qt5AccessibleText::offsetAtPoint(const QPoint& /* point */) const { return 0; }
+void Qt5AccessibleText::removeSelection(int /* selectionIndex */) {}
+void Qt5AccessibleText::scrollToSubstring(int /* startIndex */, int /* endIndex */) {}
+void Qt5AccessibleText::selection(int /* selectionIndex */, int* /* startOffset */,
+ int* /* endOffset */) const
+{
+}
+int Qt5AccessibleText::selectionCount() const { return 0; }
+void Qt5AccessibleText::setCursorPosition(int /* position */) {}
+void Qt5AccessibleText::setSelection(int /* selectionIndex */, int /* startOffset */,
+ int /* endOffset */)
+{
+}
+QString Qt5AccessibleText::text(int /* startOffset */, int /* endOffset */) const
+{
+ return QString();
+}
+QString Qt5AccessibleText::textAfterOffset(int /* offset */,
+ QAccessible::TextBoundaryType /* boundaryType */,
+ int* /* startOffset */, int* /* endOffset */) const
+{
+ return QString();
+}
+QString Qt5AccessibleText::textAtOffset(int /* offset */,
+ QAccessible::TextBoundaryType /* boundaryType */,
+ int* /* startOffset */, int* /* endOffset */) const
+{
+ return QString();
+}
+QString Qt5AccessibleText::textBeforeOffset(int /* offset */,
+ QAccessible::TextBoundaryType /* boundaryType */,
+ int* /* startOffset */, int* /* endOffset */) const
+{
+ return QString();
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/qt5/Qt5AccessibleWidget.cxx b/vcl/qt5/Qt5AccessibleWidget.cxx
index 75b7bb7fcecd..be3480aa3f77 100644
--- a/vcl/qt5/Qt5AccessibleWidget.cxx
+++ b/vcl/qt5/Qt5AccessibleWidget.cxx
@@ -26,6 +26,7 @@
#include <Qt5Tools.hxx>
#include <Qt5Widget.hxx>
#include <Qt5XAccessible.hxx>
+#include <Qt5AccessibleText.hxx>
#include <Qt5AccessibleValue.hxx>
#include <com/sun/star/accessibility/AccessibleRelationType.hpp>
@@ -702,4 +703,9 @@ QAccessibleValueInterface* Qt5AccessibleWidget::valueInterface()
return new Qt5AccessibleValue(m_xAccessible);
}
+QAccessibleTextInterface* Qt5AccessibleWidget::textInterface()
+{
+ return new Qt5AccessibleText(m_xAccessible);
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */