summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/LibreOfficeKit/LibreOfficeKitGtk.h12
-rw-r--r--libreofficekit/source/gtk/lokdocview.cxx14
2 files changed, 26 insertions, 0 deletions
diff --git a/include/LibreOfficeKit/LibreOfficeKitGtk.h b/include/LibreOfficeKit/LibreOfficeKitGtk.h
index fb18aae8aab6..15958e35644b 100644
--- a/include/LibreOfficeKit/LibreOfficeKitGtk.h
+++ b/include/LibreOfficeKit/LibreOfficeKitGtk.h
@@ -235,6 +235,18 @@ void lok_doc_view_post_command (LOKDocView*
const gchar* pArguments,
gboolean bNotifyWhenFinished);
+/**
+ * lok_doc_view_get_command_values:
+ * @pDocView: the #LOKDocView instance
+ * @pCommand: the command to issue to LO core
+ *
+ * Get a json mapping of the possible values for the given command.
+ * In the form of: {commandName: unoCmd, commandValues: {possible_values}}
+ *
+ * Returns: A json mapping of the possible values for the given command
+ */
+gchar * lok_doc_view_get_command_values (LOKDocView* pDocView,
+ const gchar* pCommand);
/**
* lok_doc_view_find_next:
diff --git a/libreofficekit/source/gtk/lokdocview.cxx b/libreofficekit/source/gtk/lokdocview.cxx
index 8dc4516d0ca5..f6fc2d8160ea 100644
--- a/libreofficekit/source/gtk/lokdocview.cxx
+++ b/libreofficekit/source/gtk/lokdocview.cxx
@@ -3742,6 +3742,20 @@ lok_doc_view_post_command (LOKDocView* pDocView,
g_info ("LOK_POST_COMMAND: ignoring commands in view-only mode");
}
+SAL_DLLPUBLIC_EXPORT gchar *
+lok_doc_view_get_command_values (LOKDocView* pDocView,
+ const gchar* pCommand)
+{
+ g_return_val_if_fail (LOK_IS_DOC_VIEW (pDocView), nullptr);
+ g_return_val_if_fail (pCommand != nullptr, nullptr);
+
+ LibreOfficeKitDocument* pDocument = lok_doc_view_get_document(pDocView);
+ if (!pDocument)
+ return nullptr;
+
+ return pDocument->pClass->getCommandValues(pDocument, pCommand);
+}
+
SAL_DLLPUBLIC_EXPORT void
lok_doc_view_find_prev (LOKDocView* pDocView,
const gchar* pText,