#include "html.h"
#if !defined(HTML_TABLE_H)
#define HTML_TABLE_H
typedef struct tab_position {
char alignment;
int position;
struct tab_position *next;
} tab_position;
class tabs {
public:
tabs ();
~tabs ();
void clear (void);
int compatible (const char *s);
void init (const char *s);
void check_init (const char *s);
int find_tab (int pos);
int get_tab_pos (int n);
char get_tab_align (int n);
void dump_tabs (void);
private:
void delete_list (void);
tab_position *tab;
};
typedef struct cols {
int left, right;
int no;
char alignment;
struct cols *next;
} cols;
class html_table {
public:
html_table (simple_output *op, int linelen);
~html_table (void);
int add_column (int coln, int hstart, int hend, char align);
cols *get_column (int coln);
int insert_column (int coln, int hstart, int hend, char align);
int modify_column (cols *c, int hstart, int hend, char align);
int find_tab_column (int pos);
int find_column (int pos);
int get_tab_pos (int n);
char get_tab_align (int n);
void set_linelength (int linelen);
int no_columns (void);
int no_gaps (void);
int is_gap (cols *c);
void dump_table (void);
void emit_table_header (int space);
void emit_col (int n);
void emit_new_row (void);
void emit_finish_table (void);
int get_right (cols *c);
void add_indent (int indent);
void finish_row (void);
int get_effective_linelength (void);
void set_space (int space);
tabs *tab_stops;
simple_output *out;
private:
cols *columns;
int linelength;
cols *last_col;
int start_space;
void remove_cols (cols *c);
};
class html_indent {
public:
html_indent (simple_output *op, int ind, int pageoffset, int linelength);
~html_indent (void);
void begin (int space); void get_reg (int *ind, int *pageoffset, int *linelength);
private:
void end (void);
int is_used;
int pg; int ll;
int in;
html_table *table;
};
#endif