]> git.lyx.org Git - lyx.git/blobdiff - src/Counters.h
do what the FIXME suggested
[lyx.git] / src / Counters.h
index f2d4df71573f7abbec790e690f9471b0ff5ca813..96b14266c3539a11857089f8b7a060d5fda30160 100644 (file)
@@ -18,6 +18,7 @@
 #include "support/docstring.h"
 
 #include <map>
+#include <set>
 
 
 namespace lyx {
@@ -105,7 +106,8 @@ public:
        docstring theCounter(docstring const & c);
        /// Replace om format all the LaTeX-like macros that depend on
        /// counters.
-       docstring counterLabel(docstring const & format);
+       docstring counterLabel(docstring const & format, 
+                              std::set<docstring> * callers = 0);
        /// Are we in apendix?
        bool appendix() const { return appendix_; };
        /// Set the state variable indicating whether we are in appendix.
@@ -114,7 +116,15 @@ public:
        std::string const & current_float() const { return current_float_; }
        /// Sets the current enclosing float.
        void current_float(std::string const & f) { current_float_ = f; }
+       /// Are we in a subfloat?
+       bool isSubfloat() const { return subfloat_; }
+       /// Set the state variable indicating whether we are in a subfloat.
+       void isSubfloat(bool s) { subfloat_ = s; };
 private:
+       /// returns the expanded string representation of the counter
+       /// with recursion protection through callers.
+       docstring theCounter(docstring const & c, 
+                            std::set<docstring> & callers);
        /// Returns the value of the counter according to the
        /// numbering scheme numbertype.
        /* Available numbering schemes are arabic (1, 2,...), roman
@@ -131,6 +141,8 @@ private:
        bool appendix_;
        /// The current enclosing float.
        std::string current_float_;
+       /// Are we in a subfloat?
+       bool subfloat_;
 };