]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetcollapsable.h
Clean up InsetGraphics::Cache and rename as GraphicsInset.
[lyx.git] / src / insets / insetcollapsable.h
index f5b05f62116153bac57d107d9cb6bb09760d50cd..f6b8c70cd3a5f8642dbf1c823936e64c9bc1e8f7 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>
@@ -37,30 +37,21 @@ public:
        ///
        static int const TEXT_TO_BOTTOM_OFFSET = 2;
        /// inset is initially collapsed if bool = true
-       InsetCollapsable(BufferParams const &, bool = false);
+       InsetCollapsable(BufferParams const &, bool collapsed = false);
        ///
-       InsetCollapsable(InsetCollapsable const & in, bool same_id = false);
+       InsetCollapsable(InsetCollapsable const & in);
        ///
        void read(Buffer const *, LyXLex &);
        ///
        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 metrics(MetricsInfo &, Dimension &) const;
        ///
-       void draw(BufferView *, const LyXFont &, int , float &) const;
+       void draw(PainterInfo & pi, int x, int y) const;
        /// draw, either inlined (no button) or collapsed/open
-       void draw(BufferView * bv, LyXFont const & f,
-                 int baseline, float & x, bool inlined) const;
-       ///
-       void update(BufferView *, bool =false);
-       ///
-       void edit(BufferView *, int, int, mouse_button::state);
+       void draw(PainterInfo & pi, int x, int y, bool inlined) const;
        ///
-       void edit(BufferView *, bool front = true);
+       void update(BufferView *, bool = false);
        ///
        EDITABLE editable() const;
        ///
@@ -88,7 +79,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;
        ///
@@ -142,7 +133,7 @@ public:
        ///
        Inset * getInsetFromID(int id) const;
        ///
-       Paragraph * getFirstParagraph(int) const;
+       ParagraphList * getParagraphs(int) const;
        ///
        LyXCursor const & cursor(BufferView *) const;
        ///
@@ -164,9 +155,9 @@ public:
        void toggleSelection(BufferView * bv, bool kill_selection) {
                inset.toggleSelection(bv, kill_selection);
        }
+
        void markErased();
+
        bool nextChange(BufferView * bv, lyx::pos_type & length);
 
        ///
@@ -185,13 +176,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(PainterInfo & pi, int x, int y) const;
        ///
        int getMaxTextWidth(Painter & pain, UpdatableInset const *) const;
 
@@ -217,11 +206,9 @@ protected:
 
 private:
        ///
-       void lfunMousePress(FuncRequest const &);
-       ///
-       bool lfunMouseRelease(FuncRequest const &);
+       void lfunMouseRelease(FuncRequest const &);
        ///
-       void lfunMouseMotion(FuncRequest const &);
+       FuncRequest adjustCommand(FuncRequest const &);
 
        ///
        mutable string label;