]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insettext.h
Enable the external inset to handle unknown templates gracefully.
[lyx.git] / src / insets / insettext.h
index f8b1161bd196ea642156c489a660fd1e2a1accab..52f76e7e2c9c7f05b2a8360c47f0d6f72aa02d49 100644 (file)
 #ifndef INSETTEXT_H
 #define INSETTEXT_H
 
-
 #include "updatableinset.h"
 #include "LString.h"
 #include "LColor.h"
 #include "ParagraphList.h"
 #include "RowList.h"
+#include "dimension.h"
+#include "frontends/mouse_state.h"
 
 #include "support/types.h"
 
@@ -72,11 +73,11 @@ public:
        InsetText(BufferParams const &);
        ///
        explicit
-       InsetText(InsetText const &, bool same_id = false);
+       InsetText(InsetText const &);
        ///
        ~InsetText();
        ///
-       Inset * clone(Buffer const &, bool same_id = false) const;
+       Inset * clone() const;
        ///
        InsetText & operator=(InsetText const & it);
        /// empty inset to empty par, or just mark as erased
@@ -86,15 +87,11 @@ 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 & f) const;
+       void metrics(MetricsInfo &, Dimension &) const;
        ///
        int textWidth(BufferView *, bool fordraw = false) const;
        ///
-       void draw(BufferView *, LyXFont const &, int , float &) const;
+       void draw(PainterInfo & pi, int x, int y) const;
        ///
        void update(BufferView *, bool = false);
        ///
@@ -102,10 +99,6 @@ public:
        ///
        string const editMessage() const;
        ///
-       void edit(BufferView *, int, int, mouse_button::state);
-       ///
-       void edit(BufferView *, bool front = true);
-       ///
        bool isTextInset() const { return true; }
        ///
        void insetUnlock(BufferView *);
@@ -120,7 +113,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 linelen) const;
        ///
@@ -154,11 +147,11 @@ public:
        ///
        int getMaxWidth(BufferView *, UpdatableInset const *) const;
        ///
-       void init(InsetText const * ins = 0, bool same_id = false);
+       void init(InsetText const * ins);
        ///
        void writeParagraphData(Buffer const *, std::ostream &) const;
        ///
-       void setParagraphData(ParagraphList const &, bool same_id = false);
+       void setParagraphData(ParagraphList const &);
        ///
        void setText(string const &, LyXFont const &);
        ///
@@ -203,8 +196,6 @@ public:
        ///
        LyXCursor const & cursor(BufferView *) const;
        ///
-       void paragraph(Paragraph *);
-       ///
        bool allowSpellcheck() const { return true; }
        ///
        WordLangTuple const
@@ -355,11 +346,7 @@ private:
        ///
        mutable bool locked;
        ///
-       mutable int insetAscent;
-       ///
-       mutable int insetDescent;
-       ///
-       mutable int insetWidth;
+       mutable Dimension dim_;
        ///
        mutable int top_y;
        ///
@@ -390,9 +377,9 @@ private:
        mutable boost::shared_ptr<LyXText> cached_text;
        ///
        struct save_state {
-               Paragraph * lpar;
-               Paragraph * selstartpar;
-               Paragraph * selendpar;
+               ParagraphList::iterator lpar;
+               ParagraphList::iterator selstartpar;
+               ParagraphList::iterator selendpar;
                lyx::pos_type pos;
                lyx::pos_type selstartpos;
                lyx::pos_type selendpos;