diff options
-rw-r--r-- | include/LibreOfficeKit/LibreOfficeKitEnums.h | 32 | ||||
-rw-r--r-- | libreofficekit/source/gtk/lokdocview.cxx | 68 |
2 files changed, 94 insertions, 6 deletions
diff --git a/include/LibreOfficeKit/LibreOfficeKitEnums.h b/include/LibreOfficeKit/LibreOfficeKitEnums.h index 9cf635bb4c40..46be3f25fea8 100644 --- a/include/LibreOfficeKit/LibreOfficeKitEnums.h +++ b/include/LibreOfficeKit/LibreOfficeKitEnums.h @@ -514,11 +514,12 @@ typedef enum * The column/row header is no more valid because of a column/row insertion * or a similar event. Clients must query a new column/row header set. * - * The payload says if we are invalidating a row or column header. + * The payload says if we are invalidating a row or column header. So, + * payload values can be: "row", "column", "all". */ LOK_CALLBACK_INVALIDATE_HEADER = 33, /** - * The text content of the address field in Calc. + * The text content of the address field in Calc. Eg: "A7" */ LOK_CALLBACK_CELL_ADDRESS = 34, /** @@ -539,7 +540,32 @@ typedef enum */ LOK_CALLBACK_RULER_UPDATE = 35, /** - * Dialog invalidation + * Window related callbacks are emitted under this category. It includes + * external windows like dialogs, autopopups for now. + * + * The payload format is: + * + * { + * "id": "unique integer id of the dialog", + * "action": "<see below>", + * "type": "<see below>" + * "rectangle": "x, y, width, height" + * } + * + * "type" tells the type of the window the action is associated with + * - "dialog" - window is a dialog + * - "child" - window is a floating window (combo boxes, etc.) + * + * "action" can take following values: + * - "created" - window is created in the backend, client can render it now + * - "title_changed" - window's title is changed + * - "size_changed" - window's size is changed + * - "invalidate" - the area as described by "rectangle" is invalidated + * Clients must request the new area + * - "cursor_invalidate" - cursor is invalidated. New position is in "rectangle" + * - "cursor_visible" - cursor visible status is changed. Status is availabe + * in "visible" field + * - "close" - window is closed */ LOK_CALLBACK_WINDOW = 36, } diff --git a/libreofficekit/source/gtk/lokdocview.cxx b/libreofficekit/source/gtk/lokdocview.cxx index 9070cb902236..f2609149de06 100644 --- a/libreofficekit/source/gtk/lokdocview.cxx +++ b/libreofficekit/source/gtk/lokdocview.cxx @@ -275,6 +275,7 @@ enum COMMENT, RULER, WINDOW, + INVALIDATE_HEADER, LAST_SIGNAL }; @@ -428,6 +429,8 @@ callbackTypeToString (int nType) return "LOK_CALLBACK_REDLINE_TABLE_SIZE_CHANGED"; case LOK_CALLBACK_REDLINE_TABLE_ENTRY_MODIFIED: return "LOK_CALLBACK_REDLINE_TABLE_ENTRY_MODIFIED"; + case LOK_CALLBACK_INVALIDATE_HEADER: + return "LOK_CALLBACK_INVALIDATE_HEADER"; case LOK_CALLBACK_COMMENT: return "LOK_CALLBACK_COMMENT"; case LOK_CALLBACK_RULER_UPDATE: @@ -1410,6 +1413,9 @@ callback (gpointer pData) case LOK_CALLBACK_WINDOW: g_signal_emit(pCallback->m_pDocView, doc_view_signals[WINDOW], 0, pCallback->m_aPayload.c_str()); break; + case LOK_CALLBACK_INVALIDATE_HEADER: + g_signal_emit(pCallback->m_pDocView, doc_view_signals[INVALIDATE_HEADER], 0, pCallback->m_aPayload.c_str()); + break; default: g_assert(false); break; @@ -3198,6 +3204,22 @@ static void lok_doc_view_class_init (LOKDocViewClass* pClass) G_TYPE_NONE, 1, G_TYPE_STRING); + /** + * The key ruler related properties on change are reported by this. + * + * The payload format is: + * + * { + * "margin1": "...", + * "margin2": "...", + * "leftOffset": "...", + * "pageOffset": "...", + * "pageWidth": "...", + * "unit": "..." + * } + * + * Here all aproperties are same as described in svxruler. + */ doc_view_signals[RULER] = g_signal_new("ruler", G_TYPE_FROM_CLASS(pGObjectClass), @@ -3209,9 +3231,32 @@ static void lok_doc_view_class_init (LOKDocViewClass* pClass) G_TYPE_STRING); /** - * LOKDocView::window - * @pDocView: the #LOKDocView on which the signal is emitted - * @pPayload: JSON containing the information, including id, about the window + * Window related callbacks are emitted under this category. It includes + * external windows like dialogs, autopopups for now. + * + * The payload format is: + * + * { + * "id": "unique integer id of the dialog", + * "action": "<see below>", + * "type": "<see below>" + * "rectangle": "x, y, width, height" + * } + * + * "type" tells the type of the window the action is associated with + * - "dialog" - window is a dialog + * - "child" - window is a floating window (combo boxes, etc.) + * + * "action" can take following values: + * - "created" - window is created in the backend, client can render it now + * - "title_changed" - window's title is changed + * - "size_changed" - window's size is changed + * - "invalidate" - the area as described by "rectangle" is invalidated + * Clients must request the new area + * - "cursor_invalidate" - cursor is invalidated. New position is in "rectangle" + * - "cursor_visible" - cursor visible status is changed. Status is availabe + * in "visible" field + * - "close" - window is closed */ doc_view_signals[WINDOW] = g_signal_new("window", @@ -3222,6 +3267,23 @@ static void lok_doc_view_class_init (LOKDocViewClass* pClass) g_cclosure_marshal_generic, G_TYPE_NONE, 1, G_TYPE_STRING); + + /** + * The column/row header is no more valid because of a column/row insertion + * or a similar event. Clients must query a new column/row header set. + * + * The payload says if we are invalidating a row or column header. So, + * payload values can be: "row", "column", "all". + */ + doc_view_signals[INVALIDATE_HEADER] = + g_signal_new("invalidate-header", + G_TYPE_FROM_CLASS(pGObjectClass), + G_SIGNAL_RUN_FIRST, + 0, + nullptr, nullptr, + g_cclosure_marshal_generic, + G_TYPE_NONE, 1, + G_TYPE_STRING); } SAL_DLLPUBLIC_EXPORT GtkWidget* |