summaryrefslogtreecommitdiffstats
path: root/include/svx/weldeditview.hxx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2019-09-02 14:37:37 +0100
committerCaolán McNamara <caolanm@redhat.com>2019-09-03 10:08:42 +0200
commit5785fc06836607b3a0a25e649d81b8607b22d4af (patch)
treecbac275eff0142fd79cc24acd59a0f39cee64ed4 /include/svx/weldeditview.hxx
parenttdf#39593 Drop OToolBoxWindowItem::isWindowItem (diff)
downloadcore-5785fc06836607b3a0a25e649d81b8607b22d4af.tar.gz
core-5785fc06836607b3a0a25e649d81b8607b22d4af.zip
Resolves: tdf#126935 a11y for hosted EditEngine
move it to svx so we can reuse the a11y code in svx for EditEngines hosted in shapes to provide a11y for EditEngines hosted in a native widget Change-Id: I4068c413cdb8ddb0d0ef899774fbe9f65e1bdc60 Reviewed-on: https://gerrit.libreoffice.org/78407 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'include/svx/weldeditview.hxx')
-rw-r--r--include/svx/weldeditview.hxx69
1 files changed, 69 insertions, 0 deletions
diff --git a/include/svx/weldeditview.hxx b/include/svx/weldeditview.hxx
new file mode 100644
index 000000000000..f5e0183d194d
--- /dev/null
+++ b/include/svx/weldeditview.hxx
@@ -0,0 +1,69 @@
+/* -*- 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/.
+ *
+ */
+
+#ifndef INCLUDED_SVX_WELDEDITVIEW_HXX
+#define INCLUDED_SVX_WELDEDITVIEW_HXX
+
+#include <sal/config.h>
+#include <svx/svxdllapi.h>
+#include <editeng/editeng.hxx>
+#include <editeng/editview.hxx>
+#include <vcl/customweld.hxx>
+#include <vcl/outdev.hxx>
+
+class WeldEditAccessible;
+
+class SVX_DLLPUBLIC WeldEditView : public weld::CustomWidgetController, public EditViewCallbacks
+{
+public:
+ WeldEditView();
+ virtual void SetDrawingArea(weld::DrawingArea* pDrawingArea) override;
+ virtual ~WeldEditView() override;
+
+protected:
+ std::unique_ptr<EditEngine> m_xEditEngine;
+ std::unique_ptr<EditView> m_xEditView;
+ rtl::Reference<WeldEditAccessible> m_xAccessible;
+
+ virtual void makeEditEngine();
+
+ virtual void Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect) override;
+ virtual bool MouseMove(const MouseEvent& rMEvt) override;
+ virtual bool MouseButtonDown(const MouseEvent& rMEvt) override;
+ virtual bool MouseButtonUp(const MouseEvent& rMEvt) override;
+ virtual bool KeyInput(const KeyEvent& rKEvt) override;
+ virtual void GetFocus() override;
+ virtual void LoseFocus() override;
+ virtual void Resize() override;
+
+ virtual css::uno::Reference<css::accessibility::XAccessible> CreateAccessible() override;
+
+ virtual void EditViewInvalidate(const tools::Rectangle& rRect) const override
+ {
+ weld::DrawingArea* pDrawingArea = GetDrawingArea();
+ pDrawingArea->queue_draw_area(rRect.Left(), rRect.Top(), rRect.GetWidth(),
+ rRect.GetHeight());
+ }
+
+ virtual void EditViewSelectionChange() const override
+ {
+ weld::DrawingArea* pDrawingArea = GetDrawingArea();
+ pDrawingArea->queue_draw();
+ }
+
+ virtual OutputDevice& EditViewOutputDevice() const override
+ {
+ return GetDrawingArea()->get_ref_device();
+ }
+};
+
+#endif // INCLUDED_SVX_WELDEDITVIEW_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */