]> git.lyx.org Git - lyx.git/blobdiff - src/Counters.h
ctests: categorize #12708 test file as resolved
[lyx.git] / src / Counters.h
index e6554a284f37ae150e6fc709eab8c68a6567e98a..5be4aca197b8df7b878f628f6d483452864da919 100644 (file)
@@ -35,7 +35,8 @@ public:
        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);
        ///
@@ -68,7 +69,11 @@ 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_; }
 
        /// Returns a map of LaTeX-like strings to format the counter.
        /** For each language, the string is similar to what one gets
@@ -100,7 +105,11 @@ 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_;
        /// Cache of the labelstring with \\the<counter> expressions expanded,
        /// indexed by language
        mutable StringMap flatlabelstring_;
@@ -125,6 +134,7 @@ public:
                        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;
@@ -158,12 +168,10 @@ public:
        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.
         */
@@ -179,8 +187,15 @@ 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;
+       ///
+       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.