main.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *            main.h
00003  *
00004  *  Fri Aug 25 15:12:00 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  
00023 #ifndef _MAIN_H
00024 #define _MAIN_H
00025 
00032 #define QLCONTEXT "QuickListContextID"
00033 
00043 typedef enum
00044 {
00045     /* % symbols need to be escaped for doxygen */
00047     QL_DF_USSHORT = 0,
00049     QL_DF_USLONG,
00051     QL_DF_USSHORT_2,
00053     QL_DF_USLONG_2,
00055     QL_DF_LOCAL_MONTH,
00057     QL_DF_LONGYEAR,
00059     QL_DF_LOCAL_DAY,
00061     QL_DF_EURSHORT,
00063     QL_DF_EURLONG,
00065     QL_DF_LAST
00066 } QlDateFormat;
00079 #define QL_DF_ISO99 "%m/%d/%y"
00080 
00081 #define QL_DF_UK "%d/%m/%y"
00082 
00083 #define QL_DF_ISO8601 "%Y-%m-%d"
00084 
00085 #define QL_DF_RFC822 "%a, %d %b %Y"
00086 
00087 #define QL_DF_CE "%d.%m.%Y"
00088 
00089 #define QL_DF_US "%m.%d.%Y"
00090 
00091 #define QL_DF_LOCALE "%x"
00092 
00104 typedef enum 
00105 {
00107     QL_TF_12P = 0,
00109     QL_TF_24,
00111     QL_TF_DOT24,
00113     QL_TF_24P,
00115     QL_TF_T,
00117     QL_TF_12TP,
00119     QL_TF_LAST
00120 }QlTimeFormat;
00121 
00131 #define QL_TF_LOCALE "%X"
00132 
00133 #define QL_TF_SECS   "%s"
00134 
00154 typedef enum 
00155 {
00157     QL_NF_GRP = 0,
00159     QL_NF_OLD_A,
00161     QL_NF,
00163     QL_NF_OLD_B,
00165     QL_NF_CURR,
00167     QL_NF_PERCENT,
00169     QL_NF_OLD_C,
00171     QL_NF_LAST
00172 }QlCurrFormat;
00173 
00185 #define QL_NF_PAR_CUR_GRP "%(n"
00186 
00188 #define QL_NF_PAR_CUR     "%^(n"
00189 
00191 #define QL_NF_PAR_GRP     "%(!i"
00192 
00194 #define QL_NF_INT_GRP     "%i"
00195 
00197 #define QL_NF_PAR_INT_GRP "%i("
00198 
00200 #define QL_NF_PAR_INT     "%^i("
00201 
00203 #define QL_NF_INT         "%^i"
00204 
00207 #define CHECK_RANGE if (tab->view->sel_range.col0 > tab->file->last_field) return
00208 
00209 #define CHECK_CHANGED(x) if (check_if_changed (x)) return
00210 
00212 #define MAX_DATE_BUFFER   256
00213 
00224 const gchar *
00225 convert_old_df (QlDateFormat df);
00226 
00227 const gchar *
00228 convert_old_tf (QlTimeFormat tf);
00229 
00230 const gchar *
00231 convert_old_cf (QlCurrFormat cf);
00232 
00233 
00247 gchar *
00248 display_date (GDate * gd, const gchar * fmt);
00249 
00250 gchar *
00251 display_time (GTimeVal * gt, const gchar * fmt);
00252 
00262 GDate *
00263 parse_date (const gchar * string, const gchar * format);
00264 
00269 typedef struct
00270 {
00272     GtkWidget * parent;
00274     GtkNotebook * notebook;
00277     GHashTable  * tab_table;
00279     GtkUIManager * menu_manager;
00281     GtkRecentManager *recent_manager;
00282 }QlContext;
00283 
00285 typedef struct
00286 {
00288     QlFileData * file;
00290     QlViewData * view;
00292     QlContext * qlc;
00293 } QlTabData;
00294 
00296 QlContext * 
00297 ql_context_init (void);
00298 
00299 void add1row (QlTabData * tab); 
00300 void big_draw_start (QlTabData * tab);
00301 void big_draw_end (QlTabData * tab);
00302 gboolean check_if_changed (QlTabData * tab);
00303 gint check_entry (QlTabData * tab, gchar *entry);
00304 void connect_signals (QlTabData * tab);
00305 gint d2qls (gchar *texto, gdouble input, QlFieldType type, 
00306     QlDateFormat formatting, gint dec_places);
00307 void close_dlg (GtkWidget * w, gpointer data);
00308 void front_is_changed (QlTabData * tab);
00309 void get_window_size_loc (GtkWidget * win);
00310 void level1_error (QlTabData * tab, gchar *message);
00311 void level2_error (QlTabData * tab, gchar *message);
00312 void make_basic_dialog1 (void);
00313 gdouble qls2d (const gchar *input, gint type, gint formatting);
00314 void reset_col_to_field (QlTabData * tab);
00315 
00316 void set_window_size_loc (GtkWidget * win);
00317 
00318 void unselect (QlTabData * tab);
00319 
00320 #endif /* _MAIN_H */

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