]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetBranch.h
Revert "Do not crash is release mode if we stumble across an unrealized font."
[lyx.git] / src / insets / InsetBranch.h
index a2f6c28a20b47fb52094aa068d912aada2fddc75..83783e71ebaadb9e4650cfcf8544167360201c3d 100644 (file)
 
 #include "InsetCollapsable.h"
 
-
 namespace lyx {
 
 class InsetBranchParams {
 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;
 };
 
 
@@ -43,9 +46,7 @@ class InsetBranch : public InsetCollapsable
 {
 public:
        ///
-       InsetBranch(Buffer const &, InsetBranchParams const &);
-       ///
-       ~InsetBranch();
+       InsetBranch(Buffer *, InsetBranchParams const &);
 
        ///
        static std::string params2string(InsetBranchParams const &);
@@ -53,10 +54,12 @@ public:
        static void string2params(std::string const &, InsetBranchParams &);
        ///
        docstring branch() const { return params_.branch; }
+       ///
+       void rename(docstring const & newname) { params_.branch = newname; }
+       ///
+       InsetBranchParams const & params() const { return params_; }
 
 private:
-       ///
-       docstring editMessage() const;
        ///
        InsetCode lyxCode() const { return BRANCH_CODE; }
        ///
@@ -64,45 +67,43 @@ private:
        ///
        void read(Lexer & lex);
        ///
-       docstring const buttonLabel(BufferView const & bv) const;
-       ///
-       ColorCode backgroundColor() const;
+       docstring const buttonLabel(BufferView const &) const;
        ///
-       bool showInsetDialog(BufferView *) const;
+       ColorCode backgroundColor(PainterInfo const &) const;
        ///
-       int latex(odocstream &, OutputParams 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;
        ///
-       docstring xhtml(odocstream &, OutputParams const &) const;
+       docstring xhtml(XHTMLStream &, OutputParams const &) const;
        ///
-       void tocString(odocstream &) const;
+       void toString(odocstream &) const;
        ///
-       void validate(LaTeXFeatures &) const;
+       void forOutliner(docstring &, size_t const, bool const) const;
        ///
-       docstring contextMenu(BufferView const &, int, int) const;
+       void validate(LaTeXFeatures &) const;
        ///
-       void addToToc(DocIterator const &);
+       std::string contextMenuName() const;
        ///
-       InsetBranchParams const & params() const { return params_; }
+       void addToToc(DocIterator const & di, bool output_active,
+                                 UpdateType utype) const;
        ///
        void setParams(InsetBranchParams const & params) { params_ = params; }
-       ///
-       virtual bool usePlainLayout() { return false; }
 
        /** \returns true if params_.branch is listed as 'selected' in
-           \c buffer. This handles the case of child documents.
+               \c buffer. \p child only checks within child documents.
         */
-       bool isBranchSelected() const;
+       bool isBranchSelected(bool const child = false) const;
        /*!
         * 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;
        ///
@@ -114,7 +115,7 @@ private:
        ///
        void doDispatch(Cursor & cur, FuncRequest & cmd);
        ///
-       docstring name() const { return from_ascii("Branch"); }
+       docstring layoutName() const { return from_ascii("Branch:") + branch(); }
        ///
        Inset * clone() const { return new InsetBranch(*this); }