diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-10-05 11:30:15 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-10-05 12:05:00 +0200 |
commit | 22d342a82f225381057b5b8b941be8583de87a63 (patch) | |
tree | b6677860975bc15208d53e4e089d268a42c7549c /libreofficekit/source | |
parent | 6c040ad18bd7b5a2d1d11130f4dbfd1c9d90055d (diff) |
lokdocview: handle LOK_CALLBACK_SEARCH_RESULT_COUNT
Change-Id: I0d1b641654e0de65169e19bb5843ea11b43a90a3
Diffstat (limited to 'libreofficekit/source')
-rw-r--r-- | libreofficekit/source/gtk/lokdocview.cxx | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/libreofficekit/source/gtk/lokdocview.cxx b/libreofficekit/source/gtk/lokdocview.cxx index 8b85c451ac32..2270231b1cf5 100644 --- a/libreofficekit/source/gtk/lokdocview.cxx +++ b/libreofficekit/source/gtk/lokdocview.cxx @@ -121,6 +121,7 @@ enum SIZE_CHANGED, HYPERLINK_CLICKED, CURSOR_CHANGED, + SEARCH_RESULT_COUNT, LAST_SIGNAL }; @@ -221,6 +222,8 @@ callbackTypeToString (int nType) return "LOK_CALLBACK_STATUS_INDICATOR_FINISH"; case LOK_CALLBACK_SEARCH_NOT_FOUND: return "LOK_CALLBACK_SEARCH_NOT_FOUND"; + case LOK_CALLBACK_SEARCH_RESULT_COUNT: + return "LOK_CALLBACK_SEARCH_RESULT_COUNT"; case LOK_CALLBACK_DOCUMENT_SIZE_CHANGED: return "LOK_CALLBACK_DOCUMENT_SIZE_CHANGED"; case LOK_CALLBACK_SET_PART: @@ -363,6 +366,11 @@ searchNotFound(LOKDocView* pDocView, const std::string& rString) g_signal_emit(pDocView, doc_view_signals[SEARCH_NOT_FOUND], 0, rString.c_str()); } +static void searchResultCount(LOKDocView* pDocView, const std::string& rString) +{ + g_signal_emit(pDocView, doc_view_signals[SEARCH_RESULT_COUNT], 0, rString.c_str()); +} + static void setPart(LOKDocView* pDocView, const std::string& rString) { @@ -645,6 +653,11 @@ callback (gpointer pData) setPart(pDocView, pCallback->m_aPayload); } break; + case LOK_CALLBACK_SEARCH_RESULT_COUNT: + { + searchResultCount(pDocView, pCallback->m_aPayload); + } + break; default: g_assert(false); break; @@ -1841,6 +1854,21 @@ static void lok_doc_view_class_init (LOKDocViewClass* pClass) G_TYPE_NONE, 4, G_TYPE_INT, G_TYPE_INT, G_TYPE_INT, G_TYPE_INT); + /** + * LOKDocView::search-result-count: + * @pDocView: the #LOKDocView on which the signal is emitted + * @aCommand: number of matches. + */ + doc_view_signals[SEARCH_RESULT_COUNT] = + g_signal_new("search-result_count", + G_TYPE_FROM_CLASS(pGObjectClass), + G_SIGNAL_RUN_FIRST, + 0, + NULL, NULL, + g_cclosure_marshal_VOID__STRING, + G_TYPE_NONE, 1, + G_TYPE_STRING); + } SAL_DLLPUBLIC_EXPORT GtkWidget* |