summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2015-09-17 10:58:56 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2015-09-21 07:30:23 +0200
commitc74ccac7cd94eba052d21cf74e03e214d58942e4 (patch)
treea5d88cbb74b4854011fe63de88f6598893baef58 /sfx2
parent714257af17f74f8bcb5acceaebb0d0f4b3be3231 (diff)
sfx2: add SfxViewShell::libreOfficeKitViewCallback()
This is similar to the existing LOK callback, the difference is that the existing one assumes there is only one SfxViewShell instance at the same time. This newer callback is precisely per-view, so model notifications can invoke all view callbacks, while view notifications can invoke only the callback of the relevant view. This is just the framework, all actual client code has to be still ported over (and then the existing callback can be removed). Change-Id: I3d8f27740c69fcf6ffbbdce12db2ea088321493d
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/view/viewimp.hxx3
-rw-r--r--sfx2/source/view/viewsh.cxx14
2 files changed, 17 insertions, 0 deletions
diff --git a/sfx2/source/view/viewimp.hxx b/sfx2/source/view/viewimp.hxx
index 49005931d2b1..b832b15ed4b6 100644
--- a/sfx2/source/view/viewimp.hxx
+++ b/sfx2/source/view/viewimp.hxx
@@ -64,6 +64,9 @@ struct SfxViewShell_Impl
mutable SfxInPlaceClientList* mpIPClientList;
+ LibreOfficeKitCallback m_pLibreOfficeKitViewCallback;
+ void* m_pLibreOfficeKitViewData;
+
explicit SfxViewShell_Impl(SfxViewShellFlags const nFlags);
~SfxViewShell_Impl();
diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx
index 62ed8bd485d8..2b9ac3dab401 100644
--- a/sfx2/source/view/viewsh.cxx
+++ b/sfx2/source/view/viewsh.cxx
@@ -309,6 +309,8 @@ SfxViewShell_Impl::SfxViewShell_Impl(SfxViewShellFlags const nFlags)
, m_nFamily(0xFFFF) // undefined, default set by TemplateDialog
, m_pController(0)
, mpIPClientList(NULL)
+, m_pLibreOfficeKitViewCallback(0)
+, m_pLibreOfficeKitViewData(0)
{}
SfxViewShell_Impl::~SfxViewShell_Impl()
@@ -1631,6 +1633,18 @@ bool SfxViewShell::ExecKey_Impl(const KeyEvent& aKey)
return pImp->m_xAccExec->execute(aKey.GetKeyCode());
}
+void SfxViewShell::registerLibreOfficeKitViewCallback(LibreOfficeKitCallback pCallback, void* pData)
+{
+ pImp->m_pLibreOfficeKitViewCallback = pCallback;
+ pImp->m_pLibreOfficeKitViewData = pData;
+}
+
+void SfxViewShell::libreOfficeKitViewCallback(int nType, const char* pPayload) const
+{
+ if (pImp->m_pLibreOfficeKitViewCallback)
+ pImp->m_pLibreOfficeKitViewCallback(nType, pPayload, pImp->m_pLibreOfficeKitViewData);
+}
+
bool SfxViewShell::KeyInput( const KeyEvent &rKeyEvent )
/* [Description]