namespace lyx {
class Layout;
-class Lexer;
+
+namespace support { class Lexer; }
/// This represents a single counter.
class Counter {
Counter();
///
Counter(docstring const & mc, docstring const & ls,
- docstring const & lsa, docstring const & guiname);
+ docstring const & lsa, docstring const & prettyformat,
+ docstring const & guiname);
/// \return true on success
- bool read(Lexer & lex);
+ bool read(support::Lexer & lex);
///
void set(int v);
///
/// E.g., for a section counter it might be "section \thesection"
docstring const & prettyFormat() const { return prettyformat_; }
///
+ docstring const & refFormat(docstring const & prefix) const;
+ ///
docstring const & guiName() const { return guiname_; }
+ ///
+ docstring const & latexName() const { return latexname_; }
/// Returns a map of LaTeX-like strings to format the counter.
/** For each language, the string is similar to what one gets
/// Similar, but used for formatted references in XHTML output
docstring prettyformat_;
///
+ std::map<docstring, docstring> ref_formats_;
+ ///
docstring guiname_;
+ /// The name used for the counter in LaTeX
+ docstring latexname_;
/// Cache of the labelstring with \\the<counter> expressions expanded,
/// indexed by language
mutable StringMap flatlabelstring_;
docstring const & parentc,
docstring const & ls,
docstring const & lsa,
+ docstring const & prettyformat,
docstring const & guiname);
/// Checks whether the given counter exists.
bool hasCounter(docstring const & c) const;
/// \param makeNew whether to make a new counter if one
/// doesn't already exist
/// \return true on success
- bool read(Lexer & lex, docstring const & name, bool makenew);
+ bool read(support::Lexer & lex, docstring const & name, bool makenew);
///
void set(docstring const & ctr, int val);
///
void reset();
/// Reset counters matched by match string.
void reset(docstring const & match);
+ /// Copy counter \p cnt to \p newcnt.
+ bool copy(docstring const & cnt, docstring const & newcnt);
/// Remove counter \p cnt.
bool remove(docstring const & cnt);
- /// Copy counters whose name matches match from the &from to
- /// the &to array of counters. Empty string matches all.
- void copy(Counters const & from, Counters & to,
- docstring const & match = docstring()) const;
/** returns the expanded string representation of counter \c
* c. The \c lang code is used to translate the string.
*/
/// format given by Counter::prettyFormat().
docstring prettyCounter(docstring const & cntr,
std::string const & lang) const;
+ /// returns a formatted version of the counter, using the
+ /// format given by Counter::prettyFormat().
+ docstring formattedCounter(docstring const & cntr,
+ docstring const & prefix,
+ std::string const & lang) const;
///
docstring const & guiName(docstring const & cntr) const;
+ ///
+ docstring const & latexName(docstring const & cntr) const;
/// Are we in appendix?
bool appendix() const { return appendix_; }
/// Set the state variable indicating whether we are in appendix.