NetSurf
object.h
Go to the documentation of this file.
1/*
2 * Copyright 2020 Vincent Sanders <vince@netsurf-browser.org>
3 *
4 * This file is part of NetSurf, http://www.netsurf-browser.org/
5 *
6 * NetSurf is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
9 *
10 * NetSurf is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19/**
20 * \file
21 * HTML content object interface
22 */
23
24#ifndef NETSURF_HTML_OBJECT_H
25#define NETSURF_HTML_OBJECT_H
26
27struct html_content;
28struct browser_window;
29struct box;
30struct nsurl;
31
32/**
33 * Start a fetch for an object required by a page.
34 *
35 * The created content object is added to the HTML content which is
36 * updated as the fetch progresses. The box (if any) is updated when
37 * the object content becomes done.
38 *
39 * \param c content of type CONTENT_HTML
40 * \param url URL of object to fetch
41 * \param box box that will contain the object or NULL if none
42 * \param permitted_types bitmap of acceptable types
43 * \param background this is a background image
44 * \return true on success, false on memory exhaustion
45 */
46bool html_fetch_object(struct html_content *c, struct nsurl *url, struct box *box, content_type permitted_types, bool background);
47
48/**
49 * release memory of content objects associated with a HTML content
50 *
51 * The content objects contents should have been previously closed
52 * with html_object_close_objects().
53 *
54 * \param html The html content to release the objects from.
55 * \return NSERROR_OK on success else appropriate error code.
56 */
58
59/**
60 * close content of content objects associated with a HTML content
61 *
62 * \param html The html content to close the objects from.
63 * \return NSERROR_OK on success else appropriate error code.
64 */
66
67
68/**
69 * open content of content objects associated with a HTML content
70 *
71 * \param html The html content to open the objects from.
72 * \param bw Browser window handle to open contents with.
73 * \return NSERROR_OK on success else appropriate error code.
74 */
76
77
78/**
79 * abort any content objects that have not completed fetching.
80 *
81 * \param html The html content to abort the objects from.
82 * \return NSERROR_OK on success else appropriate error code.
83 */
85
86#endif
nserror html_object_free_objects(struct html_content *html)
release memory of content objects associated with a HTML content
Definition: object.c:687
nserror html_object_abort_objects(struct html_content *html)
abort any content objects that have not completed fetching.
Definition: object.c:621
nserror html_object_open_objects(struct html_content *html, struct browser_window *bw)
open content of content objects associated with a HTML content
Definition: object.c:598
nserror html_object_close_objects(struct html_content *html)
close content of content objects associated with a HTML content
Definition: object.c:663
bool html_fetch_object(struct html_content *c, struct nsurl *url, struct box *box, content_type permitted_types, bool background)
Start a fetch for an object required by a page.
Definition: object.c:710
content_type
The type of a content.
Definition: content_type.h:53
nserror
Enumeration of error codes.
Definition: errors.h:29
struct nsurl nsurl
NetSurf URL object.
Definition: nsurl.h:31
Node in box tree.
Definition: box.h:177
Browser window data.
Data specific to CONTENT_HTML.
Definition: private.h:93