NetSurf
|
core web search facilities interface. More...
Go to the source code of this file.
Data Structures | |
struct | gui_search_web_table |
Graphical user interface browser web search function table. More... | |
Enumerations | |
enum | search_web_omni_flags { SEARCH_WEB_OMNI_NONE = 0 , SEARCH_WEB_OMNI_SEARCHONLY = 1 } |
Flags which alter the behaviour of the omin search. More... | |
Functions | |
nserror | search_web_omni (const char *term, enum search_web_omni_flags flags, struct nsurl **url_out) |
Generate a nsurl from a search term. More... | |
nserror | search_web_get_provider_bitmap (struct bitmap **bitmap_out) |
obtain the current providers bitmap More... | |
nserror | search_web_select_provider (const char *selection) |
Change the currently selected web search provider. More... | |
ssize_t | search_web_iterate_providers (ssize_t iter, const char **name) |
Iterate the search providers, returning their names. More... | |
nserror | search_web_init (const char *provider_fname) |
Initialise the web search operations. More... | |
nserror | search_web_finalise (void) |
Finalise the web search operations freeing all resources. More... | |
core web search facilities interface.
Definition in file searchweb.h.
Flags which alter the behaviour of the omin search.
Enumerator | |
---|---|
SEARCH_WEB_OMNI_NONE | no changes to default operation |
SEARCH_WEB_OMNI_SEARCHONLY | The search does not attempt to interpret the url as a url before using it as a search term. |
Definition at line 48 of file searchweb.h.
nserror search_web_finalise | ( | void | ) |
Finalise the web search operations freeing all resources.
Definition at line 582 of file searchweb.c.
References search_web_ctx_s::default_ico_handle, hlcache_handle_release(), search_provider::ico_handle, search_provider::name, NSERROR_INIT_FAILED, NSERROR_OK, search_web_ctx_s::providers, search_web_ctx_s::providers_count, and search_web_ctx.
Referenced by netsurf_exit(), and nsbeos_scaffolding_dispatch_event().
obtain the current providers bitmap
obtain the icon representing the current web search provider
bitmap_out | recives the resulting bitmap which may be NULL |
Definition at line 370 of file searchweb.c.
References content_get_bitmap(), search_web_ctx_s::current, search_web_ctx_s::default_ico_handle, search_provider::ico_handle, NSERROR_INIT_FAILED, NSERROR_OK, search_web_ctx_s::providers, and search_web_ctx.
Referenced by make_toolbar_item_websearch().
nserror search_web_init | ( | const char * | provider_fname | ) |
Initialise the web search operations.
provider_fname | Path to web search providers file. |
Definition at line 525 of file searchweb.c.
References CONTENT_IMAGE, default_ico_callback(), search_web_ctx_s::default_ico_handle, default_providers, default_search_icon_url, hlcache_handle_retrieve(), NSERROR_NOMEM, NSERROR_OK, nsurl_create(), nsurl_unref(), parse_providers(), search_web_ctx_s::providers, search_web_ctx_s::providers_count, read_providers(), and search_web_ctx.
Referenced by main(), nsbeos_scaffolding_dispatch_event(), and nsgtk_setup().
ssize_t search_web_iterate_providers | ( | ssize_t | iter, |
const char ** | name | ||
) |
Iterate the search providers, returning their names.
from | Index to start iteration from. Use -1 to begin iteration. Use the value returned from search_web_iterate_providers to continue an iteration. |
name | Pointer to fill in with the search provider name requested. |
* ssize_t iter = -1; * const char *name; * ... * iter = search_web_iterate_providers(iter, &name); * while(iter !=-1) { * do_something_with(name); * iter = search_web_iterate_providers(iter, &name); * } *
Definition at line 506 of file searchweb.c.
References search_provider::name, search_web_ctx_s::providers, search_web_ctx_s::providers_count, and search_web_ctx.
Referenced by ami_gui_opts_websearch(), nsgtk_preferences_comboSearch_changed(), and nsgtk_preferences_comboSearch_realize().
nserror search_web_omni | ( | const char * | term, |
enum search_web_omni_flags | flags, | ||
struct nsurl ** | url_out | ||
) |
Generate a nsurl from a search term.
This interface obtains a url appropriate for the given search term. The flags allow control over the operation. By default the operations are:
term | The search term. |
flags | Flags to control operation. |
url_out | The ourput url on success. |
Definition at line 318 of file searchweb.c.
References search_web_ctx_s::current, make_search_nsurl(), NSERROR_BAD_URL, NSERROR_INIT_FAILED, NSERROR_NOMEM, NSERROR_OK, nsoption_bool, nsurl_create(), search_web_ctx_s::providers, search_web_ctx, SEARCH_WEB_OMNI_SEARCHONLY, and SLEN.
Referenced by ami_gui_event(), nsbeos_scaffolding_dispatch_event(), nsgtk_completion_match_select(), ro_gui_dialog_openurl_apply(), ro_gui_window_launch_url(), url_entry_activate_cb(), and websearch_entry_activate_cb().
nserror search_web_select_provider | ( | const char * | selection | ) |
Change the currently selected web search provider.
selection | Name of the search provider to select or NULL to reselect the current provider |
Definition at line 397 of file searchweb.c.
References content_get_bitmap(), CONTENT_IMAGE, search_web_ctx_s::current, search_web_ctx_s::default_ico_handle, guit, hlcache_handle_retrieve(), search_provider::ico, search_provider::ico_handle, search_provider::name, NSERROR_INIT_FAILED, NSERROR_OK, nsurl_create(), nsurl_unref(), gui_search_web_table::provider_update, search_web_ctx_s::providers, search_web_ctx_s::providers_count, netsurf_table::search_web, search_web_ctx, and search_web_ico_callback().
Referenced by ami_gui_event(), ami_gui_opts_use(), gui_init2(), nsgtk_preferences_comboSearch_changed(), and nsgtk_setup().