]> git.lyx.org Git - lyx.git/blobdiff - src/BranchList.h
* GuiDocument.cpp:
[lyx.git] / src / BranchList.h
index 68cc46cebc8bad7715993f5ba9304c825438d2ae..08a719a1c7cbb0c92076839cf330680eebc25478 100644 (file)
@@ -27,8 +27,8 @@
  */
 
 
-#ifndef BRANCHES_H
-#define BRANCHES_H
+#ifndef BRANCHLIST_H
+#define BRANCHLIST_H
 
 #include "ColorCode.h"
 
 
 namespace lyx {
 
-
 class Branch {
 public:
        ///
        Branch();
        ///
-       docstring const & getBranch() const;
+       docstring const & branch() const;
        ///
        void setBranch(docstring const &);
        ///
-       bool getSelected() const;
+       bool isSelected() const;
        /** Select/deselect the branch.
         *  \return true if the selection status changes.
         */
        bool setSelected(bool);
        ///
-       RGBColor const & getColor() const;
+       RGBColor const & color() const;
        ///
        void setColor(RGBColor const &);
        /**
@@ -106,6 +105,12 @@ public:
         *  \returns true if a branch is removed.
         */
        bool remove(docstring const &);
+       /** rename an branch in list
+        *  \returns true if renaming succeeded.
+        * if \p merge is true, the branch will be removed
+        * if a branch with the newname already exists.
+        */
+       bool rename(docstring const &, docstring const &, bool const merge = false);
 
 private:
        ///
@@ -114,20 +119,6 @@ private:
        docstring separator_;
 };
 
-
-class BranchNamesEqual : public std::unary_function<Branch, bool> {
-public:
-       BranchNamesEqual(docstring const & name)
-               : name_(name) {}
-       bool operator()(Branch const & branch) const
-       {
-               return branch.getBranch() == name_;
-       }
-private:
-       docstring name_;
-};
-
-
 } // namespace lyx
 
-#endif
+#endif // BRANCHLIST_H