1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ 2 /* This file is part of the KDE libraries 3 * Copyright (C) 1997 Martin Jones (mjones@kde.org) 4 * (C) 1997 Torben Weis (weis@kde.org) 5 * 6 * This library is free software; you can redistribute it and/or 7 * modify it under the terms of the GNU Library General Public 8 * License as published by the Free Software Foundation; either 9 * version 2 of the License, or (at your option) any later version. 10 * 11 * This library is distributed in the hope that it will be useful, 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 * Library General Public License for more details. 15 * 16 * You should have received a copy of the GNU Library General Public License 17 * along with this library; see the file COPYING.LIB. If not, write to 18 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 19 * Boston, MA 02110-1301, USA. 20 */ 21 #ifndef _HTMLTABLE_H_ 22 #define _HTMLTABLE_H_ 23 24 #include "htmlobject.h" 25 26 #define HTML_TABLE(x) ((HTMLTable *)(x)) 27 #define HTML_TABLE_CLASS(x) ((HTMLTableClass *)(x)) 28 #define HTML_IS_TABLE(x) (HTML_CHECK_TYPE ((x), HTML_TYPE_TABLE)) 29 30 struct _HTMLTable { 31 HTMLObject object; 32 33 gint specified_width; 34 35 HTMLTableCell ***cells; 36 gint col, totalCols; 37 gint row, totalRows, allocRows; 38 gint spacing; 39 gint padding; 40 gint border; 41 gint max_height; 42 HTMLClueV *caption; 43 HTMLVAlignType capAlign; 44 45 GArray *columnMin; 46 GArray *columnPref; 47 GArray *columnFixed; 48 GArray *columnOpt; 49 GArray *rowHeights; 50 51 GdkColor *bgColor; 52 HTMLImagePointer *bgPixmap; 53 }; 54 55 struct _HTMLTableClass { 56 HTMLObjectClass object_class; 57 }; 58 59 60 void html_table_type_init (void); 61 void html_table_class_init (HTMLTableClass *klass, 62 HTMLType type, 63 guint object_size); 64 void html_table_init (HTMLTable *table, 65 HTMLTableClass *klass, 66 gint width, 67 gint percent, 68 gint padding, 69 gint spacing, 70 gint border); 71 HTMLObject *html_table_new (gint width, 72 gint percent, 73 gint padding, 74 gint spacing, 75 gint border); 76 void html_table_end_row (HTMLTable *table); 77 void html_table_start_row (HTMLTable *table); 78 void html_table_add_cell (HTMLTable *table, 79 HTMLTableCell *cell); 80 void html_table_set_cell (HTMLTable *table, 81 gint r, 82 gint c, 83 HTMLTableCell *cell); 84 void html_table_remove_cell (HTMLTable *table, 85 HTMLTableCell *cell); 86 gint html_table_end_table (HTMLTable *table); 87 88 #endif /* _HTMLTABLE_H_ */ 89