]> git.lyx.org Git - lyx.git/blobdiff - src/Counters.h
Limit the nopassthurchars case in beamer to URL
[lyx.git] / src / Counters.h
index 41ee930583781f86cbcc525c8d930e7144825a1f..67a790fc0c93b3c5a96f6d6387cb0d5883dd2195 100644 (file)
@@ -26,7 +26,8 @@
 namespace lyx {
 
 class Layout;
-class Lexer;
+
+namespace support { class Lexer; }
 
 /// This represents a single counter.
 class Counter {
@@ -38,7 +39,7 @@ public:
                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);
        ///
@@ -69,6 +70,8 @@ public:
        /// 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_; }
@@ -103,6 +106,8 @@ private:
        /// 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_;
@@ -138,7 +143,7 @@ public:
        /// \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);
        ///
@@ -183,6 +188,11 @@ public:
        /// 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;
        ///