aboutsummaryrefslogtreecommitdiffstats
path: root/form.h
diff options
context:
space:
mode:
authorAkinori Ito <aito@eie.yz.yamagata-u.ac.jp>2001-11-08 05:14:08 +0000
committerAkinori Ito <aito@eie.yz.yamagata-u.ac.jp>2001-11-08 05:14:08 +0000
commit68a07bf03b7624c9924065cce9ffa45497225834 (patch)
treec2adb06a909a8594445e4a3f8587c4bad46e3ecd /form.h
downloadw3m-68a07bf03b7624c9924065cce9ffa45497225834.tar.gz
w3m-68a07bf03b7624c9924065cce9ffa45497225834.zip
Initial revision
Diffstat (limited to 'form.h')
-rw-r--r--form.h96
1 files changed, 96 insertions, 0 deletions
diff --git a/form.h b/form.h
new file mode 100644
index 0000000..fde4733
--- /dev/null
+++ b/form.h
@@ -0,0 +1,96 @@
+/*
+ * HTML forms
+ */
+#ifndef FORM_H
+#define FORM_H
+
+#include "Str.h"
+
+#define FORM_UNKNOWN -1
+#define FORM_INPUT_TEXT 0
+#define FORM_INPUT_PASSWORD 1
+#define FORM_INPUT_CHECKBOX 2
+#define FORM_INPUT_RADIO 3
+#define FORM_INPUT_SUBMIT 4
+#define FORM_INPUT_RESET 5
+#define FORM_INPUT_HIDDEN 6
+#define FORM_INPUT_IMAGE 7
+#define FORM_SELECT 8
+#define FORM_TEXTAREA 9
+#define FORM_INPUT_BUTTON 10
+#define FORM_INPUT_FILE 11
+
+#define FORM_I_TEXT_DEFAULT_SIZE 40
+#define FORM_I_SELECT_DEFAULT_SIZE 40
+#define FORM_I_TEXTAREA_DEFAULT_WIDTH 40
+
+#define FORM_METHOD_GET 0
+#define FORM_METHOD_POST 1
+#define FORM_METHOD_INTERNAL 2
+#define FORM_METHOD_HEAD 3
+
+#define FORM_ENCTYPE_URLENCODED 0
+#define FORM_ENCTYPE_MULTIPART 1
+
+#define MAX_TEXTAREA 100 /* max number of * <textarea>..</textarea>
+ * within one * document */
+#ifdef MENU_SELECT
+#define MAX_SELECT 100 /* max number of <select>..</select> *
+ * within one document */
+#endif /* MENU_SELECT */
+
+typedef struct form_list {
+ struct form_item_list *item;
+ struct form_item_list *lastitem;
+ int method;
+ Str action;
+ char *target;
+ int charset;
+ int enctype;
+ struct form_list *next;
+ int nitems;
+ char *body;
+ char *boundary;
+ unsigned long length;
+} FormList;
+
+#ifdef MENU_SELECT
+typedef struct form_select_option_item {
+ Str value;
+ Str label;
+ int checked;
+ struct form_select_option_item *next;
+} FormSelectOptionItem;
+
+typedef struct form_select_option {
+ FormSelectOptionItem *first;
+ FormSelectOptionItem *last;
+} FormSelectOption;
+
+void addSelectOption(FormSelectOption * fso, Str value, Str label, int chk);
+Str chooseSelectOption(FormSelectOptionItem * item, int choose_type);
+void formChooseOptionByMenu(struct form_item_list *fi, int x, int y);
+/* macros for chooseSelectOption */
+#define CHOOSE_OPTION 0
+#define CHOOSE_VALUE 1
+#endif /* MENU_SELECT */
+
+typedef struct form_item_list {
+ int type;
+ Str name;
+ Str value;
+ int checked;
+ int accept;
+ int size;
+ int rows;
+ int maxlength;
+#ifdef MENU_SELECT
+ FormSelectOptionItem *select_option;
+ Str label;
+#endif /* MENU_SELECT */
+ struct form_list *parent;
+ struct form_item_list *next;
+ int anchor_num;
+} FormItemList;
+
+#endif /* not FORM_H */