#ifndef INSETBRANCH_H
#define INSETBRANCH_H
-#include "InsetCollapsable.h"
+#include "InsetCollapsible.h"
namespace lyx {
public:
///
explicit InsetBranchParams(docstring const & b = docstring())
- : branch(b) {}
+ : branch(b), inverted(false) {}
+ InsetBranchParams(docstring const & b, bool i)
+ : branch(b), inverted(i) {}
///
void write(std::ostream & os) const;
///
void read(Lexer & lex);
///
docstring branch;
+ ///
+ bool inverted;
};
/// The Branch inset for alternative, conditional output.
-class InsetBranch : public InsetCollapsable
+class InsetBranch : public InsetCollapsible
{
public:
///
docstring branch() const { return params_.branch; }
///
void rename(docstring const & newname) { params_.branch = newname; }
+ ///
+ InsetBranchParams const & params() const { return params_; }
private:
///
///
void read(Lexer & lex);
///
- docstring const buttonLabel(BufferView const & bv) const;
+ docstring const buttonLabel(BufferView const &) const;
///
ColorCode backgroundColor(PainterInfo const &) const;
///
void latex(otexstream &, OutputParams const &) const;
///
- int plaintext(odocstream &, OutputParams const &) const;
+ int plaintext(odocstringstream & ods, OutputParams const & op,
+ size_t max_length = INT_MAX) const;
///
int docbook(odocstream &, OutputParams const &) const;
///
///
void toString(odocstream &) const;
///
- void forToc(docstring &, size_t) const;
+ void forOutliner(docstring &, size_t const, bool const) const;
///
void validate(LaTeXFeatures &) const;
///
std::string contextMenuName() const;
///
- void addToToc(DocIterator const &) const;
- ///
- InsetBranchParams const & params() const { return params_; }
+ void updateBuffer(ParIterator const & it, UpdateType utype);
///
void setParams(InsetBranchParams const & params) { params_ = params; }
/*!
* Is the content of this inset part of the output document?
*
- * Note that Branch insets are only considered part of the
- * document when they are selected.
+ * Note that Branch insets are considered part of the
+ * document when they are selected XOR inverted.
*/
- bool producesOutput() const { return isBranchSelected(); }
+ bool producesOutput() const;
///
bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const;
///