2019-10-27 12:55:10 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <LibGUI/GTextEditor.h>
|
|
|
|
|
|
2019-10-27 20:43:34 +01:00
|
|
|
class EditorWrapper;
|
2019-10-29 21:39:12 +01:00
|
|
|
class HtmlView;
|
2019-10-27 20:43:34 +01:00
|
|
|
|
2019-10-27 12:55:10 +01:00
|
|
|
class Editor final : public GTextEditor {
|
|
|
|
|
C_OBJECT(Editor)
|
|
|
|
|
public:
|
2019-10-29 21:39:12 +01:00
|
|
|
virtual ~Editor() override;
|
2019-10-27 12:55:10 +01:00
|
|
|
|
|
|
|
|
Function<void()> on_focus;
|
|
|
|
|
|
2019-10-27 20:43:34 +01:00
|
|
|
EditorWrapper& wrapper();
|
|
|
|
|
const EditorWrapper& wrapper() const;
|
|
|
|
|
|
2019-10-27 12:55:10 +01:00
|
|
|
private:
|
2019-10-27 20:43:34 +01:00
|
|
|
virtual void focusin_event(CEvent&) override;
|
|
|
|
|
virtual void focusout_event(CEvent&) override;
|
|
|
|
|
virtual void paint_event(GPaintEvent&) override;
|
2019-10-29 21:39:12 +01:00
|
|
|
virtual void mousemove_event(GMouseEvent&) override;
|
2019-10-27 12:55:10 +01:00
|
|
|
|
2019-10-29 21:39:12 +01:00
|
|
|
void show_documentation_tooltip_if_available(const String&, const Point& screen_location);
|
|
|
|
|
|
|
|
|
|
explicit Editor(GWidget* parent);
|
|
|
|
|
|
|
|
|
|
RefPtr<GWindow> m_documentation_tooltip_window;
|
|
|
|
|
RefPtr<HtmlView> m_documentation_html_view;
|
2019-10-27 12:55:10 +01:00
|
|
|
};
|