Counter();
///
Counter(docstring const & mc, docstring const & ls,
- docstring const & lsa);
+ docstring const & lsa, docstring const & guiname);
/// \return true on success
bool read(Lexer & lex);
///
///
int value() const;
///
+ void saveValue();
+ ///
+ void restoreValue();
+ ///
void step();
///
void reset();
/// Similar, but used for formatted references in XHTML output.
/// E.g., for a section counter it might be "section \thesection"
docstring const & prettyFormat() const { return prettyformat_; }
+ ///
+ docstring const & guiName() const { return guiname_; }
/// Returns a map of LaTeX-like strings to format the counter.
/** For each language, the string is similar to what one gets
/// This is actually one less than the initial value, since the
/// counter is always stepped before being used.
int initial_value_;
+ ///
+ int saved_value_;
/// contains master counter name.
/** The master counter is the counter that, if stepped
* (incremented) zeroes this counter. E.g. "subsection"'s
docstring labelstringappendix_;
/// Similar, but used for formatted references in XHTML output
docstring prettyformat_;
+ ///
+ docstring guiname_;
/// Cache of the labelstring with \\the<counter> expressions expanded,
/// indexed by language
mutable StringMap flatlabelstring_;
void newCounter(docstring const & newc,
docstring const & masterc,
docstring const & ls,
- docstring const & lsa);
+ docstring const & lsa,
+ docstring const & guiname);
/// Checks whether the given counter exists.
bool hasCounter(docstring const & c) const;
/// reads the counter name
void addto(docstring const & ctr, int val);
///
int value(docstring const & ctr) const;
+ ///
+ void saveValue(docstring const & ctr) const;
+ ///
+ void restoreValue(docstring const & ctr) const;
/// Reset recursively all the counters that are slaves of the one named by \c ctr.
void resetSlaves(docstring const & ctr);
/// Increment by one master of counter named by \c ctr.
/// format given by Counter::prettyFormat().
docstring prettyCounter(docstring const & cntr,
std::string const & lang) const;
+ ///
+ docstring const & guiName(docstring const & cntr) const;
/// Are we in appendix?
bool appendix() const { return appendix_; }
/// Set the state variable indicating whether we are in appendix.
/// Also for updateBuffer().
/// Call this when entering things like footnotes, where there is now
/// no "last layout" and we want to restore the "last layout" on exit.
- void clearLastLayout() { layout_stack_.push_back(0); }
+ void clearLastLayout() { layout_stack_.push_back(nullptr); }
/// Call this when exiting things like footnotes.
void restoreLastLayout() { layout_stack_.pop_back(); }
///
///
void restoreLastCounter() { counter_stack_.pop_back(); }
// @}
+ ///
+ std::vector<docstring> listOfCounters() const;
private:
/** expands recursively any \\the<counter> macro in the
* labelstring of \c counter. The \c lang code is used to