};
const char *pivot_area_to_string (enum pivot_area);
+const struct area_style *pivot_area_get_default_style (enum pivot_area);
/* Table borders for styling purposes. */
enum pivot_border
};
const char *pivot_border_to_string (enum pivot_border);
+void pivot_border_get_default_style (enum pivot_border,
+ struct table_border_style *);
/* Sizing for rows or columns of a rendered table. The comments below talk
about columns and their widths but they apply equally to rows and their
/* A pivot table. See the top of this file for more information. */
struct pivot_table
{
+ /* Reference count. A pivot_table may be shared between multiple owners,
+ indicated by a reference count greater than 1. When this is the case,
+ the pivot_table must not be modified. */
+ int ref_cnt;
+
/* Display settings. */
bool rotate_inner_column_labels;
bool rotate_outer_row_labels;
bool row_labels_in_corner;
bool show_grid_lines;
+ bool show_caption;
bool omit_empty; /* Omit empty rows and columns? */
- size_t *current_layer; /* axis[PIVOT_AXIS_LAYER]->n_dimensions elements. */
+ size_t *current_layer; /* axis[PIVOT_AXIS_LAYER].n_dimensions elements. */
char *table_look;
enum settings_value_show show_values;
enum settings_value_show show_variables;
/* Titles. */
struct pivot_value *title;
- struct pivot_value *subtype; /* Same as pivot_item's subtype. */
+ struct pivot_value *subtype; /* Same as spv_item's subtype. */
struct pivot_value *corner_text;
struct pivot_value *caption;
char *notes;
/* Creating and destroy pivot tables. */
struct pivot_table *pivot_table_create (const char *title);
-struct pivot_table *pivot_table_create__ (struct pivot_value *title);
+struct pivot_table *pivot_table_create__ (struct pivot_value *title,
+ const char *subtype);
struct pivot_table *pivot_table_create_for_text (struct pivot_value *title,
struct pivot_value *content);
-void pivot_table_destroy (struct pivot_table *);
+
+struct pivot_table *pivot_table_ref (const struct pivot_table *);
+void pivot_table_unref (struct pivot_table *);
+bool pivot_table_is_shared (const struct pivot_table *);
/* Format of PIVOT_RC_COUNT cells. */
void pivot_table_set_weight_var (struct pivot_table *,
size_t idx;
struct pivot_value *content;
struct pivot_value *marker;
+ bool show;
};
struct pivot_footnote *pivot_table_create_footnote (
{
struct font_style *font_style;
struct cell_style *cell_style;
- char *subscript;
+
+ char **subscripts;
+ size_t n_subscripts;
+
char *superscript;
- struct pivot_footnote **footnotes;
+ const struct pivot_footnote **footnotes;
size_t n_footnotes;
enum pivot_value_type type;
/* PIVOT_VALUE_TEMPLATE. */
struct
{
- char *s;
+ char *local; /* Localized. */
+ char *id; /* Identifier. */
struct pivot_argument *args;
size_t n_args;
}
struct pivot_value *pivot_value_new_user_text_nocopy (char *);
/* Footnotes. */
-void pivot_value_add_footnote (struct pivot_value *, struct pivot_footnote *);
+void pivot_value_add_footnote (struct pivot_value *, const struct pivot_footnote *);
/* Numeric formats. */
-void pivot_value_set_rc (struct pivot_table *, struct pivot_value *,
+void pivot_value_set_rc (const struct pivot_table *, struct pivot_value *,
const char *rc);
/* Converting a pivot_value to a string for display. */
/* Styling. */
void pivot_value_get_style (struct pivot_value *,
- const struct area_style *default_style,
+ const struct font_style *base_font_style,
+ const struct cell_style *base_cell_style,
struct area_style *);
void pivot_value_set_style (struct pivot_value *, const struct area_style *);
};
void pivot_argument_uninit (struct pivot_argument *);
+\f
+/* One piece of data within a pivot table. */
+struct pivot_cell
+ {
+ struct hmap_node hmap_node; /* In struct pivot_table's 'cells' hmap. */
+ struct pivot_value *value;
+ unsigned int idx[]; /* One index per table dimension. */
+ };
#endif /* output/pivot-table.h */