diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-02-17 16:31:30 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-02-23 10:10:23 +0100 |
commit | 484d904d4dfaad9397c9599292c3abf30880d5bf (patch) | |
tree | e56af048af950ece178d7b756e5d01ac15fecaca /sd/source | |
parent | acde439959f2c178343c4c570f2512a913ae322f (diff) |
sd: initial ViewShell::libreOfficeKitCallback()
With this, typing into an empty document + pressing Esc makes those
typed characters visible.
Change-Id: I57d05f40d1bb6afa2b8c68ce1d10906203aa4bc8
Diffstat (limited to 'sd/source')
-rw-r--r-- | sd/source/ui/inc/ViewShell.hxx | 9 | ||||
-rw-r--r-- | sd/source/ui/inc/unomodel.hxx | 4 | ||||
-rw-r--r-- | sd/source/ui/unoidl/unomodel.cxx | 6 | ||||
-rw-r--r-- | sd/source/ui/view/sdwindow.cxx | 1 | ||||
-rw-r--r-- | sd/source/ui/view/viewshel.cxx | 14 |
5 files changed, 33 insertions, 1 deletions
diff --git a/sd/source/ui/inc/ViewShell.hxx b/sd/source/ui/inc/ViewShell.hxx index b4bd3331a30e..e5f082c16b51 100644 --- a/sd/source/ui/inc/ViewShell.hxx +++ b/sd/source/ui/inc/ViewShell.hxx @@ -23,6 +23,7 @@ #include <rtl/ref.hxx> #include <vcl/field.hxx> +#include <vcl/ITiledRenderable.hxx> #include <sfx2/viewsh.hxx> #include <vcl/prntypes.hxx> #include <svtools/transfer.hxx> @@ -443,6 +444,11 @@ public: SdPage* pPage, const sal_Int32 nInsertPosition = -1); + /// The actual implementation of the vcl::ITiledRenderable::registerCallback() API for Impress. + void registerLibreOfficeKitCallback(LibreOfficeKitCallback pCallback, void* pLibreOfficeKitData); + /// Invokes the registered callback, if there are any. + void libreOfficeKitCallback(int nType, const char* pPayload) const; + class Implementation; protected: @@ -576,6 +582,9 @@ private: /** Create the rulers. */ void SetupRulers (void); + + LibreOfficeKitCallback mpLibreOfficeKitCallback; + void* mpLibreOfficeKitData; }; SdrView* ViewShell::GetDrawView (void) const diff --git a/sd/source/ui/inc/unomodel.hxx b/sd/source/ui/inc/unomodel.hxx index 043d7427ea23..fbeb73ae24f1 100644 --- a/sd/source/ui/inc/unomodel.hxx +++ b/sd/source/ui/inc/unomodel.hxx @@ -240,8 +240,10 @@ public: virtual OUString getPartName( int nPart ) SAL_OVERRIDE; virtual void setPartMode( LibreOfficeKitPartMode ePartMode ) SAL_OVERRIDE; - /// @see ITiledRenderable::initializeForTiledRendering(). + /// @see vcl::ITiledRenderable::initializeForTiledRendering(). virtual void initializeForTiledRendering() SAL_OVERRIDE; + /// @see vcl::ITiledRenderable::registerCallback(). + virtual void registerCallback(LibreOfficeKitCallback pCallback, void* pData) SAL_OVERRIDE; // XComponent diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx index 556b1ee86f90..1b4c48849aec 100644 --- a/sd/source/ui/unoidl/unomodel.cxx +++ b/sd/source/ui/unoidl/unomodel.cxx @@ -2354,6 +2354,12 @@ void SdXImpressDocument::initializeForTiledRendering() mpDocShell->GetViewShell()->GetViewFrame()->GetDispatcher()->Execute(SID_VIEWSHELL0, SfxCallMode::SYNCHRON | SfxCallMode::RECORD); } +void SdXImpressDocument::registerCallback(LibreOfficeKitCallback pCallback, void* pData) +{ + SolarMutexGuard aGuard; + mpDocShell->GetViewShell()->registerLibreOfficeKitCallback(pCallback, pData); +} + uno::Reference< i18n::XForbiddenCharacters > SdXImpressDocument::getForbiddenCharsTable() { uno::Reference< i18n::XForbiddenCharacters > xForb(mxForbidenCharacters); diff --git a/sd/source/ui/view/sdwindow.cxx b/sd/source/ui/view/sdwindow.cxx index 7df5dc73a46f..a94d8eecd4f8 100644 --- a/sd/source/ui/view/sdwindow.cxx +++ b/sd/source/ui/view/sdwindow.cxx @@ -992,6 +992,7 @@ void Window::LogicInvalidate(const ::vcl::Region* pRegion) sRectangle = "EMPTY"; else sRectangle = pRegion->GetBoundRect().toString(); + mpViewShell->libreOfficeKitCallback(LOK_CALLBACK_INVALIDATE_TILES, sRectangle.getStr()); } } // end of namespace sd diff --git a/sd/source/ui/view/viewshel.cxx b/sd/source/ui/view/viewshel.cxx index 0581a7cb4238..77b024eacfdb 100644 --- a/sd/source/ui/view/viewshel.cxx +++ b/sd/source/ui/view/viewshel.cxx @@ -137,6 +137,8 @@ ViewShell::ViewShell( SfxViewFrame*, vcl::Window* pParentWindow, ViewShellBase& : SfxShell(&rViewShellBase) , mbCenterAllowed(bAllowCenter) , mpParentWindow(pParentWindow) +, mpLibreOfficeKitCallback(0) +, mpLibreOfficeKitData(0) { construct(); } @@ -1448,6 +1450,18 @@ void ViewShell::NotifyAccUpdate( ) GetViewShellBase().GetDrawController().NotifyAccUpdate(); } +void ViewShell::registerLibreOfficeKitCallback(LibreOfficeKitCallback pCallback, void* pData) +{ + mpLibreOfficeKitCallback = pCallback; + mpLibreOfficeKitData = pData; +} + +void ViewShell::libreOfficeKitCallback(int nType, const char* pPayload) const +{ + if (mpLibreOfficeKitCallback) + mpLibreOfficeKitCallback(nType, pPayload, mpLibreOfficeKitData); +} + } // end of namespace sd //===== ViewShellObjectBarFactory ============================================= |