X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FCounters.h;h=d992bbb3c646f64b003eca3928d7d2372642d388;hb=f345feecede25b164502abdacf893a36de9ef4ae;hp=d32f477ea82dd2004cece50b66804c18bd3a99a9;hpb=22dc345e8cd292383be108ec9ca55af4abc58e96;p=lyx.git diff --git a/src/Counters.h b/src/Counters.h index d32f477ea8..d992bbb3c6 100644 --- a/src/Counters.h +++ b/src/Counters.h @@ -15,6 +15,8 @@ #ifndef COUNTERS_H #define COUNTERS_H +#include "OutputEnums.h" + #include "support/docstring.h" #include @@ -55,6 +57,10 @@ public: * want the version shown in an appendix. */ docstring const & labelString(bool in_appendix) const; + /// 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_; } + /// Returns a map of LaTeX-like strings to format the counter. /** For each language, the string is similar to what one gets * in LaTeX when using "\the". The \c in_appendix @@ -77,6 +83,8 @@ private: docstring labelstring_; /// The same as labelstring_, but in appendices. docstring labelstringappendix_; + /// Similar, but used for formatted references in XHTML output + docstring prettyformat_; /// Cache of the labelstring with \\the expressions expanded, /// indexed by language mutable StringMap flatlabelstring_; @@ -115,8 +123,8 @@ public: /// counter(s) for which it is the master. /// Sub-slaves are not zeroed! That happens at slave's first /// step 0->1. Seems to be sufficient. - /// \param for_output: whether to track the counters - void step(docstring const & ctr, bool track_counters = false); + /// \param utype determines whether we track the counters. + void step(docstring const & ctr, UpdateType utype); /// Reset all counters. void reset(); /// Reset counters matched by match string. @@ -136,6 +144,10 @@ public: */ docstring counterLabel(docstring const & format, std::string const & lang) const; + /// returns a formatted version of the counter, using the + /// format given by Counter::prettyFormat(). + docstring prettyCounter(docstring const & cntr, + std::string const & lang) const; /// Are we in appendix? bool appendix() const { return appendix_; } /// Set the state variable indicating whether we are in appendix.