]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetcollapsable.h
Rename LatexRunParams::fragile as moving_arg.
[lyx.git] / src / insets / insetcollapsable.h
index 00bc07abff1bb1044da30eddf8af47d3f4c2e70a..2b33a90c956abc508e02aa407bbd794dbdccd9df 100644 (file)
 #ifndef INSETCOLLAPSABLE_H
 #define INSETCOLLAPSABLE_H
 
-
 #include "inset.h"
 #include "insettext.h"
 #include "lyxfont.h"
+#include "funcrequest.h" // for adjustCommand
 #include "LColor.h"
 
 #include <boost/weak_ptr.hpp>
@@ -32,11 +32,6 @@ class LyXCursor;
 */
 class InsetCollapsable : public UpdatableInset {
 public:
-       ///
-       enum UpdateCodes {
-               NONE = 0,
-               FULL
-       };
        ///
        static int const TEXT_TO_TOP_OFFSET = 2;
        ///
@@ -50,19 +45,14 @@ public:
        ///
        void write(Buffer const *, std::ostream &) const;
        ///
-       int ascent(BufferView *, LyXFont const &) const;
-       ///
-       int descent(BufferView *, LyXFont const &) const;
-       ///
-       int width(BufferView *, LyXFont const &) const;
-       ///
-       void draw(BufferView *, const LyXFont &, int , float &, bool) const;
+       void dimension(BufferView *, LyXFont const &, Dimension &) const;
        ///
-       void update(BufferView *, LyXFont const &, bool =false);
+       void draw(BufferView *, const LyXFont &, int, float &) const;
+       /// draw, either inlined (no button) or collapsed/open
+       void draw(BufferView * bv, LyXFont const & f,
+                 int baseline, float & x, bool inlined) const;
        ///
-       void edit(BufferView *, int, int, mouse_button::state);
-       ///
-       void edit(BufferView *, bool front = true);
+       void update(BufferView *, bool = false);
        ///
        EDITABLE editable() const;
        ///
@@ -74,8 +64,6 @@ public:
        ///
        bool isTextInset() const { return true; }
        ///
-       bool doClearArea() const;
-       ///
        void insetUnlock(BufferView *);
        ///
        bool needFullRow() const { return isOpen(); }
@@ -92,7 +80,7 @@ public:
        RESULT localDispatch(FuncRequest const &);
        ///
        int latex(Buffer const *, std::ostream &,
-                 bool fragile, bool free_spc) const;
+                 LatexRunParams const &) const;
        ///
        int ascii(Buffer const *, std::ostream &, int) const;
        ///
@@ -101,14 +89,10 @@ public:
        int docbook(Buffer const *, std::ostream &, bool mixcont) const;
        ///
        void validate(LaTeXFeatures & features) const;
-       ///
+       /// FIXME, document
        void getCursorPos(BufferView *, int & x, int & y) const;
-       ///
-       void toggleInsetCursor(BufferView *);
-       ///
-       void showInsetCursor(BufferView *, bool show = true);
-       ///
-       void hideInsetCursor(BufferView *);
+       /// Get the absolute document x,y of the cursor
+       virtual void getCursor(BufferView &, int &, int &) const;
        ///
        void fitInsetCursor(BufferView * bv) const {
                inset.fitInsetCursor(bv);
@@ -126,10 +110,6 @@ public:
 #if 0
        ///
        void setAutoCollapse(bool f) { autocollapse = f; }
-#endif
-#if 0
-       ///
-       int getMaxWidth(BufferView *, UpdatableInset const *) const;
 #endif
        ///
        LyXText * getLyXText(BufferView const *, bool const recursive) const;
@@ -154,9 +134,7 @@ public:
        ///
        Inset * getInsetFromID(int id) const;
        ///
-       Paragraph * firstParagraph() const;
-       ///
-       Paragraph * getFirstParagraph(int) const;
+       ParagraphList * getParagraphs(int) const;
        ///
        LyXCursor const & cursor(BufferView *) const;
        ///
@@ -199,13 +177,11 @@ protected:
        virtual BufferView * view() const;
 
        ///
-       int ascent_collapsed() const;
+       void dimension_collapsed(Dimension &) const;
        ///
-       int descent_collapsed() const;
+       int height_collapsed() const;
        ///
-       int width_collapsed() const;
-       ///
-       void draw_collapsed(Painter & pain, int , float &) const;
+       void draw_collapsed(Painter & pain, int, float &) const;
        ///
        int getMaxTextWidth(Painter & pain, UpdatableInset const *) const;
 
@@ -228,15 +204,12 @@ protected:
        ///
        mutable int topx;
        mutable int topbaseline;
-       mutable UpdateCodes need_update;
 
 private:
        ///
-       void lfunMousePress(FuncRequest const &);
-       ///
-       bool lfunMouseRelease(FuncRequest const &);
+       void lfunMouseRelease(FuncRequest const &);
        ///
-       void lfunMouseMotion(FuncRequest const &);
+       FuncRequest adjustCommand(FuncRequest const &);
 
        ///
        mutable string label;