output-item: Make command name part of every output_item.
[pspp] / src / output / text-item.h
index 659a28bd0f8bf418da8433e14d909df5e1d32236..49b5bbe1ebf531b5e216e46595395b7a10ffeb6b 100644 (file)
@@ -1,5 +1,5 @@
 /* PSPP - a program for statistical analysis.
-   Copyright (C) 2009, 2010, 2011 Free Sonftware Foundation, Inc.
+   Copyright (C) 2009, 2010, 2011 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
 #include <stdbool.h>
 #include "libpspp/compiler.h"
 #include "output/output-item.h"
+#include "output/table.h"
 
 enum text_item_type
   {
     TEXT_ITEM_PAGE_TITLE,       /* TITLE and SUBTITLE commands. */
     TEXT_ITEM_TITLE,            /* Title. */
-    TEXT_ITEM_PARAGRAPH,        /* Normal paragraph of text. */
-
-    /* Log items. */
-    TEXT_ITEM_SYNTAX,           /* A single line of PSPP syntax. */
+    TEXT_ITEM_SYNTAX,           /* Syntax printback logging. */
     TEXT_ITEM_LOG,              /* Other logging. */
-
-    /* Spacing.  Some output drivers that are not based on lines and pages
-       (e.g. CSV, HTML) may ignore these. */
-    TEXT_ITEM_BLANK_LINE,       /* Blank line. */
-    TEXT_ITEM_EJECT_PAGE        /* Eject page. */
   };
 
+const char *text_item_type_to_string (enum text_item_type);
+
 /* A text item. */
 struct text_item
   {
     struct output_item output_item;
-    char *text;                 /* The content. */
-    enum text_item_type type;   /* Type. */
-    char *font;
-    int font_size;
-    bool bold, italic, underline, markup;
+    enum text_item_type type;
+    struct pivot_value *text;
   };
 
-struct text_item *text_item_create (enum text_item_type, const char *text);
-struct text_item *text_item_create_nocopy (enum text_item_type, char *text);
-struct text_item *text_item_create_format (enum text_item_type,
-                                           const char *format, ...)
-  PRINTF_FORMAT (2, 3);
+struct text_item *text_item_create (enum text_item_type,
+                                    const char *text, const char *label);
+struct text_item *text_item_create_nocopy (enum text_item_type,
+                                           char *text, char *label);
+struct text_item *text_item_create_value (enum text_item_type,
+                                          struct pivot_value *value,
+                                          char *label);
 
 enum text_item_type text_item_get_type (const struct text_item *);
-const char *text_item_get_text (const struct text_item *);
+char *text_item_get_plain_text (const struct text_item *);
+
+struct text_item *text_item_unshare (struct text_item *);
+bool text_item_append (struct text_item *dst, const struct text_item *src);
 
 struct table_item *text_item_to_table_item (struct text_item *);
 \f