mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-12-24 04:56:50 +03:00
Add call to test whether a browser window may be searched.
This commit is contained in:
parent
10154d0e18
commit
03e7605bcf
@ -443,6 +443,22 @@ char * browser_window_get_selection(struct browser_window *bw)
|
||||
return content_get_selection(bw->selection.bw->current_content);
|
||||
}
|
||||
|
||||
/* exported interface, documented in browser.h */
|
||||
bool browser_window_can_search(struct browser_window *bw)
|
||||
{
|
||||
if (bw == NULL || bw->current_content == NULL)
|
||||
return false;
|
||||
|
||||
/* TODO: We shouldn't have to know about specific content types
|
||||
* here. There should be a content_is_searchable() call. */
|
||||
if (content_get_type(bw->current_content) != CONTENT_HTML &&
|
||||
content_get_type(bw->current_content) !=
|
||||
CONTENT_TEXTPLAIN)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set or remove a selection.
|
||||
*
|
||||
|
@ -462,6 +462,14 @@ browser_editor_flags browser_window_get_editor_flags(struct browser_window *bw);
|
||||
*/
|
||||
char * browser_window_get_selection(struct browser_window *bw);
|
||||
|
||||
/**
|
||||
* Find out if given browser window can be searched
|
||||
*
|
||||
* \param bw browser window to look at
|
||||
* \return true iff browser window is searchable
|
||||
*/
|
||||
bool browser_window_can_search(struct browser_window *bw);
|
||||
|
||||
|
||||
/**
|
||||
* Dump debug info concerning the browser window's contents to file
|
||||
|
Loading…
Reference in New Issue
Block a user