1/*
2 * This file is part of the WebKit open source project.
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details.
13 *
14 * You should have received a copy of the GNU Library General Public License
15 * along with this library; see the file COPYING.LIB. If not, write to
16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
18 */
19
20#if !defined(__WEBKITDOM_H_INSIDE__) && !defined(BUILDING_WEBKIT) && !defined(WEBKIT_DOM_USE_UNSTABLE_API)
21#error "Only <webkitdom/webkitdom.h> can be included directly."
22#endif
23
24#ifndef WebKitDOMDOMSelection_h
25#define WebKitDOMDOMSelection_h
26
27#include <glib-object.h>
28#include <webkitdom/WebKitDOMObject.h>
29#include <webkitdom/webkitdomdefines.h>
30
31G_BEGIN_DECLS
32
33#define WEBKIT_DOM_TYPE_DOM_SELECTION (webkit_dom_dom_selection_get_type())
34#define WEBKIT_DOM_DOM_SELECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), WEBKIT_DOM_TYPE_DOM_SELECTION, WebKitDOMDOMSelection))
35#define WEBKIT_DOM_DOM_SELECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), WEBKIT_DOM_TYPE_DOM_SELECTION, WebKitDOMDOMSelectionClass)
36#define WEBKIT_DOM_IS_DOM_SELECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), WEBKIT_DOM_TYPE_DOM_SELECTION))
37#define WEBKIT_DOM_IS_DOM_SELECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), WEBKIT_DOM_TYPE_DOM_SELECTION))
38#define WEBKIT_DOM_DOM_SELECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), WEBKIT_DOM_TYPE_DOM_SELECTION, WebKitDOMDOMSelectionClass))
39
40struct _WebKitDOMDOMSelection {
41 WebKitDOMObject parent_instance;
42};
43
44struct _WebKitDOMDOMSelectionClass {
45 WebKitDOMObjectClass parent_class;
46};
47
48WEBKIT_DEPRECATED GType
49webkit_dom_dom_selection_get_type(void);
50
51/**
52 * webkit_dom_dom_selection_collapse:
53 * @self: A #WebKitDOMDOMSelection
54 * @node: A #WebKitDOMNode
55 * @offset: A #gulong
56 *
57 * Since: 2.16
58 *
59 * Deprecated: 2.22: Use JavaScriptCore API instead
60 */
61WEBKIT_DEPRECATED void
62webkit_dom_dom_selection_collapse(WebKitDOMDOMSelection* self, WebKitDOMNode* node, gulong offset);
63
64/**
65 * webkit_dom_dom_selection_collapse_to_end:
66 * @self: A #WebKitDOMDOMSelection
67 * @error: #GError
68 *
69 * Since: 2.16
70 *
71 * Deprecated: 2.22: Use JavaScriptCore API instead
72 */
73WEBKIT_DEPRECATED void
74webkit_dom_dom_selection_collapse_to_end(WebKitDOMDOMSelection* self, GError** error);
75
76/**
77 * webkit_dom_dom_selection_collapse_to_start:
78 * @self: A #WebKitDOMDOMSelection
79 * @error: #GError
80 *
81 * Since: 2.16
82 *
83 * Deprecated: 2.22: Use JavaScriptCore API instead
84 */
85WEBKIT_DEPRECATED void
86webkit_dom_dom_selection_collapse_to_start(WebKitDOMDOMSelection* self, GError** error);
87
88/**
89 * webkit_dom_dom_selection_delete_from_document:
90 * @self: A #WebKitDOMDOMSelection
91 *
92 * Since: 2.16
93 *
94 * Deprecated: 2.22: Use JavaScriptCore API instead
95 */
96WEBKIT_DEPRECATED void
97webkit_dom_dom_selection_delete_from_document(WebKitDOMDOMSelection* self);
98
99/**
100 * webkit_dom_dom_selection_contains_node:
101 * @self: A #WebKitDOMDOMSelection
102 * @node: A #WebKitDOMNode
103 * @allowPartial: A #gboolean
104 *
105 * Returns: A #gboolean
106 *
107 * Since: 2.16
108 *
109 * Deprecated: 2.22: Use JavaScriptCore API instead
110 */
111WEBKIT_DEPRECATED gboolean
112webkit_dom_dom_selection_contains_node(WebKitDOMDOMSelection* self, WebKitDOMNode* node, gboolean allowPartial);
113
114/**
115 * webkit_dom_dom_selection_select_all_children:
116 * @self: A #WebKitDOMDOMSelection
117 * @node: A #WebKitDOMNode
118 *
119 * Since: 2.16
120 *
121 * Deprecated: 2.22: Use JavaScriptCore API instead
122 */
123WEBKIT_DEPRECATED void
124webkit_dom_dom_selection_select_all_children(WebKitDOMDOMSelection* self, WebKitDOMNode* node);
125
126/**
127 * webkit_dom_dom_selection_extend:
128 * @self: A #WebKitDOMDOMSelection
129 * @node: A #WebKitDOMNode
130 * @offset: A #gulong
131 * @error: #GError
132 *
133 * Since: 2.16
134 *
135 * Deprecated: 2.22: Use JavaScriptCore API instead
136 */
137WEBKIT_DEPRECATED void
138webkit_dom_dom_selection_extend(WebKitDOMDOMSelection* self, WebKitDOMNode* node, gulong offset, GError** error);
139
140/**
141 * webkit_dom_dom_selection_get_range_at:
142 * @self: A #WebKitDOMDOMSelection
143 * @index: A #gulong
144 * @error: #GError
145 *
146 * Returns: (transfer full): A #WebKitDOMRange
147 *
148 * Since: 2.16
149 *
150 * Deprecated: 2.22: Use JavaScriptCore API instead
151 */
152WEBKIT_DEPRECATED WebKitDOMRange*
153webkit_dom_dom_selection_get_range_at(WebKitDOMDOMSelection* self, gulong index, GError** error);
154
155/**
156 * webkit_dom_dom_selection_remove_all_ranges:
157 * @self: A #WebKitDOMDOMSelection
158 *
159 * Since: 2.16
160 *
161 * Deprecated: 2.22: Use JavaScriptCore API instead
162 */
163WEBKIT_DEPRECATED void
164webkit_dom_dom_selection_remove_all_ranges(WebKitDOMDOMSelection* self);
165
166/**
167 * webkit_dom_dom_selection_add_range:
168 * @self: A #WebKitDOMDOMSelection
169 * @range: A #WebKitDOMRange
170 *
171 * Since: 2.16
172 *
173 * Deprecated: 2.22: Use JavaScriptCore API instead
174 */
175WEBKIT_DEPRECATED void
176webkit_dom_dom_selection_add_range(WebKitDOMDOMSelection* self, WebKitDOMRange* range);
177
178/**
179 * webkit_dom_dom_selection_set_base_and_extent:
180 * @self: A #WebKitDOMDOMSelection
181 * @baseNode: A #WebKitDOMNode
182 * @baseOffset: A #gulong
183 * @extentNode: A #WebKitDOMNode
184 * @extentOffset: A #gulong
185 *
186 * Since: 2.16
187 *
188 * Deprecated: 2.22: Use JavaScriptCore API instead
189 */
190WEBKIT_DEPRECATED void
191webkit_dom_dom_selection_set_base_and_extent(WebKitDOMDOMSelection* self, WebKitDOMNode* baseNode, gulong baseOffset, WebKitDOMNode* extentNode, gulong extentOffset);
192
193/**
194 * webkit_dom_dom_selection_set_position:
195 * @self: A #WebKitDOMDOMSelection
196 * @node: A #WebKitDOMNode
197 * @offset: A #gulong
198 *
199 * Since: 2.16
200 *
201 * Deprecated: 2.22: Use JavaScriptCore API instead
202 */
203WEBKIT_DEPRECATED void
204webkit_dom_dom_selection_set_position(WebKitDOMDOMSelection* self, WebKitDOMNode* node, gulong offset);
205
206/**
207 * webkit_dom_dom_selection_empty:
208 * @self: A #WebKitDOMDOMSelection
209 *
210 * Since: 2.16
211 *
212 * Deprecated: 2.22: Use JavaScriptCore API instead
213 */
214WEBKIT_DEPRECATED void
215webkit_dom_dom_selection_empty(WebKitDOMDOMSelection* self);
216
217/**
218 * webkit_dom_dom_selection_modify:
219 * @self: A #WebKitDOMDOMSelection
220 * @alter: A #gchar
221 * @direction: A #gchar
222 * @granularity: A #gchar
223 *
224 * Since: 2.16
225 *
226 * Deprecated: 2.22: Use JavaScriptCore API instead
227 */
228WEBKIT_DEPRECATED void
229webkit_dom_dom_selection_modify(WebKitDOMDOMSelection* self, const gchar* alter, const gchar* direction, const gchar* granularity);
230
231/**
232 * webkit_dom_dom_selection_get_anchor_node:
233 * @self: A #WebKitDOMDOMSelection
234 *
235 * Returns: (transfer none): A #WebKitDOMNode
236 *
237 * Since: 2.16
238 *
239 * Deprecated: 2.22: Use JavaScriptCore API instead
240 */
241WEBKIT_DEPRECATED WebKitDOMNode*
242webkit_dom_dom_selection_get_anchor_node(WebKitDOMDOMSelection* self);
243
244/**
245 * webkit_dom_dom_selection_get_anchor_offset:
246 * @self: A #WebKitDOMDOMSelection
247 *
248 * Returns: A #gulong
249 *
250 * Since: 2.16
251 *
252 * Deprecated: 2.22: Use JavaScriptCore API instead
253 */
254WEBKIT_DEPRECATED gulong
255webkit_dom_dom_selection_get_anchor_offset(WebKitDOMDOMSelection* self);
256
257/**
258 * webkit_dom_dom_selection_get_focus_node:
259 * @self: A #WebKitDOMDOMSelection
260 *
261 * Returns: (transfer none): A #WebKitDOMNode
262 *
263 * Since: 2.16
264 *
265 * Deprecated: 2.22: Use JavaScriptCore API instead
266 */
267WEBKIT_DEPRECATED WebKitDOMNode*
268webkit_dom_dom_selection_get_focus_node(WebKitDOMDOMSelection* self);
269
270/**
271 * webkit_dom_dom_selection_get_focus_offset:
272 * @self: A #WebKitDOMDOMSelection
273 *
274 * Returns: A #gulong
275 *
276 * Since: 2.16
277 *
278 * Deprecated: 2.22: Use JavaScriptCore API instead
279 */
280WEBKIT_DEPRECATED gulong
281webkit_dom_dom_selection_get_focus_offset(WebKitDOMDOMSelection* self);
282
283/**
284 * webkit_dom_dom_selection_get_is_collapsed:
285 * @self: A #WebKitDOMDOMSelection
286 *
287 * Returns: A #gboolean
288 *
289 * Since: 2.16
290 *
291 * Deprecated: 2.22: Use JavaScriptCore API instead
292 */
293WEBKIT_DEPRECATED gboolean
294webkit_dom_dom_selection_get_is_collapsed(WebKitDOMDOMSelection* self);
295
296/**
297 * webkit_dom_dom_selection_get_range_count:
298 * @self: A #WebKitDOMDOMSelection
299 *
300 * Returns: A #gulong
301 *
302 * Since: 2.16
303 *
304 * Deprecated: 2.22: Use JavaScriptCore API instead
305 */
306WEBKIT_DEPRECATED gulong
307webkit_dom_dom_selection_get_range_count(WebKitDOMDOMSelection* self);
308
309/**
310 * webkit_dom_dom_selection_get_selection_type:
311 * @self: A #WebKitDOMDOMSelection
312 *
313 * Returns: A #gchar
314 *
315 * Since: 2.16
316 *
317 * Deprecated: 2.22: Use JavaScriptCore API instead
318 */
319WEBKIT_DEPRECATED gchar*
320webkit_dom_dom_selection_get_selection_type(WebKitDOMDOMSelection* self);
321
322/**
323 * webkit_dom_dom_selection_get_base_node:
324 * @self: A #WebKitDOMDOMSelection
325 *
326 * Returns: (transfer none): A #WebKitDOMNode
327 *
328 * Since: 2.16
329 *
330 * Deprecated: 2.22: Use JavaScriptCore API instead
331 */
332WEBKIT_DEPRECATED WebKitDOMNode*
333webkit_dom_dom_selection_get_base_node(WebKitDOMDOMSelection* self);
334
335/**
336 * webkit_dom_dom_selection_get_base_offset:
337 * @self: A #WebKitDOMDOMSelection
338 *
339 * Returns: A #gulong
340 *
341 * Since: 2.16
342 *
343 * Deprecated: 2.22: Use JavaScriptCore API instead
344 */
345WEBKIT_DEPRECATED gulong
346webkit_dom_dom_selection_get_base_offset(WebKitDOMDOMSelection* self);
347
348/**
349 * webkit_dom_dom_selection_get_extent_node:
350 * @self: A #WebKitDOMDOMSelection
351 *
352 * Returns: (transfer none): A #WebKitDOMNode
353 *
354 * Since: 2.16
355 *
356 * Deprecated: 2.22: Use JavaScriptCore API instead
357 */
358WEBKIT_DEPRECATED WebKitDOMNode*
359webkit_dom_dom_selection_get_extent_node(WebKitDOMDOMSelection* self);
360
361/**
362 * webkit_dom_dom_selection_get_extent_offset:
363 * @self: A #WebKitDOMDOMSelection
364 *
365 * Returns: A #gulong
366 *
367 * Since: 2.16
368 *
369 * Deprecated: 2.22: Use JavaScriptCore API instead
370 */
371WEBKIT_DEPRECATED gulong
372webkit_dom_dom_selection_get_extent_offset(WebKitDOMDOMSelection* self);
373
374G_END_DECLS
375
376#endif /* WebKitDOMDOMSelection_h */
377