Subversion Repositories Kolibri OS

Rev

Rev 4364 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
3584 sourcerer 1
/*
2
 * Copyright 2004 James Bursa 
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 .
17
 */
18
 
19
/** \file
20
 * Content for text/html (interface).
21
 *
22
 * These functions should in general be called via the content interface.
23
 */
24
 
25
#ifndef _NETSURF_RENDER_HTML_H_
26
#define _NETSURF_RENDER_HTML_H_
27
 
28
#include 
29
 
30
#include 
4821 ashmew2 31
#include 
3584 sourcerer 32
 
33
#include "content/content_type.h"
34
#include "css/css.h"
35
#include "desktop/mouse.h"
36
#include "desktop/plot_style.h"
37
#include "desktop/frame_types.h"
38
 
39
struct fetch_multipart_data;
40
struct box;
41
struct rect;
42
struct browser_window;
43
struct content;
44
struct hlcache_handle;
45
struct http_parameter;
46
struct imagemap;
47
struct object_params;
48
struct plotters;
49
struct scrollbar;
50
struct scrollbar_msg_data;
51
struct search_context;
52
 
53
/**
54
 * Container for stylesheets used by an HTML document
55
 */
56
struct html_stylesheet {
57
	/** Type of sheet */
58
	enum { HTML_STYLESHEET_EXTERNAL, HTML_STYLESHEET_INTERNAL } type;
59
	union {
60
		struct hlcache_handle *external;
61
		struct content_css_data *internal;
62
	} data;	/**< Sheet data */
63
};
64
 
65
/**
66
 * Container for scripts used by an HTML document
67
 */
68
struct html_script {
69
	/** Type of script */
70
	enum html_script_type { HTML_SCRIPT_INLINE,
71
				HTML_SCRIPT_SYNC,
72
				HTML_SCRIPT_DEFER,
73
				HTML_SCRIPT_ASYNC } type;
74
	union {
75
		struct hlcache_handle *handle;
76
		struct dom_string *string;
77
	} data;	/**< Script data */
78
	struct dom_string *mimetype;
79
	struct dom_string *encoding;
80
	bool already_started;
81
	bool parser_inserted;
82
	bool force_async;
83
	bool ready_exec;
84
	bool async;
85
	bool defer;
86
};
87
 
88
 
89
/** An object (, , etc.) in a CONTENT_HTML document. */
90
struct content_html_object {
91
	struct content *parent;		/**< Parent document */
92
	struct content_html_object *next; /**< Next in chain */
93
 
94
	struct hlcache_handle *content;  /**< Content, or 0. */
95
	struct box *box;  /**< Node in box tree containing it. */
96
	/** Bitmap of acceptable content types */
97
	content_type permitted_types;
98
	bool background;  /**< This object is a background image. */
99
};
100
 
101
struct html_scrollbar_data {
102
	struct content *c;
103
	struct box *box;
104
};
105
 
106
/** Frame tree (, ) */
107
struct content_html_frames {
108
	int cols;	/** number of columns in frameset */
109
	int rows;	/** number of rows in frameset */
110
 
111
	struct frame_dimension width;	/** frame width */
112
	struct frame_dimension height;	/** frame width */
113
	int margin_width;	/** frame margin width */
114
	int margin_height;	/** frame margin height */
115
 
116
	char *name;	/** frame name (for targetting) */
117
	nsurl *url;	/** frame url */
118
 
119
	bool no_resize;	/** frame is not resizable */
120
	frame_scrolling scrolling;	/** scrolling characteristics */
121
	bool border;	/** frame has a border */
122
	colour border_colour;	/** frame border colour */
123
 
124
	struct content_html_frames *children; /** [cols * rows] children */
125
};
126
 
127
/** Inline frame list (