Main Page   Modules   Alphabetical List   Data Structures   File List   Data Fields   Globals   Related Pages  

forms.h

Go to the documentation of this file.
00001 
00007 /* GtkSQL -- an interactive graphical query tool for PostgreSQL
00008  * Copyright (C) 2003 Darryl Luff
00009  * MySQL "driver" (C) 1998 Des Herriott (des@ops.netcom.net.uk)
00010  *
00011  * This program is free software; you can redistribute it and/or modify
00012  * it under the terms of the GNU General Public License as published by
00013  * the Free Software Foundation; either version 2 of the License, or
00014  * (at your option) any later version.
00015  *
00016  * This program is distributed in the hope that it will be useful,
00017  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00018  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00019  * GNU General Public License for more details.
00020  *
00021  * You should have received a copy of the GNU General Public License
00022  * along with this program; if not, write to the Free Software
00023  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00024  */
00025  
00026 #ifndef __FORMS_H
00027 #define __FORMS_H
00028 
00029 #include "buf.h"
00030 
00032 typedef enum {
00033     FT_NONE,    
00034     FT_TEXT,    
00035     FT_PWD,     
00036     FT_FILENAME 
00037 } FieldType;
00038 
00040 typedef enum {
00041     FR_OPTIONAL,        
00042     FR_REQUIRED     
00043 } FieldRelevance;
00044 
00046 #define FRM_ERROR "frm_error"
00047 
00049 typedef struct {
00050     char *name;     
00051     FieldType type; 
00052     FieldRelevance rel; 
00053     char *value;        
00054     char *tip;      
00055     char *help;     
00056     void *next;     
00057 } FormField;
00058 
00060 typedef struct {
00062     char *title;
00064     FormField *fld;
00065 } Form;
00066 
00068 FormField *fld_add(FormField *fld, char *nm);
00069 
00071 int fld_count(FormField *fld);
00072 
00074 FormField *fld_free(FormField *fld);
00075 
00077 FormField *fld_get(FormField *fld, int i);
00078 
00080 char *fld_get_help(FormField *fld);
00081 
00083 FormField *fld_get_last(FormField *fld);
00084 
00086 char *fld_get_name(FormField *fld);
00087 
00089 FieldRelevance fld_get_relevance(FormField *fld);
00090 
00092 char *fld_get_tip(FormField *fld);
00093 
00095 FieldType fld_get_type(FormField *fld);
00096 
00098 char *fld_get_value(FormField *fld);
00099 
00102 char *fld_get_value_by_name(FormField *fld, char *nm);
00103 
00105 FormField *fld_new(char *nm);
00106 
00108 FormField *fld_next(FormField *fld);
00109 
00111 void fld_set_help(FormField *fld, char *hlp);
00112 
00114 FormField *fld_set_name(FormField *fld, char *nm);
00115 
00117 void fld_set_relevance(FormField *fld, FieldRelevance r);
00118 
00120 void fld_set_tip(FormField *fld, char *txt);
00121 
00123 void fld_set_type(FormField *fld, FieldType typ);
00124 
00126 void fld_set_value(FormField *fld, char *val);
00127 
00130 char *fld_set_value_by_name(FormField *fld, char *nm, char *val);
00131 
00133 ABuf *frm_check_fields(Form * frm);
00134 
00137 void frm_clear_fields(Form *frm);
00138 
00140 Form *frm_free(Form *f);
00141 
00143 FormField *frm_add_field(Form *frm, char *nm, char *val);
00144 
00146 FormField *frm_get_field(Form *frm, int n);
00147 
00149 FieldType frm_get_field_type(Form *frm, int n);
00150 
00152 int frm_get_field_count(Form *frm);
00153 
00155 char *frm_get_field_name(Form *frm, int i);
00156 
00158 char *frm_get_title(Form *frm);
00159 
00161 char *frm_get_value(Form *frm, int i);
00162 
00164 char *frm_get_value_by_name(Form *frm, char *nm);
00165 
00167 FormField *frm_last_field(Form *frm);
00168 
00170 int frm_match(Form *frm1, Form *frm2);
00171 
00173 Form *frm_new(Form *frm);
00174 
00176 int frm_save_file(Form *frm, char *fn);
00177 
00179 void frm_set_field_type(Form *frm, int i, int typ);
00180 
00182 Form *frm_set_title(Form *f, char *ttl);
00183 
00185 void frm_set_value_by_name(Form *frm, char *nm, char *val);
00186 
00188 #endif

Generated on Sun May 9 19:19:16 2004 for GtkSQL by doxygen1.2.18