NetSurf
form.h
Go to the documentation of this file.
1/*
2 * Copyright 2003 Phil Mellor <monkeyson@users.sourceforge.net>
3 * Copyright 2003 James Bursa <bursa@users.sourceforge.net>
4 * Copyright 2009 Paul Blokus <paul_pl@users.sourceforge.net>
5 *
6 * This file is part of NetSurf, http://www.netsurf-browser.org/
7 *
8 * NetSurf is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; version 2 of the License.
11 *
12 * NetSurf is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 */
20
21/**
22 * \file
23 * Form handling public interface.
24 */
25
26#ifndef _NETSURF_FORM_H_
27#define _NETSURF_FORM_H_
28
29struct form_control;
30struct rect;
31
32/** Option in a select. */
34 void *node; /**< Corresponding DOM node */
37 char *value;
38 char *text; /**< NUL terminated. */
40};
41
42/**
43 * Process a selection from a form select menu.
44 *
45 * \param control form control with menu.
46 * \param item index of item selected from the menu.
47 */
48nserror form_select_process_selection(struct form_control *control, int item);
49
50/**
51 * get a form select menus option.
52 *
53 * \param control The form control.
54 * \param item The index of the menu entry to return.
55 * \return The form option at that index.
56 */
57struct form_option *form_select_get_option(struct form_control *control, int item);
58
59/**
60 * Get a form control name
61 *
62 * \param control The form control
63 * \return The form control name
64 */
65char *form_control_get_name(struct form_control *control);
66
67
68/**
69 * Get a form control bounding rectangle
70 *
71 * \param[in] control The form control
72 * \param[out] r The rectangle to place the bounds in.
73 * \return NSERROR_OK on success or error code.
74 */
75nserror form_control_bounding_rect(struct form_control *control, struct rect *r);
76
77#endif
nserror
Enumeration of error codes.
Definition: errors.h:29
nserror form_control_bounding_rect(struct form_control *control, struct rect *r)
Get a form control bounding rectangle.
Definition: form.c:1865
char * form_control_get_name(struct form_control *control)
Get a form control name.
Definition: form.c:1858
struct form_option * form_select_get_option(struct form_control *control, int item)
get a form select menus option.
Definition: form.c:1844
nserror form_select_process_selection(struct form_control *control, int item)
Process a selection from a form select menu.
Definition: form.c:1834
Form control.
Definition: form_internal.h:73
Option in a select.
Definition: form.h:33
char * value
Definition: form.h:37
void * node
Corresponding DOM node.
Definition: form.h:34
struct form_option * next
Definition: form.h:39
bool initial_selected
Definition: form.h:36
bool selected
Definition: form.h:35
char * text
NUL terminated.
Definition: form.h:38
Rectangle coordinates.
Definition: types.h:40