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 | |
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
-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 | ||||
-rw-r--r-- | include/editeng/editview.hxx | 4 | ||||
-rw-r--r-- | include/editeng/outliner.hxx | 4 | ||||
-rw-r--r-- | include/svx/svdmodel.hxx | 4 | ||||
-rw-r--r-- | svx/source/svdraw/svdedxv.cxx | 1 | ||||
-rw-r--r-- | svx/source/svdraw/svdmodel.cxx | 10 |
9 files changed, 55 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(); diff --git a/include/editeng/editview.hxx b/include/editeng/editview.hxx index 439f63b3fb78..97bd6a2f0fc5 100644 --- a/include/editeng/editview.hxx +++ b/include/editeng/editview.hxx @@ -27,6 +27,8 @@ #include <tools/color.hxx> #include <tools/gen.hxx> #include <vcl/cursor.hxx> +#define LOK_USE_UNSTABLE_API +#include <LibreOfficeKit/LibreOfficeKit.h> class EditEngine; class ImpEditEngine; @@ -171,6 +173,8 @@ public: void setTiledRendering(bool bTiledRendering); bool isTiledRendering(); + /// @see vcl::ITiledRenderable::registerCallback(). + void registerLibreOfficeKitCallback(LibreOfficeKitCallback pCallback, void* pLibreOfficeKitData); void SetControlWord( sal_uInt32 nWord ); sal_uInt32 GetControlWord() const; diff --git a/include/editeng/outliner.hxx b/include/editeng/outliner.hxx index ce25da046cb5..441183ce0ec3 100644 --- a/include/editeng/outliner.hxx +++ b/include/editeng/outliner.hxx @@ -36,6 +36,8 @@ #include <svtools/grfmgr.hxx> #include <tools/rtti.hxx> +#define LOK_USE_UNSTABLE_API +#include <LibreOfficeKit/LibreOfficeKit.h> #include <vector> class OutlinerEditEng; @@ -268,6 +270,8 @@ public: /// Set if we are doing tiled rendering. void setTiledRendering(bool bTiledRendering); + /// @see vcl::ITiledRenderable::registerCallback(). + void registerLibreOfficeKitCallback(LibreOfficeKitCallback pCallback, void* pLibreOfficeKitData); SfxItemSet GetAttribs(); diff --git a/include/svx/svdmodel.hxx b/include/svx/svdmodel.hxx index 8cd4541fba97..3f61550a42a9 100644 --- a/include/svx/svdmodel.hxx +++ b/include/svx/svdmodel.hxx @@ -343,6 +343,10 @@ public: bool isTiledRendering() const; /// The actual implementation of the vcl::ITiledRenderable::registerCallback() API. void registerLibreOfficeKitCallback(LibreOfficeKitCallback pCallback, void* pLibreOfficeKitData); + /// Gets the LOK callback registered by registerLibreOfficeKitCallback(). + LibreOfficeKitCallback getLibreOfficeKitCallback() const; + /// Gets the LOK data registered by registerLibreOfficeKitCallback(). + void* getLibreOfficeKitData() const; /// Invokes the registered callback, if there are any. void libreOfficeKitCallback(int nType, const char* pPayload) const; // If a new MapMode is set on the RefDevice (or similar) diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx index 06256965200f..5cf1ca1d34d8 100644 --- a/svx/source/svdraw/svdedxv.cxx +++ b/svx/source/svdraw/svdedxv.cxx @@ -447,6 +447,7 @@ OutlinerView* SdrObjEditView::ImpMakeOutlinerView(vcl::Window* pWin, bool /*bNoP pOutlView->SetControlWord(nStat); pOutlView->SetBackgroundColor( aBackground ); pOutlView->setTiledRendering(GetModel()->isTiledRendering()); + pOutlView->registerLibreOfficeKitCallback(GetModel()->getLibreOfficeKitCallback(), GetModel()->getLibreOfficeKitData()); if (pText!=NULL) { pOutlView->SetAnchorMode((EVAnchorMode)(pText->GetOutlinerViewAnchorMode())); diff --git a/svx/source/svdraw/svdmodel.cxx b/svx/source/svdraw/svdmodel.cxx index 66f004e6e261..9e59338bdbd3 100644 --- a/svx/source/svdraw/svdmodel.cxx +++ b/svx/source/svdraw/svdmodel.cxx @@ -820,6 +820,16 @@ void SdrModel::libreOfficeKitCallback(int nType, const char* pPayload) const mpLibreOfficeKitCallback(nType, pPayload, mpLibreOfficeKitData); } +LibreOfficeKitCallback SdrModel::getLibreOfficeKitCallback() const +{ + return mpLibreOfficeKitCallback; +} + +void* SdrModel::getLibreOfficeKitData() const +{ + return mpLibreOfficeKitData; +} + void SdrModel::ImpReformatAllTextObjects() { if( isLocked() ) |