diff options
author | gokaysatir <gokaysatir@collabora.com> | 2020-09-15 11:35:16 +0300 |
---|---|---|
committer | Gökay ŞATIR <gokaysatir@collabora.com> | 2020-09-28 11:50:47 +0200 |
commit | 41f6f56c54277d3e1bb1c6fe84393b5abbc6731d (patch) | |
tree | aa3e7deebd645c30f779884dda5c88d11d46ebff | |
parent | ce520a95c246769ab41a83f8a0fc5e48c5352466 (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>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103521
Reviewed-by: Gökay ŞATIR <gokaysatir@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 | 13 | ||||
-rw-r--r-- | sc/source/ui/view/tabview3.cxx | 1 |
5 files changed, 25 insertions, 0 deletions
diff --git a/include/LibreOfficeKit/LibreOfficeKitEnums.h b/include/LibreOfficeKit/LibreOfficeKitEnums.h index 96eda9b50978..208ad9065950 100644 --- a/include/LibreOfficeKit/LibreOfficeKitEnums.h +++ b/include/LibreOfficeKit/LibreOfficeKitEnums.h @@ -747,6 +747,13 @@ typedef enum * } */ LOK_CALLBACK_FORM_FIELD_BUTTON = 49, + + /** + * 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; @@ -851,6 +858,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 db83f8e9f1f3..581237d550f0 100644 --- a/libreofficekit/source/gtk/lokdocview.cxx +++ b/libreofficekit/source/gtk/lokdocview.cxx @@ -1367,6 +1367,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 03f0763883e5..14f059df7814 100644 --- a/sc/source/ui/inc/gridwin.hxx +++ b/sc/source/ui/inc/gridwin.hxx @@ -466,6 +466,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 6e8cfc680e47..5a8bf3a1734f 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -4689,6 +4689,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 07f644d7dd5a..164771d77546 100644 --- a/sc/source/ui/view/tabview3.cxx +++ b/sc/source/ui/view/tabview3.cxx @@ -809,6 +809,7 @@ void ScTabView::TestHintWindow() if (pWindow == pWin) { xOverlayManager->add(*pOverlay); + pWindow->updateLOKInputHelp(aTitle, aMessage); } else { |