#include "layout.h"
#include "lyxrow.h"
#include "vspace.h"
+#include "LColor.h"
class Buffer;
class BufferParams;
};
///
enum word_location {
- /// the word around the cursor
+ // the word around the cursor, only if the cursor is
+ //not at a boundary
+ WHOLE_WORD_STRICT,
+ // the word around the cursor
WHOLE_WORD,
/// the word begining from the cursor position
PARTIAL_WORD,
+ /// the word around the cursor or before the cursor
+ PREVIOUS_WORD,
/// the next word (not yet used)
NEXT_WORD
};
/// Destructor
~LyXText();
- void init(BufferView *);
+ void init(BufferView *, bool reinit = false);
///
mutable int number_of_rows;
///
LyXFont const getFont(Buffer const *, Paragraph * par,
Paragraph::size_type pos) const;
///
+ LyXFont const getLayoutFont(Buffer const *, Paragraph * par) const;
+ ///
+ LyXFont const getLabelFont(Buffer const *, Paragraph * par) const;
+ ///
void setCharFont(Buffer const *, Paragraph * par,
Paragraph::size_type pos, LyXFont const & font);
void setCharFont(BufferView *, Paragraph * par,
///
void toggleFree(BufferView *, LyXFont const &, bool toggleall = false);
+
+ ///
+ string getStringToIndex(BufferView *);
/** recalculates the heights of all previous rows of the
specified paragraph. needed, if the last characters font
/** Completes the insertion with a full rebreak.
Returns true if something was broken. */
- bool fullRebreak(BufferView *);
+ bool fullRebreak(BufferView *);
///
- Row * need_break_row;
+ mutable Row * need_break_row;
///
mutable int refresh_y;
///
/// give and set the LyXText status
text_status status() const;
+ ///
void status(BufferView *, text_status) const;
private:
/// need the selection cursor:
void setSelection(BufferView *);
///
- void clearSelection(BufferView *) const;
+ void clearSelection() const;
///
string const selectionAsString(Buffer const *) const;
/// select the word we need depending on word_location
- void getWord(LyXCursor & from, LyXCursor & to, word_location) const;
+ void getWord(LyXCursor & from, LyXCursor & to,
+ word_location const) const;
/// just selects the word the cursor is in
- void selectWord(BufferView *);
+ void selectWord(BufferView *, word_location const);
+ /// returns the inset at cursor (if it exists), 0 otherwise
+ Inset * getInset() const;
/** 'selects" the next word, where the cursor is not in
and returns this word as string. THe cursor will be moved
///
void deleteLineForward(BufferView *);
///
- bool selectWordWhenUnderCursor(BufferView *);
+ bool selectWordWhenUnderCursor(BufferView *,
+ word_location const);
///
enum TextCase {
///
void getVisibleRow(BufferView *, int y_offset, int x_offset,
Row * row_ptr, int y, bool cleared=false);
+ ///
+ void toggleInset(BufferView *);
///
- void cutSelection(BufferView *, bool = true);
+ void cutSelection(BufferView *, bool doclear = true, bool realcut = true);
///
void copySelection(BufferView *);
///
void copyEnvironmentType();
///
void pasteEnvironmentType(BufferView *);
- ///
- void insertFootnote();
- ///
- void insertMarginpar();
- ///
- void insertFigure();
- ///
- void insertTabular();
/** the DTP switches for paragraphs. LyX will store the top settings
always in the first physical paragraph, the bottom settings in the
///
int numberOfCell(Paragraph * par,
Paragraph::size_type pos) const;
- ///
- Paragraph * getParFromID(int id) const;
-
///
void removeTableRow(LyXCursor & cursor) const;
///
*/
bool hfillExpansion(Buffer const *, Row const * row_ptr,
Paragraph::size_type pos) const;
+ ///
+ LColor::color backgroundColor();
///