diff options
author | gokaysatir <gokaysatir@collabora.com> | 2020-09-15 11:35:16 +0300 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2020-09-18 13:00:34 +0200 |
commit | 433996f47b5354c0d936b07ba95440ac3354c620 (patch) | |
tree | 21da0e2e2d3d1cb011bdac08377fa1d1c0de49e6 | |
parent | d676d2c22f1d092c9978ffc1595b8356d8db1f7a (diff) |
Online: Show input help on Online / Core part.
Change-Id: I9d10179f266a725b770fdae50045fdb5d77178ab
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102708
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Andras Timar <andras.timar@collabora.com>
(cherry picked from commit 110069adbba4d272450b30fa03c56efbd478e84c)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102935
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
-rw-r--r-- | include/LibreOfficeKit/LibreOfficeKitEnums.h | 9 | ||||
-rw-r--r-- | libreofficekit/source/gtk/lokdocview.cxx | 1 | ||||
-rw-r--r-- | sc/source/ui/inc/gridwin.hxx | 1 | ||||
-rw-r--r-- | sc/source/ui/view/gridwin.cxx | 14 | ||||
-rw-r--r-- | sc/source/ui/view/tabview3.cxx | 1 |
5 files changed, 26 insertions, 0 deletions
diff --git a/include/LibreOfficeKit/LibreOfficeKitEnums.h b/include/LibreOfficeKit/LibreOfficeKitEnums.h index 780b9b7ab373..750e64f529f9 100644 --- a/include/LibreOfficeKit/LibreOfficeKitEnums.h +++ b/include/LibreOfficeKit/LibreOfficeKitEnums.h @@ -766,6 +766,13 @@ typedef enum * and row-groups data have changed. */ LOK_CALLBACK_INVALIDATE_SHEET_GEOMETRY = 50, + + /** + * When for the current cell is defined an input help text. + * + * The payload format is JSON: { "title": "title text", "content": "content text" } + */ + LOK_CALLBACK_VALIDITY_INPUT_HELP = 51, } LibreOfficeKitCallbackType; @@ -870,6 +877,8 @@ static inline const char* lokCallbackTypeToString(int nType) return "LOK_CALLBACK_WINDOW"; case LOK_CALLBACK_VALIDITY_LIST_BUTTON: return "LOK_CALLBACK_VALIDITY_LIST_BUTTON"; + case LOK_CALLBACK_VALIDITY_INPUT_HELP: + return "LOK_CALLBACK_VALIDITY_INPUT_HELP"; case LOK_CALLBACK_CLIPBOARD_CHANGED: return "LOK_CALLBACK_CLIPBOARD_CHANGED"; case LOK_CALLBACK_CONTEXT_CHANGED: diff --git a/libreofficekit/source/gtk/lokdocview.cxx b/libreofficekit/source/gtk/lokdocview.cxx index 559b03fcc189..6af262bb8df2 100644 --- a/libreofficekit/source/gtk/lokdocview.cxx +++ b/libreofficekit/source/gtk/lokdocview.cxx @@ -1389,6 +1389,7 @@ callback (gpointer pData) case LOK_CALLBACK_DOCUMENT_PASSWORD: case LOK_CALLBACK_DOCUMENT_PASSWORD_TO_MODIFY: case LOK_CALLBACK_VALIDITY_LIST_BUTTON: + case LOK_CALLBACK_VALIDITY_INPUT_HELP: case LOK_CALLBACK_SIGNATURE_STATUS: case LOK_CALLBACK_CONTEXT_MENU: case LOK_CALLBACK_PROFILE_FRAME: diff --git a/sc/source/ui/inc/gridwin.hxx b/sc/source/ui/inc/gridwin.hxx index 8bdee8a55190..a3ddbc84bac1 100644 --- a/sc/source/ui/inc/gridwin.hxx +++ b/sc/source/ui/inc/gridwin.hxx @@ -475,6 +475,7 @@ public: virtual FactoryFunction GetUITestFactory() const override; void updateLOKValListButton(bool bVisible, const ScAddress& rPos) const; + void updateLOKInputHelp(const OUString& title, const OUString& content) const; protected: void ImpCreateOverlayObjects(); diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index 7ee10d644e9e..e858a9337041 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -137,6 +137,7 @@ #include <LibreOfficeKit/LibreOfficeKitEnums.h> #include <vector> +#include <boost/property_tree/json_parser.hpp> using namespace css; using namespace css::uno; @@ -4730,6 +4731,19 @@ void ScGridWindow::UpdateAutoFillMark(bool bMarked, const ScRange& rMarkRange) } } +void ScGridWindow::updateLOKInputHelp(const OUString& title, const OUString& content) const +{ + ScTabViewShell* pViewShell = pViewData->GetViewShell(); + + boost::property_tree::ptree aTree; + aTree.put("title", title); + aTree.put("content", content); + + std::stringstream aStream; + boost::property_tree::write_json(aStream, aTree); + pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_VALIDITY_INPUT_HELP, aStream.str().c_str()); +} + void ScGridWindow::updateLOKValListButton( bool bVisible, const ScAddress& rPos ) const { SCCOL nX = rPos.Col(); diff --git a/sc/source/ui/view/tabview3.cxx b/sc/source/ui/view/tabview3.cxx index 30986e02d044..ace30689b743 100644 --- a/sc/source/ui/view/tabview3.cxx +++ b/sc/source/ui/view/tabview3.cxx @@ -833,6 +833,7 @@ void ScTabView::TestHintWindow() if (pWindow == pWin) { xOverlayManager->add(*pOverlay); + pWindow->updateLOKInputHelp(aTitle, aMessage); } else { |