NetSurf
include
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
29
struct
form_control
;
30
struct
rect
;
31
32
/** Option in a select. */
33
struct
form_option
{
34
void
*
node
;
/**< Corresponding DOM node */
35
bool
selected
;
36
bool
initial_selected
;
37
char
*
value
;
38
char
*
text
;
/**< NUL terminated. */
39
struct
form_option
*
next
;
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
*/
48
nserror
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
*/
57
struct
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
*/
65
char
*
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
*/
75
nserror
form_control_bounding_rect
(
struct
form_control
*control,
struct
rect
*r);
76
77
#endif
nserror
nserror
Enumeration of error codes.
Definition:
errors.h:29
form_control_bounding_rect
nserror form_control_bounding_rect(struct form_control *control, struct rect *r)
Get a form control bounding rectangle.
Definition:
form.c:1865
form_control_get_name
char * form_control_get_name(struct form_control *control)
Get a form control name.
Definition:
form.c:1858
form_select_get_option
struct form_option * form_select_get_option(struct form_control *control, int item)
get a form select menus option.
Definition:
form.c:1844
form_select_process_selection
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
Form control.
Definition:
form_internal.h:73
form_option
Option in a select.
Definition:
form.h:33
form_option::value
char * value
Definition:
form.h:37
form_option::node
void * node
Corresponding DOM node.
Definition:
form.h:34
form_option::next
struct form_option * next
Definition:
form.h:39
form_option::initial_selected
bool initial_selected
Definition:
form.h:36
form_option::selected
bool selected
Definition:
form.h:35
form_option::text
char * text
NUL terminated.
Definition:
form.h:38
rect
Rectangle coordinates.
Definition:
types.h:40
Generated on Sun Oct 20 2024 12:52:28 for NetSurf by
1.9.4