2019-06-25 08:20:29 -05:00
|
|
|
/* -*- 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/.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2019-09-02 08:37:37 -05:00
|
|
|
#ifndef INCLUDED_SVX_WELDEDITVIEW_HXX
|
|
|
|
#define INCLUDED_SVX_WELDEDITVIEW_HXX
|
2019-06-25 08:20:29 -05:00
|
|
|
|
|
|
|
#include <sal/config.h>
|
2019-09-02 08:37:37 -05:00
|
|
|
#include <svx/svxdllapi.h>
|
2019-06-25 08:20:29 -05:00
|
|
|
#include <editeng/editeng.hxx>
|
|
|
|
#include <editeng/editview.hxx>
|
|
|
|
#include <vcl/customweld.hxx>
|
|
|
|
#include <vcl/outdev.hxx>
|
|
|
|
|
2019-09-02 08:37:37 -05:00
|
|
|
class WeldEditAccessible;
|
|
|
|
|
|
|
|
class SVX_DLLPUBLIC WeldEditView : public weld::CustomWidgetController, public EditViewCallbacks
|
2019-06-25 08:20:29 -05:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
WeldEditView();
|
|
|
|
virtual void SetDrawingArea(weld::DrawingArea* pDrawingArea) override;
|
2019-09-15 14:18:38 -05:00
|
|
|
|
|
|
|
void SetText(const OUString& rStr) { m_xEditEngine->SetText(rStr); }
|
|
|
|
|
|
|
|
OUString GetText() const { return m_xEditEngine->GetText(); }
|
|
|
|
|
|
|
|
void SetModifyHdl(const Link<LinkParamNone*, void>& rLink)
|
|
|
|
{
|
|
|
|
m_xEditEngine->SetModifyHdl(rLink);
|
|
|
|
}
|
|
|
|
|
|
|
|
EditEngine& GetEditEngine() { return *m_xEditEngine; }
|
|
|
|
|
2019-06-25 08:20:29 -05:00
|
|
|
virtual ~WeldEditView() override;
|
|
|
|
|
|
|
|
protected:
|
2019-06-25 09:21:40 -05:00
|
|
|
std::unique_ptr<EditEngine> m_xEditEngine;
|
|
|
|
std::unique_ptr<EditView> m_xEditView;
|
2019-09-02 08:37:37 -05:00
|
|
|
rtl::Reference<WeldEditAccessible> m_xAccessible;
|
2019-06-25 09:21:40 -05:00
|
|
|
|
|
|
|
virtual void makeEditEngine();
|
|
|
|
|
2019-06-25 08:20:29 -05:00
|
|
|
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;
|
2019-11-14 10:01:53 -06:00
|
|
|
virtual bool Command(const CommandEvent& rCEvt) override;
|
2019-06-25 08:20:29 -05:00
|
|
|
virtual void GetFocus() override;
|
2019-06-25 09:21:40 -05:00
|
|
|
virtual void LoseFocus() override;
|
2019-06-25 08:20:29 -05:00
|
|
|
virtual void Resize() override;
|
|
|
|
|
2019-09-02 08:37:37 -05:00
|
|
|
virtual css::uno::Reference<css::accessibility::XAccessible> CreateAccessible() override;
|
|
|
|
|
2019-06-25 08:20:29 -05:00
|
|
|
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();
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2019-09-02 08:37:37 -05:00
|
|
|
#endif // INCLUDED_SVX_WELDEDITVIEW_HXX
|
2019-06-25 08:20:29 -05:00
|
|
|
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|