4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
6 * \author Martin Vermeer
8 * Full author contact details are available in file CREDITS.
13 * A class describing a 'branch', i.e., a named alternative for
14 * selectively outputting some parts of a document while suppressing
17 * A branch has a name, can either be selected or not, and uses a
18 * user-specifyable background colour. All these can be set and
23 * A class containing a vector of all defined branches within a
24 * document. Has methods for selecting or deselecting branches by
25 * name, for outputting a '|'-separated string of all elements or only
26 * the selected ones, and for adding and removing elements.
40 std::string const getBranch() const;
42 void setBranch(std::string const &);
44 bool getSelected() const;
46 void setSelected(bool);
48 std::string const getColor() const;
50 void setColor(std::string const &);
66 BranchList() : separator_("|") {}
69 typedef std::list<Branch> List;
74 bool empty() { return list.empty(); }
76 bool size() const { return list.size(); }
78 List::const_iterator begin() const { return list.begin(); }
80 List::const_iterator end() const { return list.end(); }
82 std::string getColor(std::string const &) const;
84 void setColor(std::string const &, std::string const &);
85 /// Select/deselect multiple branches given in '|'-separated string
86 void setSelected(std::string const &, bool);
87 /// Add multiple branches to list
88 void add(std::string const &);
89 /// remove a branch from list by name
90 void remove(std::string const &);
91 /// return whether this branch is selected
92 bool selected(std::string const &) const;
93 /// return, as a '|'-separated string, all branch names
94 std::string allBranches() const;
96 std::string allSelected() const;
98 std::string const separator() const;
104 std::string separator_;