Bump version to 6.4-15
[LibreOffice.git] / include / svx / weldeditview.hxx
blob071a8f50d8528a11a2ea1748cfe54b34b88932f6
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 */
11 #ifndef INCLUDED_SVX_WELDEDITVIEW_HXX
12 #define INCLUDED_SVX_WELDEDITVIEW_HXX
14 #include <sal/config.h>
15 #include <svx/svxdllapi.h>
16 #include <editeng/editeng.hxx>
17 #include <editeng/editview.hxx>
18 #include <vcl/customweld.hxx>
19 #include <vcl/outdev.hxx>
21 class WeldEditAccessible;
23 class SVX_DLLPUBLIC WeldEditView : public weld::CustomWidgetController, public EditViewCallbacks
25 public:
26 WeldEditView();
27 virtual void SetDrawingArea(weld::DrawingArea* pDrawingArea) override;
29 void SetText(const OUString& rStr) { m_xEditEngine->SetText(rStr); }
31 OUString GetText() const { return m_xEditEngine->GetText(); }
33 void SetModifyHdl(const Link<LinkParamNone*, void>& rLink)
35 m_xEditEngine->SetModifyHdl(rLink);
38 EditEngine& GetEditEngine() { return *m_xEditEngine; }
40 virtual ~WeldEditView() override;
42 protected:
43 std::unique_ptr<EditEngine> m_xEditEngine;
44 std::unique_ptr<EditView> m_xEditView;
45 rtl::Reference<WeldEditAccessible> m_xAccessible;
47 virtual void makeEditEngine();
49 virtual void Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect) override;
50 virtual bool MouseMove(const MouseEvent& rMEvt) override;
51 virtual bool MouseButtonDown(const MouseEvent& rMEvt) override;
52 virtual bool MouseButtonUp(const MouseEvent& rMEvt) override;
53 virtual bool KeyInput(const KeyEvent& rKEvt) override;
54 virtual bool Command(const CommandEvent& rCEvt) override;
55 virtual void GetFocus() override;
56 virtual void LoseFocus() override;
57 virtual void Resize() override;
59 virtual css::uno::Reference<css::accessibility::XAccessible> CreateAccessible() override;
61 virtual void EditViewInvalidate(const tools::Rectangle& rRect) const override
63 weld::DrawingArea* pDrawingArea = GetDrawingArea();
64 pDrawingArea->queue_draw_area(rRect.Left(), rRect.Top(), rRect.GetWidth(),
65 rRect.GetHeight());
68 virtual void EditViewSelectionChange() const override
70 weld::DrawingArea* pDrawingArea = GetDrawingArea();
71 pDrawingArea->queue_draw();
74 virtual OutputDevice& EditViewOutputDevice() const override
76 return GetDrawingArea()->get_ref_device();
80 #endif // INCLUDED_SVX_WELDEDITVIEW_HXX
82 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */