#ifndef INSETTEXT_H
#define INSETTEXT_H
-#include "updatableinset.h"
+#include "inset.h"
#include "RowList_fwd.h"
#include "lyxfont.h"
#include "lyxtext.h"
class Buffer;
class BufferParams;
class BufferView;
+class CursorSlice;
class Dimension;
class LColor_color;
-class CursorSlice;
-class Painter;
class ParagraphList;
-class Row;
/**
A text inset is like a TeX box to write full text
(including styles and other insets) in a given space.
*/
-class InsetText : public UpdatableInset {
+class InsetText : public InsetOld {
public:
///
explicit InsetText(BufferParams const &);
///
InsetText();
- /// empty inset to empty par, or just mark as erased
- void clear(bool just_mark_erased);
+ /// empty inset to empty par
+ void clear();
///
void read(Buffer const & buf, LyXLex & lex);
///
///
std::string const editMessage() const;
///
+ EDITABLE editable() const { return HIGHLY_EDITABLE; }
+ ///
bool isTextInset() const { return true; }
///
int latex(Buffer const &, std::ostream &,
OutputParams const &) const;
///
void validate(LaTeXFeatures & features) const;
+
+ /// return x,y of given position relative to the inset's baseline
+ void cursorPos(CursorSlice const & sl, bool boundary, int & x, int & y) const;
///
Code lyxCode() const { return TEXT_CODE; }
- /// FIXME, document
- void getCursorPos(LCursor const & cur, int & x, int & y) const;
///
void setFont(BufferView *, LyXFont const &,
bool toggleall = false,
///
void setAutoBreakRows(bool);
///
- bool getAutoBreakRows() const { return autoBreakRows_; }
+ bool getAutoBreakRows() const { return text_.autoBreakRows_; }
///
void setDrawFrame(bool);
///
/// Appends \c list with all labels found within this inset.
void getLabelList(Buffer const &, std::vector<std::string> & list) const;
///
- LyXText * getText(int) const;
+ LyXText * getText(int i) const {
+ return (i == 0) ? const_cast<LyXText*>(&text_) : 0;
+ }
///
bool getStatus(LCursor & cur, FuncRequest const & cmd, FuncStatus &) const;
/// mark as erased for change tracking
- void markErased() { clear(true); }
+ void markErased(bool erased);
+
/**
* Mark as new. Used when pasting in tabular, and adding rows
* or columns. Note that pasting will ensure that tracking already
///
void edit(LCursor & cur, bool left);
///
- InsetBase * editXY(LCursor & cur, int x, int y) const;
+ InsetBase * editXY(LCursor & cur, int x, int y);
/// number of cells in this inset
size_t nargs() const { return 1; }
bool insetAllowed(Code) const { return true; }
///
bool allowSpellCheck() const { return true; }
+ /// should paragraph indendation be ommitted in any case?
+ bool neverIndent() const;
+ ///
+ InsetText(InsetText const &);
protected:
- InsetText(InsetText const &);
///
virtual void doDispatch(LCursor & cur, FuncRequest & cmd);
-private:
- virtual std::auto_ptr<InsetBase> doClone() const;
+private:
///
- void updateLocal(LCursor &);
+ virtual std::auto_ptr<InsetBase> doClone() const;
///
void init();
- ///
- void setCharFont(Buffer const &, int pos, LyXFont const & font);
- ///
- void removeNewlines();
- ///
- void drawFrame(Painter &, int x, int y) const;
- ///
- void clearInset(Painter &, int x, int y) const;
- ///
- bool autoBreakRows_;
///
bool drawFrame_;
/** We store the LColor::color value as an int to get LColor.h out
*/
int frame_color_;
///
- mutable lyx::pit_type old_par;
+ mutable lyx::pit_type old_pit;
+ ///
+ static int border_;
public:
///
mutable LyXText text_;