1 /*=============================================================================
2 Copyright (c) 2011,2013 Daniel James
4 Use, modification and distribution is subject to the Boost Software
5 License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
6 http://www.boost.org/LICENSE_1_0.txt)
7 =============================================================================*/
9 #if !defined(BOOST_QUICKBOOK_DOCUMENT_STATE_HPP)
10 #define BOOST_QUICKBOOK_DOCUMENT_STATE_HPP
12 #include <boost/scoped_ptr.hpp>
13 #include "string_view.hpp"
16 #include "syntax_highlight.hpp"
22 // Higher categories get priority over lower ones.
29 numbered, // Just used to avoid random docbook ids
30 generated, // Generated ids for other elements.
31 generated_heading, // Generated ids for headings.
32 generated_section, // Generated ids for sections.
33 generated_doc, // Generated ids for document.
34 explicit_id, // Explicitly given by user
39 id_category() : c(default_category) {}
40 id_category(categories c_) : c(c_) {}
41 explicit id_category(int c_) : c(categories(c_)) {}
43 bool operator==(id_category rhs) const { return c == rhs.c; }
48 struct document_state_impl;
55 std::string start_file_with_docinfo(
56 unsigned compatibility_version,
57 quickbook::string_view include_doc_id,
58 quickbook::string_view id,
62 unsigned compatibility_version,
63 quickbook::string_view include_doc_id,
64 quickbook::string_view id,
69 std::string begin_section(value const&,
70 quickbook::string_view, id_category, source_mode_info const&);
72 int section_level() const;
73 value const& explicit_id() const;
74 source_mode_info section_source_mode() const;
76 std::string old_style_id(quickbook::string_view, id_category);
77 std::string add_id(quickbook::string_view, id_category);
78 std::string add_anchor(quickbook::string_view, id_category);
80 std::string replace_placeholders_with_unresolved_ids(
81 quickbook::string_view) const;
82 std::string replace_placeholders(quickbook::string_view) const;
84 unsigned compatibility_version() const;
86 boost::scoped_ptr<document_state_impl> state;