- ///
- enum UpdateCodes {
- ///
- NONE = 0,
- ///
- INIT,
- ///
- FULL,
- ///
- CURSOR_PAR,
- ///
- CURSOR,
- ///
- SELECTION,
- ///
- DRAW_FRAME,
- ///
- CLEAR_FRAME
- };
- ///
- enum DrawFrame {
- ///
- NEVER = 0,
- ///
- LOCKED,
- ///
- ALWAYS
- };
- ///
- InsetText();
- ///
- explicit
- InsetText(InsetText const &);
- ///
- ~InsetText();
- ///
- Inset * Clone(Buffer const &) const;
- ///
- InsetText & operator=(InsetText const & it);
- ///
- void clear();
- ///
- void Read(Buffer const *, LyXLex &);
- ///
- 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;
- ///
- int textWidth(Painter &) const;
- ///
- void draw(BufferView *, LyXFont const &, int , float &, bool) const;
- ///
- void update(BufferView *, LyXFont const &, bool =false);
- ///
- string const EditMessage() const;
- ///
- void Edit(BufferView *, int, int, unsigned int);
- ///
- bool IsTextInset() const { return true; }
- ///
- bool doClearArea() const { return !locked; }
- ///
- void InsetUnlock(BufferView *);
- ///
- bool LockInsetInInset(BufferView *, UpdatableInset *);
- ///
- bool UnlockInsetInInset(BufferView *, UpdatableInset *, bool lr = false);
- ///
- bool UpdateInsetInInset(BufferView *, Inset *);
- ///
- void InsetButtonRelease(BufferView *, int, int, int);
- ///
- void InsetButtonPress(BufferView *, int, int, int);
- ///
- void InsetMotionNotify(BufferView *, int, int, int);
- ///
- void InsetKeyPress(XKeyEvent *);
- ///
- UpdatableInset::RESULT LocalDispatch(BufferView *, int, string const &);
- ///
- int Latex(Buffer const *, std::ostream &,
- bool fragile, bool free_spc) const;
- ///
- int Ascii(Buffer const *, std::ostream &, int linelen) const;
- ///
- int Linuxdoc(Buffer const *, std::ostream &) const { return 0; }
- ///
- int DocBook(Buffer const *, std::ostream &) const { return 0; }
- ///
- void Validate(LaTeXFeatures & features) const;
- ///
- Inset::Code LyxCode() const { return Inset::TEXT_CODE; }
- ///
- void GetCursorPos(BufferView *, int & x, int & y) const;
- ///
- unsigned int InsetInInsetY();
- ///
- void ToggleInsetCursor(BufferView *);
- ///
- bool InsertInset(BufferView *, Inset *);
- ///
- UpdatableInset * GetLockingInset();
- ///
- UpdatableInset * GetFirstLockingInsetOfType(Inset::Code);
- ///
- void SetFont(BufferView *, LyXFont const &, bool toggleall = false);
- ///
- int getMaxWidth(Painter &, UpdatableInset const *) const;
- ///
- void init(InsetText const * ins = 0);
- ///
- void WriteParagraphData(Buffer const *, std::ostream &) const;
- ///
- void SetParagraphData(LyXParagraph *);
- ///
- void SetAutoBreakRows(bool);
- ///
- void SetDrawFrame(BufferView *, DrawFrame);
- ///
- void SetFrameColor(BufferView *, LColor::color);
- ///
- LyXText * getLyXText(BufferView *) const;
- ///
- void deleteLyXText(BufferView *, bool recursive=true) const;
- ///
- void resizeLyXText(BufferView *) const;
- ///
- LyXParagraph * par;
- ///
- mutable UpdateCodes need_update;
+ ///
+ /// numbers need because of test if codeA < codeB
+ ///
+ enum UpdateCodes {
+ ///
+ NONE = 0,
+ ///
+ CURSOR = 1,
+ ///
+ CLEAR_FRAME = 2,
+ ///
+ DRAW_FRAME = 4,
+ ///
+ SELECTION = 8,
+ ///
+ CURSOR_PAR = 16,
+ ///
+ FULL = 32,
+ ///
+ INIT = 64
+ };
+ ///
+ enum DrawFrame {
+ ///
+ NEVER = 0,
+ ///
+ LOCKED,
+ ///
+ ALWAYS
+ };
+ ///
+ InsetText();
+ ///
+ explicit
+ InsetText(InsetText const &, bool same_id = false);
+ ///
+ ~InsetText();
+ ///
+ Inset * clone(Buffer const &, bool same_id = false) const;
+ ///
+ InsetText & operator=(InsetText const & it);
+ ///
+ void clear();
+ ///
+ void read(Buffer const *, LyXLex &);
+ ///
+ 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;
+ ///
+ int textWidth(BufferView *, bool fordraw = false) const;
+ ///
+ void draw(BufferView *, LyXFont const &, int , float &, bool) const;
+ ///
+ void update(BufferView *, LyXFont const &, bool = false);
+ ///
+ void setUpdateStatus(BufferView *, int what) const;
+ ///
+ string const editMessage() const;
+ ///
+ void edit(BufferView *, int, int, unsigned int);
+ ///
+ void edit(BufferView *, bool front = true);
+ ///
+ bool isTextInset() const { return true; }
+ ///
+ bool doClearArea() const;
+ ///
+ void insetUnlock(BufferView *);
+ ///
+ bool lockInsetInInset(BufferView *, UpdatableInset *);
+ ///
+ bool unlockInsetInInset(BufferView *,
+ UpdatableInset *, bool lr = false);
+ ///
+ bool updateInsetInInset(BufferView *, Inset *);
+ ///
+ bool insetButtonRelease(BufferView *, int, int, int);
+ ///
+ void insetButtonPress(BufferView *, int, int, int);
+ ///
+ void insetMotionNotify(BufferView *, int, int, int);
+ ///
+ void insetKeyPress(XKeyEvent *);
+ ///
+ UpdatableInset::RESULT localDispatch(BufferView *,
+ kb_action, string const &);
+ ///
+ int latex(Buffer const *, std::ostream &,
+ bool fragile, bool free_spc) const;
+ ///
+ int ascii(Buffer const *, std::ostream &, int linelen) const;
+ ///
+ int linuxdoc(Buffer const *, std::ostream &) const { return 0; }
+ ///
+ int docbook(Buffer const *, std::ostream &) const ;
+ ///
+ void validate(LaTeXFeatures & features) const;
+ ///
+ Inset::Code lyxCode() const { return Inset::TEXT_CODE; }
+ ///
+ void getCursorPos(BufferView *, int & x, int & y) const;
+ ///
+ unsigned int insetInInsetY();
+ ///
+ void toggleInsetCursor(BufferView *);
+ ///
+ void showInsetCursor(BufferView *, bool show = true);
+ ///
+ void hideInsetCursor(BufferView *);
+ ///
+ void fitInsetCursor(BufferView *) const;
+ ///
+ bool insertInset(BufferView *, Inset *);
+ ///
+ bool insetAllowed(Inset::Code) const;
+ ///
+ UpdatableInset * getLockingInset() const;
+ ///
+ UpdatableInset * getFirstLockingInsetOfType(Inset::Code);
+ ///
+ void setFont(BufferView *, LyXFont const &,
+ bool toggleall = false,
+ bool selectall = false);
+ ///
+ int getMaxWidth(BufferView *, UpdatableInset const *) const;
+ ///
+ void init(InsetText const * ins = 0, bool same_id = false);
+ ///
+ void writeParagraphData(Buffer const *, std::ostream &) const;
+ ///
+ void setParagraphData(Paragraph *, bool same_id = false);
+ ///
+ void setText(string const &);
+ ///
+ void setAutoBreakRows(bool);
+ ///
+ bool getAutoBreakRows() const { return autoBreakRows; }
+ ///
+ void setDrawFrame(BufferView *, DrawFrame);
+ ///
+ void setFrameColor(BufferView *, LColor::color);
+ ///
+ LyXText * getLyXText(BufferView const *,
+ bool const recursive = false) const;
+ ///
+ void deleteLyXText(BufferView *, bool recursive = true) const;
+ ///
+ void resizeLyXText(BufferView *, bool force = false) const;
+ ///
+ bool showInsetDialog(BufferView *) const;
+ ///
+ std::vector<string> const getLabelList() const;
+ ///
+ bool nodraw() const;
+ ///
+ int scroll(bool recursive = true) const;
+ ///
+ void scroll(BufferView * bv, float sx) const {
+ UpdatableInset::scroll(bv, sx);
+ }
+ ///
+ void scroll(BufferView * bv, int offset) const {
+ UpdatableInset::scroll(bv, offset);
+ }
+ ///
+ void selectAll(BufferView * bv);
+ ///
+ void clearSelection(BufferView * bv);
+ ///
+ Paragraph * getParFromID(int id) const;
+ ///
+ Inset * getInsetFromID(int id) const;
+ ///
+ Paragraph * firstParagraph() const;
+ ///
+ Paragraph * getFirstParagraph(int) const;
+ ///
+ LyXCursor const & cursor(BufferView *) const;
+ ///
+ Paragraph * paragraph() const;
+ ///
+ void paragraph(Paragraph *);
+ ///
+ bool allowSpellcheck() { return true; }
+ ///
+ string const selectNextWordToSpellcheck(BufferView *,
+ float & value) const;
+ void selectSelectedWord(BufferView *);
+ ///
+ void toggleSelection(BufferView *, bool kill_selection);
+ ///
+ bool searchForward(BufferView *, string const &,
+ bool = true, bool = false);
+ ///
+ bool searchBackward(BufferView *, string const &,
+ bool = true, bool = false);
+ ///
+ bool checkInsertChar(LyXFont &);
+ ///
+ //
+ // Public structures and variables
+ ///
+ mutable int need_update;