]> git.lyx.org Git - lyx.git/blobdiff - src/Counters.h
cosmetics
[lyx.git] / src / Counters.h
index f2d4df71573f7abbec790e690f9471b0ff5ca813..28e7b686322791d3236f7b056c50a0893965d744 100644 (file)
@@ -18,6 +18,7 @@
 #include "support/docstring.h"
 
 #include <map>
+#include <set>
 
 
 namespace lyx {
@@ -72,6 +73,8 @@ private:
 /// Every instantiation is an array of counters of type Counter.
 class Counters {
 public:
+       ///
+       Counters() : appendix_(false), subfloat_(false) {}
        /// Add a new counter to array.
        void newCounter(docstring const & newc);
        /// Add new counter having oldc as its master and ls as its label.
@@ -105,7 +108,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 +118,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 +143,8 @@ private:
        bool appendix_;
        /// The current enclosing float.
        std::string current_float_;
+       /// Are we in a subfloat?
+       bool subfloat_;
 };