1 /*
2  * Copyright 2003 James Bursa <bursa@users.sourceforge.net>
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  * Declaration of content enumerations.
22  *
23  * The content enumerations are defined here.
24  */
25 
26 #ifndef NETSURF_CONTENT_TYPE_H
27 #define NETSURF_CONTENT_TYPE_H
28 
29 /** Debugging dump operations */
30 enum content_debug {
31 	/** Debug the contents rendering. */
32 	CONTENT_DEBUG_RENDER,
33 
34 	/** Debug the contents Document Object. */
35 	CONTENT_DEBUG_DOM,
36 
37 	/** Debug redraw operations. */
38 	CONTENT_DEBUG_REDRAW
39 };
40 
41 
42 /** Content encoding information types */
43 enum content_encoding_type {
44 	/** The content encoding */
45 	CONTENT_ENCODING_NORMAL,
46 
47 	/** The content encoding source */
48 	CONTENT_ENCODING_SOURCE
49 };
50 
51 
52 /** The type of a content. */
53 typedef enum {
54 	/** no type for content */
55 	CONTENT_NONE		= 0x00,
56 
57 	/** content is HTML */
58 	CONTENT_HTML		= 0x01,
59 
60 	/** content is plain text */
61 	CONTENT_TEXTPLAIN	= 0x02,
62 
63 	/** content is CSS */
64 	CONTENT_CSS		= 0x04,
65 
66 	/** All images */
67 	CONTENT_IMAGE		= 0x08,
68 
69 	/** Navigator API Plugins */
70 	CONTENT_PLUGIN		= 0x10,
71 
72 	/** RISC OS themes content */
73 	CONTENT_THEME		= 0x20,
74 
75 	/** Javascript */
76 	CONTENT_JS		= 0x40,
77 
78 	/** All script types. */
79 	CONTENT_SCRIPT		= 0x40,
80 
81 	/** Any content matches */
82 	CONTENT_ANY		= 0x7f
83 } content_type;
84 
85 
86 /** Status of a content */
87 typedef enum {
88 	/** Content is being fetched or converted and is not safe to display. */
89 	CONTENT_STATUS_LOADING,
90 
91 	/** Some parts of content still being loaded, but can be displayed. */
92 	CONTENT_STATUS_READY,
93 
94 	/** Content has completed all processing. */
95 	CONTENT_STATUS_DONE,
96 
97 	/** Error occurred, content will be destroyed imminently. */
98 	CONTENT_STATUS_ERROR
99 } content_status;
100 
101 
102 /**
103  * Used in callbacks to indicate what has occurred.
104  */
105 typedef enum {
106 	/** Content wishes to log something */
107 	CONTENT_MSG_LOG,
108 
109 	/** Content is from SSL and this is its chain */
110 	CONTENT_MSG_SSL_CERTS,
111 
112 	/** fetching or converting */
113 	CONTENT_MSG_LOADING,
114 
115 	/** may be displayed */
116 	CONTENT_MSG_READY,
117 
118 	/** content has finished processing */
119 	CONTENT_MSG_DONE,
120 
121 	/** error occurred */
122 	CONTENT_MSG_ERROR,
123 
124 	/** fetch url redirect occured */
125 	CONTENT_MSG_REDIRECT,
126 
127 	/** new status string */
128 	CONTENT_MSG_STATUS,
129 
130 	/** content_reformat done */
131 	CONTENT_MSG_REFORMAT,
132 
133 	/** needs redraw (eg. new animation frame) */
134 	CONTENT_MSG_REDRAW,
135 
136 	/** wants refresh */
137 	CONTENT_MSG_REFRESH,
138 
139 	/** download, not for display */
140 	CONTENT_MSG_DOWNLOAD,
141 
142 	/** RFC5988 link */
143 	CONTENT_MSG_LINK,
144 
145 	/** Javascript thread */
146 	CONTENT_MSG_GETTHREAD,
147 
148 	/** Get viewport dimensions. */
149 	CONTENT_MSG_GETDIMS,
150 
151 	/** Request to scroll content */
152 	CONTENT_MSG_SCROLL,
153 
154 	/** Allow drag saving of content */
155 	CONTENT_MSG_DRAGSAVE,
156 
157 	/** Allow URL to be saved */
158 	CONTENT_MSG_SAVELINK,
159 
160 	/** Wants a specific mouse pointer set */
161 	CONTENT_MSG_POINTER,
162 
163 	/** A selection made or cleared */
164 	CONTENT_MSG_SELECTION,
165 
166 	/** Caret movement / hiding */
167 	CONTENT_MSG_CARET,
168 
169 	/** A drag started or ended */
170 	CONTENT_MSG_DRAG,
171 
172 	/** Create a select menu */
173 	CONTENT_MSG_SELECTMENU,
174 
175 	/** A gadget has been clicked on (mainly for file) */
176 	CONTENT_MSG_GADGETCLICK,
177 
178 	/** A free text search action has occurred */
179 	CONTENT_MSG_TEXTSEARCH
180 } content_msg;
181 
182 
183 #endif
184