2003-06-30 16:44:03 +04:00
|
|
|
/*
|
2007-01-13 03:21:15 +03:00
|
|
|
* Copyright 2005-2007 James Bursa <bursa@users.sourceforge.net>
|
2003-06-30 16:44:03 +04:00
|
|
|
* Copyright 2003 Philip Pemberton <philpem@users.sourceforge.net>
|
2007-08-08 20:16:03 +04:00
|
|
|
*
|
|
|
|
* This file is part of NetSurf, http://www.netsurf-browser.org/
|
|
|
|
*
|
|
|
|
* NetSurf is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; version 2 of the License.
|
|
|
|
*
|
|
|
|
* NetSurf is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2003-02-09 15:58:15 +03:00
|
|
|
*/
|
|
|
|
|
2016-06-06 10:59:23 +03:00
|
|
|
/**
|
|
|
|
* \file
|
|
|
|
* Content handling interface.
|
2003-09-08 01:08:13 +04:00
|
|
|
*
|
|
|
|
* The content functions manipulate struct contents, which correspond to URLs.
|
|
|
|
*/
|
|
|
|
|
2020-05-07 22:55:44 +03:00
|
|
|
#ifndef NETSURF_CONTENT_CONTENT_H_
|
|
|
|
#define NETSURF_CONTENT_CONTENT_H_
|
2003-02-09 15:58:15 +03:00
|
|
|
|
2011-05-07 00:40:09 +04:00
|
|
|
#include <libwapcaplet/libwapcaplet.h>
|
|
|
|
|
2016-04-19 01:04:16 +03:00
|
|
|
#include "desktop/search.h" /* search flags enum */
|
2020-05-07 22:55:44 +03:00
|
|
|
#include "netsurf/content_type.h"
|
2016-05-30 14:07:16 +03:00
|
|
|
#include "netsurf/mouse.h" /* mouse state enums */
|
2019-05-05 23:05:27 +03:00
|
|
|
#include "netsurf/console.h" /* console state and flags enums */
|
2003-02-09 15:58:15 +03:00
|
|
|
|
2004-08-11 23:02:32 +04:00
|
|
|
struct browser_window;
|
2014-11-02 18:46:42 +03:00
|
|
|
struct browser_window_features;
|
2004-08-11 23:02:32 +04:00
|
|
|
struct content;
|
2010-04-06 01:35:38 +04:00
|
|
|
struct llcache_handle;
|
2010-03-28 16:56:39 +04:00
|
|
|
struct hlcache_handle;
|
2004-08-11 23:02:32 +04:00
|
|
|
struct object_params;
|
2011-02-14 01:25:11 +03:00
|
|
|
struct rect;
|
2011-06-30 19:48:07 +04:00
|
|
|
struct redraw_context;
|
2020-02-23 19:06:52 +03:00
|
|
|
struct cert_chain;
|
2011-06-30 19:48:07 +04:00
|
|
|
|
2014-11-07 15:33:34 +03:00
|
|
|
|
2011-10-07 22:12:47 +04:00
|
|
|
/** RFC5988 metadata link */
|
|
|
|
struct content_rfc5988_link {
|
|
|
|
struct content_rfc5988_link *next; /**< next rfc5988_link in list */
|
|
|
|
|
|
|
|
lwc_string *rel; /**< the link relationship - must be present */
|
2015-02-26 19:13:41 +03:00
|
|
|
struct nsurl *href; /**< the link href - must be present */
|
2011-10-07 22:12:47 +04:00
|
|
|
lwc_string *hreflang;
|
|
|
|
lwc_string *type;
|
|
|
|
lwc_string *media;
|
|
|
|
lwc_string *sizes;
|
|
|
|
};
|
|
|
|
|
2004-04-25 03:42:32 +04:00
|
|
|
/** Extra data for some content_msg messages. */
|
|
|
|
union content_msg_data {
|
2020-02-22 23:59:44 +03:00
|
|
|
/**
|
|
|
|
* CONTENT_MSG_LOG - Information for logging
|
|
|
|
*/
|
2019-05-05 23:05:27 +03:00
|
|
|
struct {
|
2020-02-22 23:59:44 +03:00
|
|
|
/** The source of the logging */
|
|
|
|
browser_window_console_source src;
|
|
|
|
/** The message to log */
|
|
|
|
const char *msg;
|
|
|
|
/** The length of that message */
|
|
|
|
size_t msglen;
|
|
|
|
/** The flags of the logging */
|
|
|
|
browser_window_console_flags flags;
|
2019-05-05 23:05:27 +03:00
|
|
|
} log;
|
2020-02-22 23:59:44 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* CONTENT_MSG_SSL_CERTS - The certificate chain from the
|
|
|
|
* underlying fetch
|
|
|
|
*/
|
2020-02-23 19:06:52 +03:00
|
|
|
const struct cert_chain *chain;
|
2020-02-22 23:59:44 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* CONTENT_MSG_ERROR - Error from content or underlying fetch
|
|
|
|
*/
|
2019-08-05 16:29:53 +03:00
|
|
|
struct {
|
2020-02-22 23:59:44 +03:00
|
|
|
/**
|
|
|
|
* The error code to convey meaning
|
|
|
|
*/
|
|
|
|
nserror errorcode;
|
|
|
|
/**
|
|
|
|
* The message. if NSERROR_UNKNOWN then this is the direct
|
|
|
|
* message, otherwise is some kind of metadata (e.g. a
|
|
|
|
* message name or somesuch) but always a null terminated
|
|
|
|
* string.
|
|
|
|
*/
|
|
|
|
const char *errormsg;
|
2019-08-05 16:29:53 +03:00
|
|
|
} errordata;
|
2020-02-22 23:59:44 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* CONTENT_MSG_REDIRECT - Redirect info
|
|
|
|
*/
|
2013-05-27 17:51:00 +04:00
|
|
|
struct {
|
2015-02-26 19:13:41 +03:00
|
|
|
struct nsurl *from; /**< Redirect origin */
|
|
|
|
struct nsurl *to; /**< Redirect target */
|
2013-05-27 17:51:00 +04:00
|
|
|
} redirect; /**< Fetch URL redirect occured */
|
2020-02-22 23:59:44 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* CONTENT_MSG_REDRAW - Area of content which needs redrawing
|
|
|
|
*/
|
2004-04-25 03:42:32 +04:00
|
|
|
struct {
|
2011-03-03 00:10:29 +03:00
|
|
|
int x, y, width, height;
|
2004-04-25 03:42:32 +04:00
|
|
|
} redraw;
|
2020-02-22 23:59:44 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* CONTENT_MSG_REFRESH - Minimum delay
|
|
|
|
*/
|
2012-08-15 22:00:50 +04:00
|
|
|
int delay;
|
2020-02-22 23:59:44 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* CONTENT_MSG_REFORMAT - Reformat should not cause a redraw
|
|
|
|
*/
|
2011-06-24 13:30:33 +04:00
|
|
|
bool background;
|
2020-02-22 23:59:44 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* CONTENT_MSG_STATUS - Status message update. If NULL, the
|
|
|
|
* content's internal status text has been updated, and
|
|
|
|
* listener should use content_get_status_message()
|
|
|
|
*/
|
2012-08-15 22:00:50 +04:00
|
|
|
const char *explicit_status_text;
|
2020-02-22 23:59:44 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* CONTENT_MSG_DOWNLOAD - Low-level cache handle
|
|
|
|
*/
|
2010-04-06 01:35:38 +04:00
|
|
|
struct llcache_handle *download;
|
2020-02-22 23:59:44 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* CONTENT_MSG_RFC5988_LINK - rfc5988 link data
|
|
|
|
*/
|
2011-10-07 22:12:47 +04:00
|
|
|
struct content_rfc5988_link *rfc5988_link;
|
2020-02-22 23:59:44 +03:00
|
|
|
|
|
|
|
/**
|
2020-03-21 21:30:41 +03:00
|
|
|
* CONTENT_MSG_GETTHREAD - Javascript context (thread)
|
2020-02-22 23:59:44 +03:00
|
|
|
*/
|
2020-03-21 21:30:41 +03:00
|
|
|
struct jsthread **jsthread;
|
2020-02-22 23:59:44 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* CONTENT_MSG_GETDIMS - Get the viewport dimensions
|
|
|
|
*/
|
2019-05-06 17:34:25 +03:00
|
|
|
struct {
|
2020-02-22 23:59:44 +03:00
|
|
|
/** \todo Consider getting screen_width, screen_height too. */
|
2019-05-06 17:34:25 +03:00
|
|
|
unsigned *viewport_width;
|
|
|
|
unsigned *viewport_height;
|
|
|
|
} getdims;
|
2020-02-22 23:59:44 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* CONTENT_MSG_SCROLL - Part of content to scroll to show
|
|
|
|
*/
|
2012-08-14 01:54:18 +04:00
|
|
|
struct {
|
2020-02-22 23:59:44 +03:00
|
|
|
/*
|
|
|
|
* if true, scroll to show area given by (x0, y0) and (x1,y1).
|
|
|
|
* if false, scroll point (x0, y0) to top left of viewport
|
|
|
|
*/
|
2012-08-14 01:54:18 +04:00
|
|
|
bool area;
|
|
|
|
int x0, y0;
|
|
|
|
int x1, y1;
|
|
|
|
} scroll;
|
2020-02-22 23:59:44 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* CONTENT_MSG_DRAGSAVE - Drag save a content
|
|
|
|
*/
|
2012-08-16 23:20:49 +04:00
|
|
|
struct {
|
|
|
|
enum {
|
|
|
|
CONTENT_SAVE_ORIG,
|
|
|
|
CONTENT_SAVE_NATIVE,
|
|
|
|
CONTENT_SAVE_COMPLETE,
|
|
|
|
CONTENT_SAVE_SOURCE
|
|
|
|
} type;
|
2012-08-19 15:46:42 +04:00
|
|
|
/** if NULL, save the content generating the message */
|
2012-08-16 23:20:49 +04:00
|
|
|
struct hlcache_handle *content;
|
|
|
|
} dragsave;
|
2020-02-22 23:59:44 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* CONTENT_MSG_SAVELINK - Save a URL
|
|
|
|
*/
|
2012-08-17 02:26:05 +04:00
|
|
|
struct {
|
2015-02-26 19:13:41 +03:00
|
|
|
struct nsurl *url;
|
2012-08-17 02:26:05 +04:00
|
|
|
const char *title;
|
|
|
|
} savelink;
|
2020-02-22 23:59:44 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* CONTENT_MSG_POINTER - Mouse pointer to set
|
|
|
|
*/
|
2012-08-17 13:01:15 +04:00
|
|
|
browser_pointer_shape pointer;
|
2020-02-22 23:59:44 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* CONTENT_MSG_SELECTION - Selection made or cleared
|
|
|
|
*/
|
2013-02-22 16:19:35 +04:00
|
|
|
struct {
|
|
|
|
bool selection; /**< false for selection cleared */
|
|
|
|
bool read_only;
|
|
|
|
} selection;
|
2020-02-22 23:59:44 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* CONTENT_MSG_CARET - set caret position or, hide caret
|
|
|
|
*/
|
2013-02-22 16:19:35 +04:00
|
|
|
struct {
|
|
|
|
enum {
|
|
|
|
CONTENT_CARET_SET_POS,
|
|
|
|
CONTENT_CARET_HIDE,
|
|
|
|
CONTENT_CARET_REMOVE
|
|
|
|
} type;
|
|
|
|
struct {
|
|
|
|
int x; /**< Carret x-coord */
|
|
|
|
int y; /**< Carret y-coord */
|
|
|
|
int height; /**< Carret height */
|
|
|
|
const struct rect *clip; /**< Carret clip rect */
|
|
|
|
} pos; /**< With CONTENT_CARET_SET_POS */
|
|
|
|
} caret;
|
2020-02-22 23:59:44 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* CONTENT_MSG_DRAG - Drag start or end
|
|
|
|
*/
|
2012-08-19 01:19:15 +04:00
|
|
|
struct {
|
2013-02-08 17:22:53 +04:00
|
|
|
enum {
|
|
|
|
CONTENT_DRAG_NONE,
|
|
|
|
CONTENT_DRAG_SCROLL,
|
|
|
|
CONTENT_DRAG_SELECTION
|
|
|
|
} type;
|
|
|
|
const struct rect *rect;
|
|
|
|
} drag;
|
2020-02-22 23:59:44 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* CONTENT_MSG_SELECTMENU - Create select menu at pointer
|
|
|
|
*/
|
2014-10-24 20:57:15 +04:00
|
|
|
struct {
|
|
|
|
struct form_control *gadget;
|
|
|
|
} select_menu;
|
2020-02-22 23:59:44 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* CONTENT_MSG_GADGETCLICK - User clicked on a form gadget
|
|
|
|
*/
|
2014-01-05 20:04:35 +04:00
|
|
|
struct {
|
|
|
|
struct form_control *gadget;
|
|
|
|
} gadget_click;
|
2020-05-13 20:03:22 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* CONTENT_MSG_TEXTSEARCH - Free text search action
|
|
|
|
*/
|
|
|
|
struct {
|
|
|
|
/**
|
|
|
|
* The type of text search operation
|
|
|
|
*/
|
|
|
|
enum {
|
|
|
|
/**
|
|
|
|
* Free text search find operation has started or finished
|
|
|
|
*/
|
|
|
|
CONTENT_TEXTSEARCH_FIND,
|
|
|
|
/**
|
|
|
|
* Free text search match state has changed
|
|
|
|
*/
|
|
|
|
CONTENT_TEXTSEARCH_MATCH,
|
|
|
|
/**
|
|
|
|
* Free text search back available state changed
|
|
|
|
*/
|
|
|
|
CONTENT_TEXTSEARCH_BACK,
|
|
|
|
/**
|
|
|
|
* Free text search forward available state changed
|
|
|
|
*/
|
|
|
|
CONTENT_TEXTSEARCH_FORWARD,
|
|
|
|
/**
|
|
|
|
* add a search query string to the recent searches
|
|
|
|
*/
|
|
|
|
CONTENT_TEXTSEARCH_RECENT
|
|
|
|
} type;
|
|
|
|
/**
|
|
|
|
* context passed to browser_window_search()
|
|
|
|
*/
|
|
|
|
void *ctx;
|
|
|
|
/**
|
|
|
|
* state for operation
|
|
|
|
*/
|
|
|
|
bool state;
|
|
|
|
/**
|
|
|
|
* search string
|
|
|
|
*/
|
|
|
|
const char *string;
|
|
|
|
} textsearch;
|
|
|
|
|
2004-04-25 03:42:32 +04:00
|
|
|
};
|
|
|
|
|
2011-06-29 00:17:39 +04:00
|
|
|
|
2020-05-07 01:38:50 +03:00
|
|
|
/**
|
|
|
|
* Get whether a content can reformat
|
|
|
|
*
|
|
|
|
* \param h content to check
|
|
|
|
* \return whether the content can reformat
|
|
|
|
*/
|
2010-03-28 16:56:39 +04:00
|
|
|
bool content_can_reformat(struct hlcache_handle *h);
|
2016-06-06 10:59:23 +03:00
|
|
|
|
2020-05-07 01:38:50 +03:00
|
|
|
/**
|
|
|
|
* Reformat to new size.
|
|
|
|
*
|
|
|
|
* Calls the reformat function for the content.
|
|
|
|
*/
|
2011-06-24 13:30:33 +04:00
|
|
|
void content_reformat(struct hlcache_handle *h, bool background,
|
|
|
|
int width, int height);
|
2016-06-06 10:59:23 +03:00
|
|
|
|
2020-05-07 01:38:50 +03:00
|
|
|
/**
|
|
|
|
* Request a redraw of an area of a content
|
|
|
|
*
|
|
|
|
* \param h high-level cache handle
|
|
|
|
* \param x x co-ord of left edge
|
|
|
|
* \param y y co-ord of top edge
|
|
|
|
* \param width Width of rectangle
|
|
|
|
* \param height Height of rectangle
|
|
|
|
*/
|
2010-03-28 16:56:39 +04:00
|
|
|
void content_request_redraw(struct hlcache_handle *h,
|
|
|
|
int x, int y, int width, int height);
|
2016-06-06 10:59:23 +03:00
|
|
|
|
2020-05-07 01:38:50 +03:00
|
|
|
/**
|
|
|
|
* Handle mouse movements in a content window.
|
|
|
|
*
|
|
|
|
* \param h Content handle
|
|
|
|
* \param bw browser window
|
|
|
|
* \param mouse state of mouse buttons and modifier keys
|
|
|
|
* \param x coordinate of mouse
|
|
|
|
* \param y coordinate of mouse
|
|
|
|
*/
|
2010-06-04 13:35:08 +04:00
|
|
|
void content_mouse_track(struct hlcache_handle *h, struct browser_window *bw,
|
|
|
|
browser_mouse_state mouse, int x, int y);
|
2016-06-06 10:59:23 +03:00
|
|
|
|
2020-05-07 01:38:50 +03:00
|
|
|
/**
|
|
|
|
* Handle mouse clicks and movements in a content window.
|
|
|
|
*
|
|
|
|
* \param h Content handle
|
|
|
|
* \param bw browser window
|
|
|
|
* \param mouse state of mouse buttons and modifier keys
|
|
|
|
* \param x coordinate of mouse
|
|
|
|
* \param y coordinate of mouse
|
|
|
|
*
|
|
|
|
* This function handles both hovering and clicking. It is important that the
|
|
|
|
* code path is identical (except that hovering doesn't carry out the action),
|
|
|
|
* so that the status bar reflects exactly what will happen. Having separate
|
|
|
|
* code paths opens the possibility that an attacker will make the status bar
|
|
|
|
* show some harmless action where clicking will be harmful.
|
|
|
|
*/
|
2010-06-04 13:35:08 +04:00
|
|
|
void content_mouse_action(struct hlcache_handle *h, struct browser_window *bw,
|
|
|
|
browser_mouse_state mouse, int x, int y);
|
2015-04-23 17:47:28 +03:00
|
|
|
|
2020-05-07 01:38:50 +03:00
|
|
|
/**
|
|
|
|
* Handle keypresses.
|
|
|
|
*
|
|
|
|
* \param h Content handle
|
|
|
|
* \param key The UCS4 character codepoint
|
|
|
|
* \return true if key handled, false otherwise
|
|
|
|
*/
|
2016-06-06 10:59:23 +03:00
|
|
|
bool content_keypress(struct hlcache_handle *h, uint32_t key);
|
2015-04-23 17:47:28 +03:00
|
|
|
|
|
|
|
|
2020-05-07 01:38:50 +03:00
|
|
|
/**
|
|
|
|
* A window containing the content has been opened.
|
|
|
|
*
|
|
|
|
* \param h handle to content that has been opened
|
|
|
|
* \param bw browser window containing the content
|
|
|
|
* \param page content of type CONTENT_HTML containing h, or NULL if not an
|
|
|
|
* object within a page
|
|
|
|
* \param params object parameters, or NULL if not an object
|
|
|
|
*
|
|
|
|
* Calls the open function for the content.
|
|
|
|
*/
|
2019-07-10 18:42:52 +03:00
|
|
|
nserror content_open(struct hlcache_handle *h, struct browser_window *bw,
|
2012-08-20 17:22:28 +04:00
|
|
|
struct content *page, struct object_params *params);
|
2016-06-06 10:59:23 +03:00
|
|
|
|
2020-05-07 01:38:50 +03:00
|
|
|
/**
|
|
|
|
* The window containing the content has been closed.
|
|
|
|
*
|
|
|
|
* Calls the close function for the content.
|
|
|
|
*/
|
2019-07-10 18:42:52 +03:00
|
|
|
nserror content_close(struct hlcache_handle *h);
|
2016-06-06 10:59:23 +03:00
|
|
|
|
2020-05-07 01:38:50 +03:00
|
|
|
/**
|
|
|
|
* Tell a content that any selection it has, or one of its objects
|
|
|
|
* has, must be cleared.
|
|
|
|
*/
|
2013-02-22 16:19:35 +04:00
|
|
|
void content_clear_selection(struct hlcache_handle *h);
|
2016-06-06 10:59:23 +03:00
|
|
|
|
2020-05-07 01:38:50 +03:00
|
|
|
/**
|
|
|
|
* Get a text selection from a content. Ownership is passed to the caller,
|
|
|
|
* who must free() it.
|
|
|
|
*/
|
2013-02-22 16:19:35 +04:00
|
|
|
char * content_get_selection(struct hlcache_handle *h);
|
2014-11-02 18:46:42 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Get positional contextural information for a content.
|
|
|
|
*
|
|
|
|
* \param[in] h Handle to content to examine.
|
|
|
|
* \param[in] x The x coordinate to examine.
|
|
|
|
* \param[in] y The y coordinate to examine.
|
|
|
|
* \param[out] data The context structure to fill in.
|
|
|
|
*/
|
|
|
|
nserror content_get_contextual_content(struct hlcache_handle *h,
|
|
|
|
int x, int y, struct browser_window_features *data);
|
|
|
|
|
2020-05-07 01:38:50 +03:00
|
|
|
/**
|
|
|
|
* scroll content at coordnate
|
|
|
|
*
|
|
|
|
* \param[in] h Handle to content to examine.
|
|
|
|
* \param[in] x The x coordinate to examine.
|
|
|
|
* \param[in] y The y coordinate to examine.
|
|
|
|
*/
|
2011-11-29 21:47:29 +04:00
|
|
|
bool content_scroll_at_point(struct hlcache_handle *h,
|
|
|
|
int x, int y, int scrx, int scry);
|
2016-06-06 10:59:23 +03:00
|
|
|
|
2020-05-07 01:38:50 +03:00
|
|
|
/**
|
|
|
|
* Drag and drop a file at coordinate
|
|
|
|
*
|
|
|
|
* \param[in] h Handle to content to examine.
|
|
|
|
* \param[in] x The x coordinate to examine.
|
|
|
|
* \param[in] y The y coordinate to examine.
|
|
|
|
*/
|
2011-12-02 01:49:57 +04:00
|
|
|
bool content_drop_file_at_point(struct hlcache_handle *h,
|
|
|
|
int x, int y, char *file);
|
2014-03-19 02:32:52 +04:00
|
|
|
|
2020-05-07 01:38:50 +03:00
|
|
|
/**
|
2020-05-12 23:09:41 +03:00
|
|
|
* Free text search a content
|
2020-05-07 01:38:50 +03:00
|
|
|
*
|
|
|
|
* \param[in] h Handle to content to search.
|
2020-05-12 23:09:41 +03:00
|
|
|
* \param[in] context The context passed to gui table search handlers
|
|
|
|
* \param[in] flags The flags that control the search
|
|
|
|
* \param[in] The string being searched for.
|
|
|
|
* \retun NSERROR_OK on success else error code on faliure
|
2020-05-07 01:38:50 +03:00
|
|
|
*/
|
2020-05-12 23:09:41 +03:00
|
|
|
nserror content_textsearch(struct hlcache_handle *h, void *context, search_flags_t flags, const char *string);
|
2016-06-06 10:59:23 +03:00
|
|
|
|
2020-05-07 01:38:50 +03:00
|
|
|
/**
|
|
|
|
* Clear a search
|
|
|
|
*
|
|
|
|
* \param[in] h Handle to content to clear search from.
|
|
|
|
*/
|
2020-05-12 23:09:41 +03:00
|
|
|
nserror content_textsearch_clear(struct hlcache_handle *h);
|
2014-03-19 02:32:52 +04:00
|
|
|
|
2016-06-06 10:59:23 +03:00
|
|
|
|
2014-11-07 01:51:46 +03:00
|
|
|
/**
|
|
|
|
* Control debug con a content.
|
|
|
|
*
|
|
|
|
* \param h content handle to debug.
|
|
|
|
* \param op Debug operation type.
|
|
|
|
*/
|
|
|
|
nserror content_debug(struct hlcache_handle *h, enum content_debug op);
|
|
|
|
|
2016-06-06 10:59:23 +03:00
|
|
|
|
2014-11-09 01:08:29 +03:00
|
|
|
/**
|
|
|
|
* find link in content that matches the rel string.
|
|
|
|
*
|
|
|
|
* \param h handle to the content to retrieve tyoe of.
|
|
|
|
* \param rel The string to match.
|
|
|
|
* \return A matching rfc5988 link or NULL if none is found.
|
|
|
|
*
|
|
|
|
*/
|
2016-06-06 10:59:23 +03:00
|
|
|
struct content_rfc5988_link *content_find_rfc5988_link(struct hlcache_handle *h, lwc_string *rel);
|
2010-03-28 16:56:39 +04:00
|
|
|
|
2014-11-09 01:08:29 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Retrieve status of content
|
|
|
|
*
|
|
|
|
* \param h handle to the content to retrieve status from
|
|
|
|
* \return Content status
|
|
|
|
*/
|
|
|
|
content_status content_get_status(struct hlcache_handle *h);
|
|
|
|
|
2016-06-06 10:59:23 +03:00
|
|
|
|
2014-11-09 01:08:29 +03:00
|
|
|
/**
|
|
|
|
* Retrieve status of content
|
|
|
|
*
|
|
|
|
* \param c Content to retrieve status from.
|
|
|
|
* \return Content status
|
|
|
|
*/
|
|
|
|
content_status content__get_status(struct content *c);
|
|
|
|
|
2016-06-06 10:59:23 +03:00
|
|
|
|
2014-11-09 01:08:29 +03:00
|
|
|
/**
|
|
|
|
* Retrieve status message associated with content
|
|
|
|
*
|
|
|
|
* \param h handle to the content to retrieve status message from
|
|
|
|
* \return Pointer to status message, or NULL if not found.
|
|
|
|
*/
|
|
|
|
const char *content_get_status_message(struct hlcache_handle *h);
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Retrieve available width of content
|
|
|
|
*
|
|
|
|
* \param h handle to the content to get available width of.
|
|
|
|
* \return Available width of content.
|
|
|
|
*/
|
|
|
|
int content_get_available_width(struct hlcache_handle *h);
|
|
|
|
|
2014-11-08 19:49:32 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Retrieve the refresh URL for a content
|
|
|
|
*
|
|
|
|
* \param h Content to retrieve refresh URL from
|
|
|
|
* \return Pointer to URL, or NULL if none
|
|
|
|
*/
|
2015-02-26 19:13:41 +03:00
|
|
|
struct nsurl *content_get_refresh_url(struct hlcache_handle *h);
|
2014-11-08 19:49:32 +03:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Determine if a content is opaque from handle
|
|
|
|
*
|
|
|
|
* \param h high level cache handle to retrieve opacity from.
|
|
|
|
* \return false if the content is not opaque or information is not
|
|
|
|
* known else true.
|
|
|
|
*/
|
2011-08-31 16:12:41 +04:00
|
|
|
bool content_get_opaque(struct hlcache_handle *h);
|
2014-11-08 19:49:32 +03:00
|
|
|
|
2016-06-06 10:59:23 +03:00
|
|
|
|
2014-11-08 19:49:32 +03:00
|
|
|
/**
|
|
|
|
* Retrieve quirkiness of a content
|
|
|
|
*
|
|
|
|
* \param h Content to examine
|
|
|
|
* \return True if content is quirky, false otherwise
|
|
|
|
*/
|
2014-11-06 02:44:31 +03:00
|
|
|
bool content_get_quirks(struct hlcache_handle *h);
|
2014-11-08 19:49:32 +03:00
|
|
|
|
2010-03-28 16:56:39 +04:00
|
|
|
|
2014-11-08 19:49:32 +03:00
|
|
|
/**
|
|
|
|
* Return whether a content is currently locked
|
|
|
|
*
|
|
|
|
* \param h handle to the content.
|
|
|
|
* \return true iff locked, else false
|
|
|
|
*/
|
2010-04-07 22:50:18 +04:00
|
|
|
bool content_is_locked(struct hlcache_handle *h);
|
|
|
|
|
2016-06-06 10:59:23 +03:00
|
|
|
|
2019-05-05 17:37:56 +03:00
|
|
|
/**
|
|
|
|
* Execute some JavaScript code inside a content object.
|
|
|
|
*
|
|
|
|
* Runs the passed in JavaScript code in the content object's context.
|
|
|
|
*
|
|
|
|
* \param h The handle to the content
|
|
|
|
* \param src The JavaScript source code
|
|
|
|
* \param srclen The length of the source code
|
|
|
|
* \return Whether the JS function was successfully injected into the content
|
|
|
|
*/
|
|
|
|
bool content_exec(struct hlcache_handle *h, const char *src, size_t srclen);
|
2016-06-06 10:59:23 +03:00
|
|
|
|
2019-12-01 18:49:08 +03:00
|
|
|
/**
|
|
|
|
* Determine if the content referred to any insecure objects.
|
|
|
|
*
|
|
|
|
* Query the content to determine if any of its referred objects were loaded
|
|
|
|
* in a manner not considered secure. For a content to be recursively
|
|
|
|
* secure it must only load over https and must not have certificate overrides
|
|
|
|
* in place.
|
|
|
|
*
|
|
|
|
* \param h The handle to the content
|
|
|
|
* \return Whether the content referred to any insecure objects
|
|
|
|
*/
|
|
|
|
bool content_saw_insecure_objects(struct hlcache_handle *h);
|
2016-06-06 10:59:23 +03:00
|
|
|
|
2003-02-09 15:58:15 +03:00
|
|
|
#endif
|