4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
7 * \author Lars Gullik Bjønnes
8 * \author Matthias Ettrich
10 * \author André Pönitz
12 * \author Jürgen Vigna
14 * Full author contact details are available in file CREDITS.
20 #include "ParagraphList_fwd.h"
21 #include "support/types.h"
24 * The cursor class describes the position of a cursor within a document.
25 * Several cursors exist within LyX; for example, when locking an inset,
26 * the position of the cursor in the containing inset is stored.
33 /// set the paragraph that contains this cursor
34 void par(ParagraphList::iterator pit);
35 /// return the paragraph this cursor is in
36 ParagraphList::iterator par() const;
37 /// set the position within the paragraph
38 void pos(lyx::pos_type p);
39 /// return the position within the paragraph
40 lyx::pos_type pos() const;
42 void boundary(bool b);
44 bool boundary() const;
45 /// set the x position in pixels
47 /// return the x position in pixels
49 /// set the cached x position
52 * Return the cached x position of the cursor. This is used for when
55 * blah blah blah blah| blah blah blah
57 * blah blah blah blah blah blah
59 * When we move onto row 3, we would like to be vertically aligned
60 * with where we were in row 1, despite the fact that row 2 is
64 /// set the y position in pixels
66 /// return the y position in pixels
70 /// The paragraph the cursor is in.
71 ParagraphList::iterator par_;
72 /// The position inside the paragraph
75 * When the cursor position is i, is the cursor is after the i-th char
76 * or before the i+1-th char ? Normally, these two interpretations are
77 * equivalent, except when the fonts of the i-th and i+1-th char
79 * We use boundary_ to distinguish between the two options:
80 * If boundary_=true, then the cursor is after the i-th char
81 * and if boundary_=false, then the cursor is before the i+1-th char.
83 * We currently use the boundary only when the language direction of
84 * the i-th char is different than the one of the i+1-th char.
85 * In this case it is important to distinguish between the two
86 * cursor interpretations, in order to give a reasonable behavior to
90 /// the pixel x position
92 /// the cached x position
94 /// the pixel y position
99 bool operator==(LyXCursor const & a, LyXCursor const & b);
101 bool operator!=(LyXCursor const & a, LyXCursor const & b);
103 #endif // LYXCURSOR_H