]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insettext.h
ws changes only
[lyx.git] / src / insets / insettext.h
index fa6477ec6dc154e124fd2518bc068660ebcec6dc..614e8f996e3754e1ddd53089804f5258c1c9e2c2 100644 (file)
 #define INSETTEXT_H
 
 #include "updatableinset.h"
-#include "LString.h"
-#include "LColor.h"
-#include "ParagraphList.h"
-#include "RowList.h"
-#include "dimension.h"
+#include "ParagraphList_fwd.h"
+#include "RowList_fwd.h"
 #include "lyxtext.h"
 
 #include "support/types.h"
 
 #include "frontends/mouse_state.h"
 
-#include <boost/shared_ptr.hpp>
 
-class Painter;
-class BufferView;
 class Buffer;
 class BufferParams;
+class BufferView;
+class Dimension;
+class LColor_color;
 class LyXCursor;
-class LyXText;
-class Row;
+class Painter;
 class Paragraph;
+class Row;
 
 /**
  A text inset is like a TeX box to write full text
@@ -52,13 +49,13 @@ public:
                ALWAYS
        };
        ///
-       InsetText(BufferParams const &);
+       explicit InsetText(BufferParams const &);
        ///
-       explicit InsetText(InsetText const &);
+       InsetText(InsetText const &);
        ///
        virtual std::auto_ptr<InsetBase> clone() const;
        ///
-       InsetText & operator=(InsetText const & it);
+       void operator=(InsetText const & it);
        /// empty inset to empty par, or just mark as erased
        void clear(bool just_mark_erased);
        ///
@@ -72,7 +69,7 @@ public:
        ///
        void draw(PainterInfo & pi, int x, int y) const;
        ///
-       string const editMessage() const;
+       std::string const editMessage() const;
        ///
        bool isTextInset() const { return true; }
        ///
@@ -83,7 +80,7 @@ public:
        bool unlockInsetInInset(BufferView *,
                                UpdatableInset *, bool lr = false);
        ///
-       RESULT localDispatch(FuncRequest const &);
+       dispatch_result localDispatch(FuncRequest const &);
        ///
        int latex(Buffer const &, std::ostream &,
                  LatexRunParams const &) const;
@@ -118,19 +115,18 @@ public:
                     bool toggleall = false,
                     bool selectall = false);
        ///
-       void init(InsetText const * ins);
-       ///
        void writeParagraphData(Buffer const &, std::ostream &) const;
        ///
-       void setText(string const &, LyXFont const &);
+       void setText(std::string const &, LyXFont const &);
        ///
        void setAutoBreakRows(bool);
        ///
-       bool getAutoBreakRows() const { return autoBreakRows; }
+       bool getAutoBreakRows() const { return autoBreakRows_; }
        ///
        void setDrawFrame(DrawFrame);
        ///
-       void setFrameColor(LColor::color);
+       LColor_color frameColor() const;
+       void setFrameColor(LColor_color);
        ///
        LyXText * getLyXText(BufferView const *,
                             bool const recursive = false) const;
@@ -140,8 +136,8 @@ public:
        void deleteLyXText(BufferView *, bool recursive = true) const;
        ///
        bool showInsetDialog(BufferView *) const;
-       ///
-       void getLabelList(std::vector<string> &) const;
+       /// Appends \c list with all labels found within this inset.
+       void getLabelList(Buffer const &, std::vector<std::string> & list) const;
        ///
        int scroll(bool recursive = true) const;
        ///
@@ -182,10 +178,10 @@ public:
        bool nextChange(BufferView *, lyx::pos_type & length);
 
        ///
-       bool searchForward(BufferView *, string const &,
+       bool searchForward(BufferView *, std::string const &,
                           bool = true, bool = false);
        ///
-       bool searchBackward(BufferView *, string const &,
+       bool searchBackward(BufferView *, std::string const &,
                            bool = true, bool = false);
        ///
        bool checkInsertChar(LyXFont &);
@@ -210,18 +206,10 @@ protected:
        void lockInset(BufferView *);
        /// lock an inset inside this one
        void lockInset(BufferView *, UpdatableInset *);
-       ///
-       mutable int drawTextXOffset;
-       ///
-       mutable int drawTextYOffset;
-       ///
-       bool autoBreakRows;
-       ///
-       DrawFrame drawFrame_;
-       ///
-       LColor::color frame_color;
 
 private:
+       ///
+       void init();
        ///
        void lfunMousePress(FuncRequest const &);
        ///
@@ -230,22 +218,22 @@ private:
        void lfunMouseMotion(FuncRequest const &);
 
        ///
-       RESULT moveRight(BufferView *);
+       dispatch_result moveRight(BufferView *);
        ///
-       RESULT moveLeft(BufferView *);
+       dispatch_result moveLeft(BufferView *);
        ///
-       RESULT moveRightIntern(BufferView *, bool front,
+       dispatch_result moveRightIntern(BufferView *, bool front,
                                               bool activate_inset = true,
                                               bool selecting = false);
        ///
-       RESULT moveLeftIntern(BufferView *, bool front,
+       dispatch_result moveLeftIntern(BufferView *, bool front,
                                              bool activate_inset = true,
                                              bool selecting = false);
 
        ///
-       RESULT moveUp(BufferView *);
+       dispatch_result moveUp(BufferView *);
        ///
-       RESULT moveDown(BufferView *);
+        dispatch_result moveDown(BufferView *);
        ///
        void setCharFont(Buffer const &, int pos, LyXFont const & font);
        ///
@@ -276,11 +264,19 @@ private:
 
        /* Private structures and variables */
        ///
+       bool autoBreakRows_;
+       ///
+       DrawFrame drawFrame_;
+       /** We store the LColor::color value as an int to get LColor.h out
+        *  of the header file.
+        */
+       int frame_color_;
+       ///
        mutable bool locked;
        ///
        mutable int top_y;
        ///
-       ParagraphList::iterator inset_par;
+       lyx::paroffset_type inset_par;
        ///
        lyx::pos_type inset_pos;
        ///
@@ -294,7 +290,7 @@ private:
        ///
        UpdatableInset * the_locking_inset;
        ///
-       mutable ParagraphList::iterator old_par;
+       mutable lyx::paroffset_type old_par;
 
        ///
        // to remember old painted frame dimensions to clear it on the right spot!