types.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *            types.h
00003  *
00004  *  Fri Aug 25 15:18:21 2006
00005  *  Copyright  2006-2007  Neil Williams
00006  *  linux@codehelp.co.uk
00007  ****************************************************************************/
00008 /*
00009     This package is free software; you can redistribute it and/or modify
00010     it under the terms of the GNU General Public License as published by
00011     the Free Software Foundation; either version 3 of the License, or
00012     (at your option) any later version.
00013 
00014     This program is distributed in the hope that it will be useful,
00015     but WITHOUT ANY WARRANTY; without even the implied warranty of
00016     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017     GNU General Public License for more details.
00018 
00019     You should have received a copy of the GNU General Public License
00020     along with this program.  If not, see <http://www.gnu.org/licenses/>.
00021 */
00022 #ifndef _TYPES_H
00023 #define _TYPES_H
00024 
00033 #include <libgnomevfs/gnome-vfs.h>
00034 
00036 #define MAX_RECORDS        5000
00037 #define MAX_FIELDS           30
00038 #define MAX_FIELD_NAME       30
00039 #define MAX_SORTS            12
00040 #define MAX_SORT_NESTING      6
00041 #define MAX_FILTERS          12
00042 #define MAX_FILTER_NESTING    6
00043 #define MAX_FILTER_COMPARE   30
00044 #define MAX_REPORTS          18
00045 #define MAX_CLIPBOARD      5000
00046 #define SINGLE_COL 1
00047 
00049 #define QLTABID "QuickListTabID"
00050 
00051 typedef enum
00052 { 
00053     FIELD_TYPE_TEXT = 1,
00054     FIELD_TYPE_NUMERIC,
00055     FIELD_TYPE_DATE,
00056     FIELD_TYPE_TIME
00057 } QlFieldType;
00058 
00059 typedef enum
00060 {
00061     MODE_NEW = 1,
00062     MODE_EDIT,
00063     MODE_SAVE,
00064     MODE_OPEN,
00065     MODE_ADD,
00066     MODE_IMPORT,
00067     MODE_EXPORT,
00068 } QlDialogMode;
00069 
00070 typedef enum
00071 {
00072     DISPLAY_EMPTY = 0,
00073     DISPLAY_LIST,
00074     DISPLAY_REPORT,
00075     DISPLAY_EDIT,
00076     DISPLAY_PRINT,
00077 } QlDisplayMode;
00078 
00079 typedef enum
00080 {
00081     SELECT_NONE = 0,
00082     SELECT_COLUMN,
00083     SELECT_ROW,
00084     SELECT_BLOCK,
00085     SELECT_ENTRY
00086 } QlSelectMode;
00087 
00088 typedef enum
00089 {
00090     QL_NO_FILE = 0,
00091     QL_OLD_QLF,
00092     QL_EXPORT_HTML,
00093     QL_CSV,
00094     QL_TSV,
00095     QL_XML
00096 } QlFileType;
00097 
00100 typedef struct 
00101 {
00102     gint16 field; /* Which field to sort on */
00103     gboolean  ascending; /* True: ascending, false: descending */
00104     gint16  column;
00105     gint unused; 
00106 } QlSortLine;
00107 
00109 typedef struct 
00110 {
00111     gchar * name;
00112     gint16 line_ct; /* 0 is invalid */
00113     QlSortLine line[MAX_SORT_NESTING + 1];  /* line [0] unused */
00114     gint16 unused1, unused2; 
00115 } QlSortInfo;
00116 
00118 typedef struct
00119 {
00120     gboolean unused3; 
00121     gint16 field; 
00122     gint16 type; 
00123     gchar compare[MAX_FILTER_COMPARE + 2];
00124     gint16 unused1, unused2;
00125 } QlFilterLine;
00126 
00128 typedef struct 
00129 {
00130     gchar name[MAX_FIELD_NAME + 2];
00131     gint16 line_ct;
00132     gint16 unused2;
00133     gboolean by_and; 
00134     QlFilterLine line[MAX_FILTER_NESTING];
00135     gboolean use_nocase;
00136 } QlFilterInfo;
00137 
00139 typedef struct
00140 {
00141     gint16 field; /* which field from the data base comes first */
00142     gint16 width; /* in characters */
00143     gint16 group; /* True or false, group summary on change this col */
00144     gint16 total; /* True or false, print totals this column */
00145     gint16 unused1, unused2;
00146 } QlReportColumn;
00147 
00154 typedef struct
00155 {
00156     gchar * name;
00157     gint16 last_column;
00158     gint16 width;
00159     gint16 height;
00160     QlReportColumn column[MAX_FIELDS + 2];  
00161     gint16 sort; 
00162     gint16 filter; 
00163     gchar * header;
00164     gchar * footer;
00165 } QlReportInfo;
00166 
00178 typedef struct
00179 {
00181     QlFilterInfo *filter_ptr;
00183     QlSortInfo *sort_ptr;
00185     QlReportInfo *report_ptr;
00186     GHashTable * fields;
00188     gint16 col_to_field[MAX_FIELDS + 1];
00190     QlSortInfo sorts[MAX_SORTS + 1];
00192     QlFilterInfo filters[MAX_FILTERS + 1];
00194     QlReportInfo reports[MAX_REPORTS + 1];
00196     QlFileType current_file; 
00198     gchar *file_name;
00200     GnomeVFSHandle * vfshandle;
00202     gchar *file_path;
00204     gint16 last_field; 
00205     gint16 sort_ct;  
00206     gint16 filter_ct; 
00207     gint16 report_ct;  
00208     gint32 last_row;
00209     gboolean changed;
00210     gint report_no;
00211     QlFileType file_type; 
00212 } QlFileData;
00213 
00217 typedef struct 
00218 {
00219     gulong activate_signal;
00220     gulong new_column_width_signal;
00221     gulong select_range_signal;
00222     QlDialogMode dialog_mode;
00224     QlDisplayMode display_mode; 
00226     QlDisplayMode report_mode;
00228     QlSelectMode sel_type; 
00229     GtkSheet *sheet;
00230     GtkSheet *report_sheet;
00231     GtkWidget *report_win;
00233     GtkWidget *text_box;
00235     GtkWidget *entry1;
00236     GtkWidget *entry2;
00237     GtkWidget *entry3;
00238     GtkWidget *entry4;
00239     GtkWidget *dec_places_label;
00240     GtkTreeView * tview_from;
00241     GtkTreeView * tview_to;
00242     GtkComboBox *sm_numeric_box;
00243     GtkComboBox *sm_date_box;
00244     GtkComboBox *sm_time_box;
00245   
00248     gint activate_row;
00249     gint activate_col;
00250     gchar *activate_text;
00252     gint16 width;
00253     gint16 height;
00254     gint16 x;
00255     gint16 y;
00256     gchar *current_compare;     
00257     gboolean match_on;
00258     gboolean find_on;
00259     GtkSheetRange sel_range;
00261     gint report_sel_col;
00262     gint report_sel_field; 
00263     gint adjust_rows[8];   
00265     gchar *cb[MAX_CLIPBOARD];   
00266     gchar cb_sel_type;
00267     gint cb_rows;
00268     gint16 cb_cols;
00269 } QlViewData;
00270 
00271 #endif /* _TYPES_H */

Generated on Mon Jan 28 22:02:10 2008 for quicklist by  doxygen 1.5.4