/****************************************************************************** * tablewidget.h -- table widget header file * * by Marco Trillo * * This source code is under public domain. * * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT ANY WARRANTY, * EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. * THE AUTHORS SHALL NOT BE HELD LIABLE FOR ANY DAMAGE TO YOU, YOUR * COMPUTER, OR TO ANYONE OR ANYTHING ELSE, THAT MAY RESULT FROM ITS USE, * OR MISUSE. BASICALLY, YOU USE IT AT YOUR OWN RISK. ******************************************************************************/ #ifndef __TABLEWIDGET_H #define __TABLEWIDGET_H 1 #include /* for FILE* */ #define TABLE_BUFFER_SIZE 128 enum TableAlign { TABLE_LEFT_ALIGN, TABLE_RIGHT_ALIGN }; typedef void (*TableCallback) (int, int, int, char *); /* Themes */ enum TableThemes { TABLE_THEME_CLASSIC, TABLE_THEME_STRONG, TABLE_THEME_BOXED }; typedef enum TableThemes WTheme; struct struct_table { int id; int rows; int cols; int len; int align; int spacer; char *caption; TableCallback callback; WTheme theme; FILE *stream; }; typedef struct struct_table WTable; /* Errors */ enum TableErrors { TABLE_ERR_NOTABLE, TABLE_ERR_INVALID, TABLE_ERR_NOCALLBACK, TABLE_OK }; int TableSetOptions(WTable * table, int ID, int rows, int cols, int len, int spacer, int align); int TableInitCallback(WTable * table, TableCallback callback); int TableSetOutput(WTable * table, FILE * stream); int TableUseTheme(WTable * table, WTheme theme); int TableSetCaption(WTable * table, char *caption); int DrawTable(WTable table); /* * @EOF@ -- revised February 26 2006 */ #endif