X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Foutput%2Ftable-item.h;h=eb3dcb16ea440ba9db1da0eb15c44836941eaef3;hb=f8cba0fb13cceeac43fe4b15e2d5b48798ab1a6e;hp=01e9899b880e9dfe93b961c5ea88cf0f05eed356;hpb=dfd1972f7bcb550a4fc3b05dbe7e71d12334b0a7;p=pspp diff --git a/src/output/table-item.h b/src/output/table-item.h index 01e9899b88..eb3dcb16ea 100644 --- a/src/output/table-item.h +++ b/src/output/table-item.h @@ -1,5 +1,5 @@ /* PSPP - a program for statistical analysis. - Copyright (C) 2009 Free Software Foundation, Inc. + Copyright (C) 2009, 2011, 2014 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -20,11 +20,49 @@ /* Table items. A table item is a subclass of an output item (see output-item.h) that - contains a table (see table.h) and some formatting properties (currently - just a caption). */ + contains a table (see table.h) and some formatting properties. Currently + the formatting properties are an optional title (a brief description + typically displayed above the table) and an optional caption (a more verbose + description typically displayed below the table). */ -#include -#include +#include "libpspp/compiler.h" +#include "output/output-item.h" +#include "output/table.h" + +/* Title or caption in a table item. */ +struct table_item_text + { + char *content; + const struct footnote **footnotes; + size_t n_footnotes; + struct table_area_style *style; + }; + +struct table_item_text *table_item_text_create (const char *); +struct table_item_text *table_item_text_clone (const struct table_item_text *); +void table_item_text_destroy (struct table_item_text *); + +struct table_item_layer + { + char *content; + const struct footnote **footnotes; + size_t n_footnotes; + }; + +void table_item_layer_copy (struct table_item_layer *, + const struct table_item_layer *); +void table_item_layer_uninit (struct table_item_layer *); + +struct table_item_layers + { + struct table_item_layer *layers; + size_t n_layers; + struct table_area_style *style; + }; + +struct table_item_layers *table_item_layers_clone ( + const struct table_item_layers *); +void table_item_layers_destroy (struct table_item_layers *); /* A table item. @@ -32,23 +70,38 @@ of the accessor functions defined below. */ struct table_item { - struct output_item output_item; /* Superclass. */ - struct table *table; /* The table to be rendered. */ - char *caption; /* May be null if there is no caption. */ + struct output_item output_item; /* Superclass. */ + struct table *table; /* The table to be rendered. */ + struct table_item_text *title; /* Null if there is no title. */ + struct table_item_text *caption; /* Null if there is no caption. */ + struct table_item_layers *layers; /* Null if there is no layer info. */ + struct pivot_table *pt; }; -struct table_item *table_item_create (struct table *, const char *caption); +struct table_item *table_item_create (struct table *, const char *title, + const char *caption); const struct table *table_item_get_table (const struct table_item *); -const char *table_item_get_caption (const struct table_item *); -void table_item_set_caption (struct table_item *, const char *); +const struct table_item_text *table_item_get_title (const struct table_item *); +void table_item_set_title (struct table_item *, + const struct table_item_text *); + +const struct table_item_layers *table_item_get_layers ( + const struct table_item *); +void table_item_set_layers (struct table_item *, + const struct table_item_layers *); + +const struct table_item_text *table_item_get_caption ( + const struct table_item *); +void table_item_set_caption (struct table_item *, + const struct table_item_text *); /* This boilerplate for table_item, a subclass of output_item, was autogenerated by mk-class-boilerplate. */ #include -#include +#include "libpspp/cast.h" extern const struct output_item_class table_item_class;