4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
7 * \author Martin Vermeer
9 * Full author contact details are available in file CREDITS.
16 #include "insetcollapsable.h"
17 #include "BranchList.h"
19 struct InsetBranchParams {
21 void write(std::ostream & os) const;
23 void read(LyXLex & lex);
27 BranchList branchlist;
31 /** The Branch inset for alternative, conditional output.
34 class InsetBranch : public InsetCollapsable {
39 InsetBranch(BufferParams const &, std::string const &);
41 InsetBranch(InsetBranch const &);
45 virtual std::auto_ptr<InsetBase> clone() const;
47 std::string const editMessage() const;
49 InsetOld::Code lyxCode() const { return InsetOld::BRANCH_CODE; }
51 void write(Buffer const &, std::ostream &) const;
53 void read(Buffer const & buf, LyXLex & lex);
55 void setButtonLabel();
57 bool showInsetDialog(BufferView *) const;
59 int latex(Buffer const &, std::ostream &,
60 LatexRunParams const &) const;
62 int linuxdoc(Buffer const &, std::ostream &) const;
64 int docbook(Buffer const &, std::ostream &, bool) const;
66 int ascii(Buffer const &, std::ostream &, int) const;
68 void validate(LaTeXFeatures &) const;
70 InsetBranchParams const & params() const { return params_; }
72 void setParams(InsetBranchParams const & params) { params_ = params; }
77 priv_dispatch(FuncRequest const &, idx_type &, pos_type &);
79 friend class InsetBranchParams;
81 /// used by the constructors
84 InsetBranchParams params_;
87 #include "mailinset.h"
89 class InsetBranchMailer : public MailInset {
92 InsetBranchMailer(std::string const & name, InsetBranch & inset);
94 virtual InsetBase & inset() const { return inset_; }
96 virtual std::string const & name() const { return name_; }
98 virtual std::string const inset2string(Buffer const &) const;
100 static std::string const params2string(std::string const &, InsetBranchParams const &);
102 static void string2params(std::string const &, InsetBranchParams &);
106 std::string const name_;
108 InsetBranch & inset_;