diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-03-12 13:08:49 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-03-16 09:38:08 +0100 |
commit | 4a8afa003b854e74807389c8f82fd4609485f1b8 (patch) | |
tree | 16a66fe3adecff4a98e09d5fb3134a857e0fa504 /editeng | |
parent | 5666552a07c0f742087cf987679ffeb5fa99b1a4 (diff) |
Add ImpEditView::libreOfficeKitCallback()
And various other methods, so that it's possible to invoke the callback
in ImpEditView. This will be needed by the blinking editeng cursor.
Change-Id: Ie1b6957e5c48f606e71d5808df3f632924d3a2ec
Diffstat (limited to 'editeng')
-rw-r--r-- | editeng/source/editeng/editview.cxx | 5 | ||||
-rw-r--r-- | editeng/source/editeng/impedit.cxx | 14 | ||||
-rw-r--r-- | editeng/source/editeng/impedit.hxx | 8 | ||||
-rw-r--r-- | editeng/source/outliner/outlvw.cxx | 5 |
4 files changed, 32 insertions, 0 deletions
diff --git a/editeng/source/editeng/editview.cxx b/editeng/source/editeng/editview.cxx index cfd4fc5de5f4..4db189260d64 100644 --- a/editeng/source/editeng/editview.cxx +++ b/editeng/source/editeng/editview.cxx @@ -582,6 +582,11 @@ bool EditView::isTiledRendering() return pImpEditView->isTiledRendering(); } +void EditView::registerLibreOfficeKitCallback(LibreOfficeKitCallback pCallback, void* pLibreOfficeKitData) +{ + pImpEditView->registerLibreOfficeKitCallback(pCallback, pLibreOfficeKitData); +} + void EditView::SetControlWord( sal_uInt32 nWord ) { pImpEditView->nControl = nWord; diff --git a/editeng/source/editeng/impedit.cxx b/editeng/source/editeng/impedit.cxx index ed543cbbcf2e..633593b4126b 100644 --- a/editeng/source/editeng/impedit.cxx +++ b/editeng/source/editeng/impedit.cxx @@ -76,6 +76,8 @@ ImpEditView::ImpEditView( EditView* pView, EditEngine* pEng, vcl::Window* pWindo pPointer = NULL; pBackgroundColor = NULL; mbTiledRendering = false; + mpLibreOfficeKitCallback = 0; + mpLibreOfficeKitData = 0; nScrollDiffX = 0; nExtraCursorFlags = 0; nCursorBidiLevel = CURSOR_BIDILEVEL_DONTKNOW; @@ -123,6 +125,18 @@ bool ImpEditView::isTiledRendering() const return mbTiledRendering; } +void ImpEditView::registerLibreOfficeKitCallback(LibreOfficeKitCallback pCallback, void* pData) +{ + mpLibreOfficeKitCallback = pCallback; + mpLibreOfficeKitData = pData; +} + +void ImpEditView::libreOfficeKitCallback(int nType, const char* pPayload) const +{ + if (mpLibreOfficeKitCallback) + mpLibreOfficeKitCallback(nType, pPayload, mpLibreOfficeKitData); +} + void ImpEditView::SetEditSelection( const EditSelection& rEditSelection ) { // set state before notification diff --git a/editeng/source/editeng/impedit.hxx b/editeng/source/editeng/impedit.hxx index 5ec289bbfec3..613d25eda629 100644 --- a/editeng/source/editeng/impedit.hxx +++ b/editeng/source/editeng/impedit.hxx @@ -52,6 +52,8 @@ #include <i18nlangtag/lang.h> #include <rtl/ref.hxx> +#define LOK_USE_UNSTABLE_API +#include <LibreOfficeKit/LibreOfficeKit.h> #include <boost/noncopyable.hpp> @@ -217,6 +219,8 @@ private: vcl::Cursor* pCursor; Color* pBackgroundColor; bool mbTiledRendering; + LibreOfficeKitCallback mpLibreOfficeKitCallback; + void* mpLibreOfficeKitData; EditEngine* pEditEngine; vcl::Window* pOutWin; Pointer* pPointer; @@ -367,6 +371,10 @@ public: void setTiledRendering(bool bTiledRendering); bool isTiledRendering() const; + /// @see vcl::ITiledRenderable::registerCallback(). + void registerLibreOfficeKitCallback(LibreOfficeKitCallback pCallback, void* pLibreOfficeKitData); + /// Invokes the registered callback, if there are any. + void libreOfficeKitCallback(int nType, const char* pPayload) const; bool IsWrongSpelledWord( const EditPaM& rPaM, bool bMarkIfWrong ); OUString SpellIgnoreOrAddWord( bool bAdd ); diff --git a/editeng/source/outliner/outlvw.cxx b/editeng/source/outliner/outlvw.cxx index 9e61056d019e..bd2b0845ec70 100644 --- a/editeng/source/outliner/outlvw.cxx +++ b/editeng/source/outliner/outlvw.cxx @@ -1425,6 +1425,11 @@ void OutlinerView::setTiledRendering(bool bTiledRendering) pEditView->setTiledRendering(bTiledRendering); } +void OutlinerView::registerLibreOfficeKitCallback(LibreOfficeKitCallback pCallback, void* pLibreOfficeKitData) +{ + pEditView->registerLibreOfficeKitCallback(pCallback, pLibreOfficeKitData); +} + Color OutlinerView::GetBackgroundColor() { return pEditView->GetBackgroundColor(); |