~ubuntu-branches/ubuntu/edgy/lynx/edgy

« back to all changes in this revision

Viewing changes to src/HTForms.h

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2004-09-16 12:14:10 UTC
  • Revision ID: james.westby@ubuntu.com-20040916121410-cz1gu92c4nqfeyrg
Tags: upstream-2.8.5
ImportĀ upstreamĀ versionĀ 2.8.5

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef HTFORMS_H
 
2
#define HTFORMS_H
 
3
 
 
4
#ifndef LYSTRUCTS_H
 
5
#include <LYStructs.h>
 
6
#endif /* LYSTRUCTS_H */
 
7
 
 
8
/* in LYForms.c */
 
9
 
 
10
/* change_form_link calls change_form_link_ex with all its args and FALSE as
 
11
  last arg */
 
12
extern int change_form_link PARAMS((int cur,
 
13
                                    DocInfo *newdoc,
 
14
                                    BOOLEAN *refresh_screen,
 
15
                                    BOOLEAN use_last_tfpos,
 
16
                                    BOOLEAN immediate_submit));
 
17
 
 
18
extern int change_form_link_ex PARAMS((int cur,
 
19
                                    DocInfo *newdoc,
 
20
                                    BOOLEAN *refresh_screen,
 
21
                                    BOOLEAN use_last_tfpos,
 
22
                                    BOOLEAN immediate_submit,
 
23
                                    BOOLEAN draw_only));
 
24
 
 
25
/* InputFieldData is used to pass the info between
 
26
 * HTML.c and Gridtext.c in HText_beginInput()
 
27
 */
 
28
typedef struct _InputFieldData {
 
29
        CONST char *accept;
 
30
        CONST char *align;
 
31
        int   checked;
 
32
        CONST char *class;
 
33
        int   disabled;
 
34
        CONST char *error;
 
35
        CONST char *height;
 
36
        CONST char *id;
 
37
        CONST char *lang;
 
38
        CONST char *max;
 
39
        CONST char *maxlength;
 
40
        CONST char *md;
 
41
        CONST char *min;
 
42
        CONST char *name;
 
43
        CONST char *size;
 
44
        CONST char *src;
 
45
        CONST char *type;
 
46
        char *value;
 
47
        CONST char *width;
 
48
        int name_cs;            /* charset handle for name */
 
49
        int value_cs;           /* charset handle for value */
 
50
        CONST char *accept_cs;
 
51
} InputFieldData;
 
52
 
 
53
/* The OptionType structure is for a linked list of option entries
 
54
 */
 
55
typedef struct _OptionType {
 
56
        char *                  name;            /* the name of the entry */
 
57
        char *                  cp_submit_value; /* the value to submit   */
 
58
        int                     value_cs;        /* charset value is in   */
 
59
        struct _OptionType *    next;            /* the next entry        */
 
60
} OptionType;
 
61
 
 
62
/* the FormInfo structure is used to contain the form field
 
63
 * data within each anchor
 
64
 * A pointer to this structure is in the TextAnchor struct.
 
65
 */
 
66
typedef struct _FormInfo {
 
67
        char *                  name;      /* the name of the link */
 
68
        int                     number;    /* which form is the link within */
 
69
        int                     type;      /* string, int, etc. */
 
70
        char *                  value;     /* user entered string data */
 
71
        char *                  orig_value;/* the original value */
 
72
        int                     size;      /* width on the screen */
 
73
        unsigned                maxlength; /* max width of data */
 
74
        int                     group;     /* a group associated with the link
 
75
                                            *  this is used for select's
 
76
                                            */
 
77
        int                     num_value; /* value of the numerical fields */
 
78
        int                     hrange;    /* high numerical range */
 
79
        int                     lrange;    /* low numerical range */
 
80
        OptionType *            select_list; /* array of option choices */
 
81
        char *                  submit_action;  /* form's action */
 
82
        int                     submit_method;  /* form's method */
 
83
        char *                  submit_enctype; /* form's entype */
 
84
        char *                  submit_title;   /* form's title */
 
85
        BOOL                    no_cache;  /* Always resubmit? */
 
86
        char *                  cp_submit_value; /* option value to submit */
 
87
        char *                  orig_submit_value; /* original submit value */
 
88
        int                     size_l;    /* The length of the option list */
 
89
        int                     disabled;  /* If YES, can't change values */
 
90
        int                     name_cs;
 
91
        int                     value_cs;
 
92
        char *                  accept_cs;
 
93
} FormInfo;
 
94
 
 
95
/*
 
96
 *  As structure for info associated with a form.
 
97
 *  There is some redundancy here, this shouldn't waste too much memory
 
98
 *  since the total number of forms (as opposed to form fields) per doc
 
99
 *  is expected to be rather small.
 
100
 *  More things which are per form rather than per field could be moved
 
101
 *  here. - kw
 
102
 */
 
103
typedef struct _PerFormInfo
 
104
{
 
105
        int                     number;    /* form number, see GridText.c */
 
106
    /* except for the last two, the following fields aren't actually used.. */
 
107
        int                     disabled;  /* If YES, can't change values */
 
108
        struct _PerFormInfo *   next;      /* pointer to next form in doc */
 
109
        int                     nfields;   /* number of fields */
 
110
        FormInfo *              first_field;
 
111
        FormInfo *              last_field; /* pointer to last field in form */
 
112
        char *                  accept_cs;
 
113
        char *                  thisacceptcs; /* used during submit */
 
114
} PerFormInfo;
 
115
 
 
116
#define HYPERTEXT_ANCHOR 1
 
117
#define INPUT_ANCHOR     2   /* forms mode input fields */
 
118
#define INTERNAL_LINK_ANCHOR 5  /* 1+4, can be used as bitflag... - kw */
 
119
 
 
120
#define F_TEXT_TYPE        1
 
121
#define F_PASSWORD_TYPE    2
 
122
#define F_CHECKBOX_TYPE    3
 
123
#define F_RADIO_TYPE       4
 
124
#define F_SUBMIT_TYPE      5
 
125
#define F_RESET_TYPE       6
 
126
#define F_OPTION_LIST_TYPE 7
 
127
#define F_HIDDEN_TYPE      8
 
128
#define F_TEXTAREA_TYPE    9
 
129
#define F_RANGE_TYPE      10
 
130
#define F_FILE_TYPE       11
 
131
#define F_TEXT_SUBMIT_TYPE 12
 
132
#define F_IMAGE_SUBMIT_TYPE 13
 
133
#define F_KEYGEN_TYPE     14
 
134
 
 
135
#define F_TEXTLIKE(type) ((type)==F_TEXT_TYPE ||\
 
136
                          (type)==F_TEXT_SUBMIT_TYPE ||\
 
137
                          (type)==F_PASSWORD_TYPE ||\
 
138
                          (type)==F_FILE_TYPE ||\
 
139
                          (type)==F_TEXTAREA_TYPE)
 
140
 
 
141
#define WWW_FORM_LINK_TYPE  1
 
142
#define WWW_LINK_TYPE   2
 
143
#define WWW_INTERN_LINK_TYPE   6 /* can be used as a bitflag... - kw */
 
144
#define LINK_LINE_FOUND 8       /* used in follow_link_number, others - kw */
 
145
#define LINK_DO_ARROWUP 16      /* returned by HTGetLinkOrFieldStart - kw */
 
146
 
 
147
/* #define different lynx modes */
 
148
#define NORMAL_LYNX_MODE 1
 
149
#define FORMS_LYNX_MODE  2
 
150
 
 
151
#define FIRST_ORDER  1
 
152
#define MIDDLE_ORDER 2
 
153
#define LAST_ORDER   3
 
154
 
 
155
/* in LYForms.c */
 
156
extern void show_formlink_statusline PARAMS((CONST FormInfo *   form,
 
157
                                             int                for_what));
 
158
 
 
159
#endif /* HTFORMS_H */