diff options
author | Caolán McNamara <caolanm@redhat.com> | 2020-09-30 14:11:54 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2020-09-30 17:13:13 +0200 |
commit | 31342a1bda26f4e3dd29274dafd306fd0a9e7047 (patch) | |
tree | ff55c1961391d911b9e62a866b7cf38aa4ddf23a /include | |
parent | 9e129e8557370207f784cba0f40643044ead88be (diff) |
tdf#134566 accept input engine commands in editview in custom widget
for the generic case first
Change-Id: I10bd707900b54c70c9bda79d5d09532cc159779e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103692
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/editeng/editview.hxx | 14 | ||||
-rw-r--r-- | include/svx/svdedxv.hxx | 7 | ||||
-rw-r--r-- | include/svx/weldeditview.hxx | 18 | ||||
-rw-r--r-- | include/vcl/customweld.hxx | 6 | ||||
-rw-r--r-- | include/vcl/weld.hxx | 5 |
5 files changed, 30 insertions, 20 deletions
diff --git a/include/editeng/editview.hxx b/include/editeng/editview.hxx index 0692a17696db..cac588af3243 100644 --- a/include/editeng/editview.hxx +++ b/include/editeng/editview.hxx @@ -55,6 +55,7 @@ class SfxItemSet; namespace vcl { class Cursor; } namespace vcl { class Font; } class FontList; +class InputContext; class OutputDevice; enum class TransliterationFlags; enum class PointerStyle; @@ -97,18 +98,21 @@ public: // call this when text visualization changed in any way. It // will also update selection, so no need to call this self // additionally (but will also do no harm) - virtual void EditViewInvalidate(const tools::Rectangle& rRect) const = 0; + virtual void EditViewInvalidate(const tools::Rectangle& rRect) = 0; // call this when only selection is changed. Text change will // then *not* be checked and not be reacted on. Still, when // only the selection is changed, this is useful and faster - virtual void EditViewSelectionChange() const = 0; + virtual void EditViewSelectionChange() = 0; // return the OutputDevice that the EditView will draw to virtual OutputDevice& EditViewOutputDevice() const = 0; + // Triggered to update InputEngine context information + virtual void EditViewInputContext(const InputContext& rInputContext) = 0; + // implemented if drag and drop support is wanted - virtual css::uno::Reference<css::datatransfer::dnd::XDropTarget> GetDropTarget() const + virtual css::uno::Reference<css::datatransfer::dnd::XDropTarget> GetDropTarget() { return nullptr; } @@ -140,8 +144,8 @@ public: ~EditView(); // set EditViewCallbacks for external handling of Repaints/Visualization - void setEditViewCallbacks(const EditViewCallbacks* pEditViewCallbacks); - const EditViewCallbacks* getEditViewCallbacks() const; + void setEditViewCallbacks(EditViewCallbacks* pEditViewCallbacks); + EditViewCallbacks* getEditViewCallbacks() const; void SetEditEngine( EditEngine* pEditEngine ); EditEngine* GetEditEngine() const; diff --git a/include/svx/svdedxv.hxx b/include/svx/svdedxv.hxx index 192c61e3c07c..3036836a999f 100644 --- a/include/svx/svdedxv.hxx +++ b/include/svx/svdedxv.hxx @@ -65,9 +65,10 @@ class SVXCORE_DLLPUBLIC SdrObjEditView : public SdrGlueEditView, public EditView // Now derived from EditViewCallbacks and overriding these callbacks to // allow own EditText visualization - virtual void EditViewInvalidate(const tools::Rectangle& rRect) const override; - virtual void EditViewSelectionChange() const override; + virtual void EditViewInvalidate(const tools::Rectangle& rRect) override; + virtual void EditViewSelectionChange() override; virtual OutputDevice& EditViewOutputDevice() const override; + virtual void EditViewInputContext(const InputContext& rInputContext) override; // The OverlayObjects used for visualizing active TextEdit (currently // using TextEditOverlayObject, but not limited to it @@ -159,7 +160,7 @@ public: // used to call the old ImpPaintOutlinerView. Will be replaced when the // outliner will be displayed on the overlay in edit mode. - void TextEditDrawing(SdrPaintWindow& rPaintWindow) const; + void TextEditDrawing(SdrPaintWindow& rPaintWindow); // Actionhandling for macromode virtual bool IsAction() const override; diff --git a/include/svx/weldeditview.hxx b/include/svx/weldeditview.hxx index bb832e44ab6f..65396e342b27 100644 --- a/include/svx/weldeditview.hxx +++ b/include/svx/weldeditview.hxx @@ -64,23 +64,19 @@ protected: 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 EditViewInvalidate(const tools::Rectangle& rRect) override { Invalidate(rRect); } - virtual void EditViewSelectionChange() const override - { - weld::DrawingArea* pDrawingArea = GetDrawingArea(); - pDrawingArea->queue_draw(); - } + virtual void EditViewSelectionChange() override { Invalidate(); } virtual OutputDevice& EditViewOutputDevice() const override { return GetDrawingArea()->get_ref_device(); } + + virtual void EditViewInputContext(const InputContext& rInputContext) override + { + SetInputContext(rInputContext); + } }; #endif // INCLUDED_SVX_WELDEDITVIEW_HXX diff --git a/include/vcl/customweld.hxx b/include/vcl/customweld.hxx index 938308a45ca8..0b79df8d1df1 100644 --- a/include/vcl/customweld.hxx +++ b/include/vcl/customweld.hxx @@ -12,6 +12,8 @@ #include <vcl/weld.hxx> +class InputContext; + namespace weld { class VCL_DLLPUBLIC CustomWidgetController @@ -86,6 +88,10 @@ public: void SetPointer(PointerStyle ePointerStyle) { m_pDrawingArea->set_cursor(ePointerStyle); } void SetHelpId(const OString& rHelpId) { m_pDrawingArea->set_help_id(rHelpId); } void SetAccessibleName(const OUString& rName) { m_pDrawingArea->set_accessible_name(rName); } + void SetInputContext(const InputContext& rInputContext) + { + m_pDrawingArea->set_input_context(rInputContext); + } void SetDragDataTransferrable(rtl::Reference<TransferDataContainer>& rTransferrable, sal_uInt8 eDNDConstants) { diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx index 5508246e0c1c..9b2950cc8b43 100644 --- a/include/vcl/weld.hxx +++ b/include/vcl/weld.hxx @@ -46,8 +46,9 @@ typedef css::uno::Reference<css::accessibility::XAccessible> a11yref; typedef css::uno::Reference<css::accessibility::XAccessibleRelationSet> a11yrelationset; enum class PointerStyle; class CommandEvent; -class KeyEvent; class Formatter; +class InputContext; +class KeyEvent; class MouseEvent; class SvNumberFormatter; class TransferDataContainer; @@ -2066,6 +2067,8 @@ public: virtual void set_cursor(PointerStyle ePointerStyle) = 0; + virtual void set_input_context(const InputContext& rInputContext) = 0; + // use return here just to generate matching VirtualDevices virtual OutputDevice& get_ref_device() = 0; |