1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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/.
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
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
;
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(),
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: */