#define PARAGRAPH_H
#include "FontEnums.h"
-#include "LayoutPtr.h"
+#include "Layout.h"
#include "insets/InsetCode.h"
};
+///
+enum AsStringParameter
+{
+ AS_STR_NONE = 0, ///< No option, only printable characters.
+ AS_STR_LABEL = 1, ///< Prefix with paragraph label.
+ AS_STR_INSETS = 2 ///< Go into insets.
+};
+
+
/// A Paragraph holds all text, attributes and insets in a text paragraph
class Paragraph
{
bool isMultiLingual(BufferParams const &) const;
/// Convert the paragraph to a string.
- /// Used for building the table of contents
- docstring asString(bool label) const;
+ /// \param AsStringParameter options. This can contain any combination of
+ /// asStringParameter values. Valid examples:
+ /// asString(AS_STR_LABEL)
+ /// asString(AS_STR_LABEL | AS_STR_INSETS)
+ /// asString(AS_STR_INSETS)
+ docstring asString(int options = AS_STR_NONE) const;
///
- docstring asString(pos_type beg, pos_type end, bool label) const;
+ docstring asString(pos_type beg, pos_type end,
+ int options = AS_STR_NONE) const;
///
void write(std::ostream &, BufferParams const &,
bool empty() const;
///
- LayoutPtr const & layout() const;
- ///
- void setLayout(LayoutPtr const & layout);
- ///
- void setLayout(Layout const & layout) { setLayout(&layout); }
+ Layout const & layout() const;
+ /// Do not pass a temporary to this!
+ void setLayout(Layout const & layout);
///
void setEmptyOrDefaultLayout(DocumentClass const & tc);
docstring const translateIfPossible(docstring const & label,
BufferParams const & bparams) const;
/// Expand the counters for the labelstring of \c layout
- docstring expandLabel(LayoutPtr const &, BufferParams const &,
+ docstring expandLabel(Layout const &, BufferParams const &,
bool process_appendix = true) const;
/// Actual paragraph alignment used
char getAlign() const;