]> git.lyx.org Git - features.git/blobdiff - src/insets/InsetText.h
* Lazy MathData to avoid unneeded interpretation of macro definitions
[features.git] / src / insets / InsetText.h
index 6d72ec31f11d7474875b015e55af967b4a0a6eac..40efd2b7aaeeb632d84b96a9fe1439d25c090298 100644 (file)
 #define INSETTEXT_H
 
 #include "Inset.h"
-#include "Font.h"
+
+#include "ColorCode.h"
 #include "Text.h"
 
 #include "support/types.h"
 
-#include "frontends/mouse_state.h"
-
-
 namespace lyx {
 
 class Buffer;
@@ -28,8 +26,8 @@ class BufferParams;
 class BufferView;
 class CursorSlice;
 class Dimension;
-class Color_color;
 class ParagraphList;
+class InsetTabular;
 
 
 /**
@@ -43,6 +41,9 @@ public:
        ///
        InsetText();
 
+       ///
+       Dimension const dimension(BufferView const &) const;
+
        /// empty inset to empty par
        void clear();
        ///
@@ -50,13 +51,9 @@ public:
        ///
        void write(Buffer const & buf, std::ostream & os) const;
        ///
-       bool metrics(MetricsInfo & mi, Dimension & dim) const;
+       void metrics(MetricsInfo & mi, Dimension & dim) const;
        ///
        void draw(PainterInfo & pi, int x, int y) const;
-       /// draw inset selection
-       void drawSelection(PainterInfo & pi, int x, int y) const;
-       /// are we inside the area covered by the inset?
-       virtual bool covers(BufferView const & bv, int x, int y) const;
        ///
        virtual docstring const editMessage() const;
        ///
@@ -64,9 +61,9 @@ public:
        ///
        bool canTrackChanges() const { return true; }
        ///
-       InsetText * asTextInset() { return this; }
+       InsetText * asInsetText() { return this; }
        ///
-       InsetText const * asTextInset() const { return this; }
+       InsetText const * asInsetText() const { return this; }
        ///
        int latex(Buffer const &, odocstream &, OutputParams const &) const;
        ///
@@ -75,15 +72,12 @@ public:
        int docbook(Buffer const &, odocstream &, OutputParams const &) const;
        ///
        void validate(LaTeXFeatures & features) const;
-       //FIXME The following should be removed when wide is.
-       /// Overridden to force an update if the inset was wide().
-       virtual bool notifyCursorLeaves(Cursor & cur);
 
        /// return x,y of given position relative to the inset's baseline
        void cursorPos(BufferView const & bv, CursorSlice const & sl,
                bool boundary, int & x, int & y) const;
        ///
-       Code lyxCode() const { return TEXT_CODE; }
+       InsetCode lyxCode() const { return TEXT_CODE; }
        ///
        void setText(docstring const &, Font const &, bool trackChanges);
        ///
@@ -93,9 +87,9 @@ public:
        ///
        void setDrawFrame(bool);
        ///
-       Color_color frameColor() const;
+       ColorCode frameColor() const;
        ///
-       void setFrameColor(Color_color);
+       void setFrameColor(ColorCode);
        ///
        bool showInsetDialog(BufferView *) const;
        ///
@@ -130,48 +124,41 @@ public:
        ///
        ParagraphList const & paragraphs() const;
        ///
-       bool insetAllowed(Code) const { return true; }
+       bool insetAllowed(InsetCode) const { return true; }
        ///
        bool allowSpellCheck() const { return true; }
        /// should paragraph indendation be ommitted in any case?
        bool neverIndent(Buffer const &) const;
        ///
-       InsetText(InsetText const &);
+       virtual bool isMacroScope(Buffer const & buf) const { return true; }
        ///
-       virtual bool wide() const { return wide_inset_; }
+       virtual bool allowMultiPar() const { return true; }
        ///
-       void setWide(bool wide_inset) { wide_inset_ = wide_inset; }
+       InsetText(InsetText const &);
+
        // Update the counters of this inset and of its contents
        virtual void updateLabels(Buffer const &, ParIterator const &);
+       ///
+       virtual Inset * clone() const;
 
 protected:
        ///
        virtual void doDispatch(Cursor & cur, FuncRequest & cmd);
 
 private:
-       ///
-       virtual std::auto_ptr<Inset> doClone() const;
        ///
        void init();
 
        ///
        bool drawFrame_;
-       /** We store the Color::color value as an int to get Color.h out
-        *  of the header file.
-        */
-       int frame_color_;
        ///
-       mutable pit_type old_pit;
+       ColorCode frame_color_;
        ///
-       bool wide_inset_;
+       mutable pit_type old_pit;
 
 public:
        ///
        mutable Text text_;
-       ///
-       mutable Font font_;
-       ///
-       static int border_;
 };
 
 } // namespace lyx