Commit 378277b5 authored by Carlos Garcia Campos's avatar Carlos Garcia Campos

libdocument: Add API to find text with options

parent a1b6f2cc
......@@ -40,3 +40,26 @@ ev_document_find_find_text (EvDocumentFind *document_find,
return iface->find_text (document_find, page, text, case_sensitive);
}
GList *
ev_document_find_find_text_with_options (EvDocumentFind *document_find,
EvPage *page,
const gchar *text,
EvFindOptions options)
{
EvDocumentFindInterface *iface = EV_DOCUMENT_FIND_GET_IFACE (document_find);
if (iface->find_text_with_options)
return iface->find_text_with_options (document_find, page, text, options);
return ev_document_find_find_text (document_find, page, text, options & EV_FIND_CASE_SENSITIVE);
}
EvFindOptions
ev_document_find_get_supported_options (EvDocumentFind *document_find)
{
EvDocumentFindInterface *iface = EV_DOCUMENT_FIND_GET_IFACE (document_find);
if (iface->get_supported_options)
return iface->get_supported_options (document_find);
return 0;
}
......@@ -43,22 +43,38 @@ G_BEGIN_DECLS
typedef struct _EvDocumentFind EvDocumentFind;
typedef struct _EvDocumentFindInterface EvDocumentFindInterface;
typedef enum {
EV_FIND_DEFAULT = 0,
EV_FIND_CASE_SENSITIVE = 1 << 0,
EV_FIND_WHOLE_WORDS_ONLY = 1 << 1
} EvFindOptions;
struct _EvDocumentFindInterface
{
GTypeInterface base_iface;
/* Methods */
GList *(* find_text) (EvDocumentFind *document_find,
EvPage *page,
const gchar *text,
gboolean case_sensitive);
GList *(* find_text) (EvDocumentFind *document_find,
EvPage *page,
const gchar *text,
gboolean case_sensitive);
GList *(* find_text_with_options) (EvDocumentFind *document_find,
EvPage *page,
const gchar *text,
EvFindOptions options);
EvFindOptions (*get_supported_options) (EvDocumentFind *document_find);
};
GType ev_document_find_get_type (void) G_GNUC_CONST;
GList *ev_document_find_find_text (EvDocumentFind *document_find,
EvPage *page,
const gchar *text,
gboolean case_sensitive);
GType ev_document_find_get_type (void) G_GNUC_CONST;
GList *ev_document_find_find_text (EvDocumentFind *document_find,
EvPage *page,
const gchar *text,
gboolean case_sensitive);
GList *ev_document_find_find_text_with_options (EvDocumentFind *document_find,
EvPage *page,
const gchar *text,
EvFindOptions options);
EvFindOptions ev_document_find_get_supported_options (EvDocumentFind *document_find);
G_END_DECLS
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment