jsdialogs: introduce LOK_CALLBACK_JSDIALOG enum value

Change-Id: Ib1175dedcc8b6c66a10f81915da07b3bcfe0b3f1
Reviewed-on: https://gerrit.libreoffice.org/79717
Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
Tested-by: Szymon Kłos <szymon.klos@collabora.com>
This commit is contained in:
Szymon Kłos 2019-09-27 12:50:12 +02:00
parent 514cffddac
commit 022224b7b4
2 changed files with 30 additions and 0 deletions

View file

@ -685,6 +685,26 @@ typedef enum
* cell.
*/
LOK_CALLBACK_TABLE_SELECTED = 44,
/*
* Show reference marks from payload.
*
* Example payload:
* {
* "marks": [
* { "rectangle": "3825, 3315, 1245, 2010", "color": "0000ff", "part": "0" },
* { "rectangle": "8925, 4335, 2520, 735", "color": "ff0000", "part": "0" },
* ...
* ]
* }
*/
LOK_CALLBACK_REFERENCE_MARKS = 45,
/**
* Callback related to native dialogs generated in JavaScript from
* the description.
*/
LOK_CALLBACK_JSDIALOG = 46,
}
LibreOfficeKitCallbackType;
@ -803,6 +823,10 @@ static inline const char* lokCallbackTypeToString(int nType)
return "LOK_CALLBACK_CELL_AUTO_FILL_AREA";
case LOK_CALLBACK_TABLE_SELECTED:
return "LOK_CALLBACK_TABLE_SELECTED";
case LOK_CALLBACK_REFERENCE_MARKS:
return "LOK_CALLBACK_REFERENCE_MARKS";
case LOK_CALLBACK_JSDIALOG:
return "LOK_CALLBACK_JSDIALOG";
}
assert(!"Unknown LibreOfficeKitCallbackType type.");

View file

@ -2394,6 +2394,12 @@ void ChildSession::loKitCallback(const int type, const std::string& payload)
case LOK_CALLBACK_TABLE_SELECTED:
sendTextFrame("tableselected: " + payload);
break;
case LOK_CALLBACK_REFERENCE_MARKS:
// TODO
break;
case LOK_CALLBACK_JSDIALOG:
sendTextFrame("jsdialog: " + payload);
break;
#if !ENABLE_DEBUG
// we want a compilation-time failure in the debug builds; but ERR in the