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 "support/types.h"
23 * The cursor class describes the position of a cursor within a document.
24 * Several cursors exist within LyX; for example, when locking an inset,
25 * the position of the cursor in the containing inset is stored.
32 /// set the paragraph that contains this cursor
33 void par(lyx::paroffset_type pit);
34 /// return the paragraph this cursor is in
35 lyx::paroffset_type par() const;
36 /// set the position within the paragraph
37 void pos(lyx::pos_type p);
38 /// return the position within the paragraph
39 lyx::pos_type pos() const;
41 void boundary(bool b);
43 bool boundary() const;
44 /// set the x position in pixels
46 /// return the x position in pixels
48 /// set the y position in pixels
50 /// return the y position in pixels
54 /// The paragraph the cursor is in.
55 lyx::paroffset_type par_;
56 /// The position inside the paragraph
59 * When the cursor position is i, is the cursor is after the i-th char
60 * or before the i+1-th char ? Normally, these two interpretations are
61 * equivalent, except when the fonts of the i-th and i+1-th char
63 * We use boundary_ to distinguish between the two options:
64 * If boundary_=true, then the cursor is after the i-th char
65 * and if boundary_=false, then the cursor is before the i+1-th char.
67 * We currently use the boundary only when the language direction of
68 * the i-th char is different than the one of the i+1-th char.
69 * In this case it is important to distinguish between the two
70 * cursor interpretations, in order to give a reasonable behavior to
74 /// the pixel x position
76 /// the pixel y position
81 bool operator==(LyXCursor const & a, LyXCursor const & b);
83 bool operator!=(LyXCursor const & a, LyXCursor const & b);