1 #ifndef EL__DOCUMENT_FORMS_H
2 #define EL__DOCUMENT_FORMS_H
4 #include "util/lists.h"
15 FORM_METHOD_POST_TEXT_PLAIN
,
19 LIST_HEAD(struct form
);
21 /* The value of @form_num serves both as a unique ID of the form.
22 * However @form_num and @form_end also stores information about where
23 * in the source the form is positioned. Combined they are used to
24 * figured which form items belong to which forms after rendering
27 * Initially the range between @form_num and @form_end will stretch from
28 * 0 to INT_MAX. When a new form is added the range is partitioned so
29 * the forms each has unique source ranges. */
33 unsigned char *action
;
35 unsigned char *onsubmit
;
36 unsigned char *target
;
37 enum form_method method
;
39 struct list_head items
; /* -> struct form_control */
65 #define form_field_is_readonly(field) ((field)->mode != FORM_MODE_NORMAL)
74 LIST_HEAD(struct form_control
);
79 /* The value of @position is relative to the place of the form item in
88 unsigned char *default_value
;
95 unsigned char **values
;
96 unsigned char **labels
;
97 struct menu_item
*menu
;
100 /* Numerical form type <-> form type name */
101 int str2form_type(unsigned char *s
);
102 unsigned char *form_type2str(enum form_type num
);
104 struct form
*init_form(void);
105 void done_form(struct form
*form
);
106 int has_form_submit(struct form
*form
);
108 int get_form_control_link(struct document
*document
, struct form_control
*fc
);
109 void done_form_control(struct form_control
*fc
);