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.
|
|
|
|
*/
|
|
|
|
|
2009-01-15 18:58:35 +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>
|
|
|
|
|
2010-04-04 16:41:19 +04:00
|
|
|
#include "utils/errors.h"
|
2011-05-07 00:40:09 +04:00
|
|
|
#include "content/content_factory.h"
|
2016-04-19 01:04:16 +03:00
|
|
|
#include "desktop/search.h" /* search flags enum */
|
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;
|
2019-08-04 11:36:49 +03:00
|
|
|
struct llcache_query_msg;
|
2019-08-05 20:11:13 +03:00
|
|
|
struct ssl_cert_info;
|
2011-06-30 19:48:07 +04:00
|
|
|
|
2010-03-28 16:56:39 +04:00
|
|
|
/** Status of a content */
|
|
|
|
typedef enum {
|
|
|
|
CONTENT_STATUS_LOADING, /**< Content is being fetched or
|
|
|
|
converted and is not safe to display. */
|
|
|
|
CONTENT_STATUS_READY, /**< Some parts of content still being
|
|
|
|
loaded, but can be displayed. */
|
|
|
|
CONTENT_STATUS_DONE, /**< All finished. */
|
|
|
|
CONTENT_STATUS_ERROR /**< Error occurred, content will be
|
|
|
|
destroyed imminently. */
|
|
|
|
} content_status;
|
2004-06-21 19:09:59 +04:00
|
|
|
|
2003-09-08 01:08:13 +04:00
|
|
|
/** Used in callbacks to indicate what has occurred. */
|
2003-06-17 23:24:21 +04:00
|
|
|
typedef enum {
|
2019-05-05 23:05:27 +03:00
|
|
|
CONTENT_MSG_LOG, /**< Content wishes to log something */
|
2019-08-05 20:11:13 +03:00
|
|
|
CONTENT_MSG_SSL_CERTS, /**< Content is from SSL and this is its chain */
|
2003-09-08 01:08:13 +04:00
|
|
|
CONTENT_MSG_LOADING, /**< fetching or converting */
|
|
|
|
CONTENT_MSG_READY, /**< may be displayed */
|
|
|
|
CONTENT_MSG_DONE, /**< finished */
|
|
|
|
CONTENT_MSG_ERROR, /**< error occurred */
|
2013-05-27 17:51:00 +04:00
|
|
|
CONTENT_MSG_REDIRECT, /**< fetch url redirect occured */
|
2003-09-08 01:08:13 +04:00
|
|
|
CONTENT_MSG_STATUS, /**< new status string */
|
2003-10-25 23:20:13 +04:00
|
|
|
CONTENT_MSG_REFORMAT, /**< content_reformat done */
|
2004-03-21 15:50:10 +03:00
|
|
|
CONTENT_MSG_REDRAW, /**< needs redraw (eg. new animation frame) */
|
2006-01-25 09:52:38 +03:00
|
|
|
CONTENT_MSG_REFRESH, /**< wants refresh */
|
2011-01-07 16:10:20 +03:00
|
|
|
CONTENT_MSG_DOWNLOAD, /**< download, not for display */
|
2011-10-07 03:31:55 +04:00
|
|
|
CONTENT_MSG_LINK, /**< RFC5988 link */
|
2012-06-11 02:17:30 +04:00
|
|
|
CONTENT_MSG_GETCTX, /**< Javascript context */
|
2019-05-06 17:34:25 +03:00
|
|
|
CONTENT_MSG_GETDIMS, /**< Get viewport dimensions. */
|
2012-08-16 23:20:49 +04:00
|
|
|
CONTENT_MSG_SCROLL, /**< Request to scroll content */
|
2012-08-17 02:26:05 +04:00
|
|
|
CONTENT_MSG_DRAGSAVE, /**< Allow drag saving of content */
|
2012-08-17 13:01:15 +04:00
|
|
|
CONTENT_MSG_SAVELINK, /**< Allow URL to be saved */
|
2013-02-08 17:22:53 +04:00
|
|
|
CONTENT_MSG_POINTER, /**< Wants a specific mouse pointer set */
|
2013-02-22 16:19:35 +04:00
|
|
|
CONTENT_MSG_SELECTION, /**< A selection made or cleared */
|
|
|
|
CONTENT_MSG_CARET, /**< Caret movement / hiding */
|
2014-01-05 20:04:35 +04:00
|
|
|
CONTENT_MSG_DRAG, /**< A drag started or ended */
|
2014-10-24 20:57:15 +04:00
|
|
|
CONTENT_MSG_SELECTMENU,/**< Create a select menu */
|
2014-01-05 20:04:35 +04:00
|
|
|
CONTENT_MSG_GADGETCLICK/**< A gadget has been clicked on (mainly for file) */
|
2003-06-17 23:24:21 +04:00
|
|
|
} content_msg;
|
|
|
|
|
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 {
|
2019-05-05 23:05:27 +03:00
|
|
|
/** CONTENT_MSG_LOG - Information for logging */
|
|
|
|
struct {
|
|
|
|
browser_window_console_source src; /**< The source of the logging */
|
|
|
|
const char *msg; /**< The message to log */
|
|
|
|
size_t msglen; /**< The length of that message */
|
|
|
|
browser_window_console_flags flags; /**< The flags of the logging */
|
|
|
|
} log;
|
2019-08-05 20:11:13 +03:00
|
|
|
/** CONTENT_MSG_SSL_CERTS - The certificate chain from the underlying fetch */
|
|
|
|
struct {
|
|
|
|
const struct ssl_cert_info *certs; /**< The chain */
|
|
|
|
size_t num; /**< The number of certs in the chain */
|
|
|
|
} certs;
|
2019-08-05 16:29:53 +03:00
|
|
|
/** CONTENT_MSG_ERROR - Error from content or underlying fetch */
|
|
|
|
struct {
|
|
|
|
nserror errorcode; /**< The error code to convey meaning */
|
|
|
|
const char *errormsg; /**< 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 nul
|
|
|
|
* terminated string.
|
|
|
|
*/
|
|
|
|
} errordata;
|
2013-05-27 17:51:00 +04:00
|
|
|
/** CONTENT_MSG_REDIRECT - Redirect info */
|
|
|
|
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 */
|
2012-06-11 02:17:30 +04: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 the area fully. If false, object must be set,
|
|
|
|
* and only the object will be redrawn. */
|
|
|
|
bool full_redraw;
|
|
|
|
/** Object to redraw if full_redraw is false. */
|
|
|
|
struct content *object;
|
|
|
|
/** Coordinates to plot object at. */
|
2011-03-03 00:10:29 +03:00
|
|
|
int object_x, object_y;
|
2004-04-26 17:47:51 +04:00
|
|
|
/** Dimensions to plot object with. */
|
2011-03-03 00:10:29 +03:00
|
|
|
int object_width, object_height;
|
2004-04-25 03:42:32 +04:00
|
|
|
} redraw;
|
2012-06-11 02:17:30 +04:00
|
|
|
/** CONTENT_MSG_REFRESH - Minimum delay */
|
2012-08-15 22:00:50 +04:00
|
|
|
int delay;
|
2012-06-11 02:17:30 +04:00
|
|
|
/** CONTENT_MSG_REFORMAT - Reformat should not cause a redraw */
|
2011-06-24 13:30:33 +04:00
|
|
|
bool background;
|
2012-08-15 22:00:50 +04: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() */
|
|
|
|
const char *explicit_status_text;
|
2012-06-11 02:17:30 +04:00
|
|
|
/** CONTENT_MSG_DOWNLOAD - Low-level cache handle */
|
2010-04-06 01:35:38 +04:00
|
|
|
struct llcache_handle *download;
|
2012-06-11 02:17:30 +04:00
|
|
|
/** CONTENT_MSG_RFC5988_LINK - rfc5988 link data */
|
2011-10-07 22:12:47 +04:00
|
|
|
struct content_rfc5988_link *rfc5988_link;
|
2012-06-11 02:17:30 +04:00
|
|
|
/** CONTENT_MSG_GETCTX - Javascript context */
|
|
|
|
struct jscontext **jscontext;
|
2019-05-06 17:34:25 +03:00
|
|
|
/** CONTENT_MSG_GETDIMS - Get the viewport dimensions */
|
|
|
|
struct {
|
|
|
|
/* TODO: Consider getting screen_width, screen_height too. */
|
|
|
|
unsigned *viewport_width;
|
|
|
|
unsigned *viewport_height;
|
|
|
|
} getdims;
|
2012-08-14 01:54:18 +04:00
|
|
|
/** CONTENT_MSG_SCROLL - Part of content to scroll to show */
|
|
|
|
struct {
|
|
|
|
/** if true, scroll to show area given by (x0, y0) and (x1,y1).
|
|
|
|
* if false, scroll point (x0, y0) to top left of viewport */
|
|
|
|
bool area;
|
|
|
|
int x0, y0;
|
|
|
|
int x1, y1;
|
|
|
|
} scroll;
|
2012-08-16 23:20:49 +04:00
|
|
|
/** CONTENT_MSG_DRAGSAVE - Drag save a content */
|
|
|
|
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;
|
2012-08-17 02:26:05 +04:00
|
|
|
/** CONTENT_MSG_SAVELINK - Save a URL */
|
|
|
|
struct {
|
2015-02-26 19:13:41 +03:00
|
|
|
struct nsurl *url;
|
2012-08-17 02:26:05 +04:00
|
|
|
const char *title;
|
|
|
|
} savelink;
|
2012-08-17 13:01:15 +04:00
|
|
|
/** CONTENT_MSG_POINTER - Mouse pointer to set */
|
|
|
|
browser_pointer_shape pointer;
|
2013-02-22 16:19:35 +04:00
|
|
|
/** CONTENT_MSG_SELECTION - Selection made or cleared */
|
|
|
|
struct {
|
|
|
|
bool selection; /**< false for selection cleared */
|
|
|
|
bool read_only;
|
|
|
|
} selection;
|
|
|
|
/** CONTENT_MSG_CARET - set caret position or, hide caret */
|
|
|
|
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;
|
2013-02-08 17:22:53 +04: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;
|
2014-10-24 20:57:15 +04:00
|
|
|
/** CONTENT_MSG_SELECTMENU - Create select menu at pointer */
|
|
|
|
struct {
|
|
|
|
struct form_control *gadget;
|
|
|
|
} select_menu;
|
2014-01-05 20:04:35 +04:00
|
|
|
/** CONTENT_MSG_GADGETCLICK - User clicked on a form gadget */
|
|
|
|
struct {
|
|
|
|
struct form_control *gadget;
|
|
|
|
} gadget_click;
|
2004-04-25 03:42:32 +04:00
|
|
|
};
|
|
|
|
|
2011-06-29 00:17:39 +04:00
|
|
|
|
2016-06-06 10:59:23 +03:00
|
|
|
/* The following are for hlcache */
|
|
|
|
void content_destroy(struct content *c);
|
2011-06-29 00:17:39 +04:00
|
|
|
|
|
|
|
|
2017-08-26 18:38:18 +03:00
|
|
|
bool content_add_user(
|
|
|
|
struct content *h,
|
|
|
|
void (*callback)(
|
|
|
|
struct content *c,
|
|
|
|
content_msg msg,
|
|
|
|
const union content_msg_data *data,
|
|
|
|
void *pw),
|
|
|
|
void *pw);
|
|
|
|
|
|
|
|
|
|
|
|
void content_remove_user(
|
|
|
|
struct content *c,
|
|
|
|
void (*callback)(
|
|
|
|
struct content *c,
|
|
|
|
content_msg msg,
|
|
|
|
const union content_msg_data *data,
|
|
|
|
void *pw),
|
|
|
|
void *pw);
|
2010-03-28 16:56:39 +04:00
|
|
|
|
2003-02-09 15:58:15 +03:00
|
|
|
|
2010-04-04 16:41:19 +04:00
|
|
|
uint32_t content_count_users(struct content *c);
|
2016-06-06 10:59:23 +03:00
|
|
|
|
|
|
|
|
2010-04-11 20:34:23 +04:00
|
|
|
bool content_matches_quirks(struct content *c, bool quirks);
|
2016-06-06 10:59:23 +03:00
|
|
|
|
|
|
|
|
2010-04-11 20:37:39 +04:00
|
|
|
bool content_is_shareable(struct content *c);
|
2010-04-04 16:41:19 +04:00
|
|
|
|
2016-06-06 10:59:23 +03:00
|
|
|
/* only used by cocoa apple image handling and for getting nsurl of content */
|
2010-03-28 16:56:39 +04:00
|
|
|
const struct llcache_handle *content_get_llcache_handle(struct content *c);
|
2016-06-06 10:59:23 +03:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Retrieve URL associated with content
|
|
|
|
*
|
|
|
|
* \param c Content to retrieve URL from
|
|
|
|
* \return Pointer to URL, or NULL if not found.
|
|
|
|
*/
|
2015-02-26 19:13:41 +03:00
|
|
|
struct nsurl *content_get_url(struct content *c);
|
2004-06-11 00:41:26 +04:00
|
|
|
|
2010-04-04 16:41:19 +04:00
|
|
|
struct content *content_clone(struct content *c);
|
|
|
|
|
|
|
|
nserror content_abort(struct content *c);
|
2003-02-09 15:58:15 +03:00
|
|
|
|
2010-03-28 16:56:39 +04:00
|
|
|
/* Client functions */
|
|
|
|
bool content_can_reformat(struct hlcache_handle *h);
|
2016-06-06 10:59:23 +03:00
|
|
|
|
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
|
|
|
|
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
|
|
|
|
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
|
|
|
|
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
|
|
|
|
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
|
|
|
|
|
|
|
|
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
|
|
|
|
2019-07-10 18:42:52 +03:00
|
|
|
nserror content_close(struct hlcache_handle *h);
|
2016-06-06 10:59:23 +03:00
|
|
|
|
2013-02-22 16:19:35 +04:00
|
|
|
void content_clear_selection(struct hlcache_handle *h);
|
2016-06-06 10:59:23 +03:00
|
|
|
|
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);
|
|
|
|
|
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
|
|
|
|
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
|
|
|
|
|
|
|
void content_search(struct hlcache_handle *h, void *context,
|
2013-05-07 17:41:40 +04:00
|
|
|
search_flags_t flags, const char *string);
|
2016-06-06 10:59:23 +03:00
|
|
|
|
2013-05-07 17:41:40 +04:00
|
|
|
void content_search_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
|
|
|
|
|
|
|
|
2003-02-09 15:58:15 +03:00
|
|
|
#endif
|