]> git.lyx.org Git - lyx.git/blobdiff - src/BranchList.h
* Painter.h:
[lyx.git] / src / BranchList.h
index 184e3f3cf8ca7389df12fb8fe65573cb5aa86f0b..77b8d2be93c768b4d064fe105fa7ded1cb6e3ea4 100644 (file)
 #ifndef BRANCHES_H
 #define BRANCHES_H
 
+#include "Color.h"
+
 #include <string>
 #include <list>
 
 
+namespace lyx {
+
+
 class Branch {
 public:
+       ///
+       Branch();
        ///
        std::string const & getBranch() const;
        ///
@@ -47,18 +54,24 @@ public:
         */
        bool setSelected(bool);
        ///
-       std::string const & getColor() const;
+       RGBColor const & getColor() const;
        ///
+       void setColor(RGBColor const &);
+       /**
+        * Set color from a string "#rrggbb".
+        * Use LColor:background if the string is no valid color.
+        * This ensures compatibility with LyX 1.4.0 that had the symbolic
+        * color "none" that was displayed as LColor:background.
+        */
        void setColor(std::string const &);
 
-
 private:
        ///
        std::string branch_;
        ///
        bool selected_;
        ///
-       std::string color_;
+       RGBColor color_;
 };
 
 
@@ -72,7 +85,7 @@ public:
        BranchList() : separator_("|") {}
 
        ///
-       bool empty() { return list.empty(); }
+       bool empty() const { return list.empty(); }
        ///
        void clear() { list.clear(); }
        ///
@@ -113,4 +126,7 @@ private:
        std::string name_;
 };
 
+
+} // namespace lyx
+
 #endif