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.
39 string const getBranch() const;
41 void setBranch(string const &);
43 bool getSelected() const;
45 void setSelected(bool);
47 string const getColor() const;
49 void setColor(string const &);
65 BranchList() : separator_("|") {}
68 typedef std::list<Branch> List;
73 bool empty() { return list.empty(); }
75 bool size() const { return list.size(); }
77 List::const_iterator begin() const { return list.begin(); }
79 List::const_iterator end() const { return list.end(); }
81 string getColor(string const &) const;
83 void setColor(string const &, string const &);
84 /// Select/deselect multiple branches given in '|'-separated string
85 void setSelected(string const &, bool);
86 /// Add multiple branches to list
87 void add(string const &);
88 /// remove a branch from list by name
89 void remove(string const &);
90 /// return whether this branch is selected
91 bool selected(string const &) const;
92 /// return, as a '|'-separated string, all branch names
93 string allBranches() const;
95 string allSelected() const;
97 string const separator() const;