]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetBranch.h
Cleanup mouse/selection/context-menu interactions.
[lyx.git] / src / insets / InsetBranch.h
index c8e3c47c5177c5b03be168900cb1b86f69a5d3af..8793602a2e1299bcea5305387d395a26e9d79929 100644 (file)
@@ -18,8 +18,6 @@
 
 namespace lyx {
 
-class Buffer;
-
 class InsetBranchParams {
 public:
        explicit InsetBranchParams(docstring const & b = docstring())
@@ -27,7 +25,7 @@ public:
        ///
        void write(std::ostream & os) const;
        ///
-       void read(LyXLex & lex);
+       void read(Lexer & lex);
        ///
        docstring branch;
 };
@@ -39,32 +37,31 @@ public:
 class InsetBranch : public InsetCollapsable {
 public:
        ///
-       InsetBranch(BufferParams const &, InsetBranchParams const &);
+       InsetBranch(Buffer const &, InsetBranchParams const &);
        ///
        ~InsetBranch();
        ///
-       virtual docstring const editMessage() const;
+       docstring editMessage() const;
        ///
-       InsetBase::Code lyxCode() const { return InsetBase::BRANCH_CODE; }
+       InsetCode lyxCode() const { return BRANCH_CODE; }
        ///
-       void write(Buffer const &, std::ostream &) const;
+       void write(std::ostream &) const;
        ///
-       void read(Buffer const & buf, LyXLex & lex);
+       void read(Lexer & lex);
        ///
        void setButtonLabel();
        ///
+       virtual ColorCode backgroundColor() const;
+       ///
        bool showInsetDialog(BufferView *) const;
        ///
-       int latex(Buffer const &, odocstream &,
-                 OutputParams const &) const;
+       int latex(odocstream &, OutputParams const &) const;
        ///
-       int plaintext(Buffer const &, odocstream &,
-                     OutputParams const &) const;
+       int plaintext(odocstream &, OutputParams const &) const;
        ///
-       int docbook(Buffer const &, odocstream &,
-                   OutputParams const &) const;
+       int docbook(odocstream &, OutputParams const &) const;
        ///
-       void textString(Buffer const & buf, odocstream &) const;
+       void textString(odocstream &) const;
        ///
        void validate(LaTeXFeatures &) const;
        ///
@@ -75,20 +72,27 @@ public:
        /** \returns true if params_.branch is listed as 'selected' in
            \c buffer. This handles the case of child documents.
         */
-       bool isBranchSelected(Buffer const & buffer) const;
+       bool isBranchSelected() const;
        ///
-       bool getStatus(LCursor &, FuncRequest const &, FuncStatus &) const;
-
+       bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const;
+       ///
+       virtual void updateLabels(ParIterator const &);
+       ///
+       bool isMacroScope() const;
+       ///
+       docstring toolTip(BufferView const & bv, int x, int y) const;
+       ///
+       virtual bool useEmptyLayout() const { return false; }
 protected:
-       InsetBranch(InsetBranch const &);
-       virtual void doDispatch(LCursor & cur, FuncRequest & cmd);
+       ///
+       void doDispatch(Cursor & cur, FuncRequest & cmd);
+       ///
+       docstring name() const { return from_ascii("Branch"); }
 private:
+       ///
        friend class InsetBranchParams;
-
-       virtual std::auto_ptr<InsetBase> doClone() const;
-
-       /// used by the constructors
-       void init();
+       ///
+       Inset * clone() const { return new InsetBranch(*this); }
        ///
        InsetBranchParams params_;
 };
@@ -99,7 +103,7 @@ public:
        ///
        InsetBranchMailer(InsetBranch & inset);
        ///
-       virtual InsetBase & inset() const { return inset_; }
+       virtual Inset & inset() const { return inset_; }
        ///
        virtual std::string const & name() const { return name_; }
        ///