]> git.lyx.org Git - lyx.git/blob - src/lyxcursor.h
More fixes to insettabular/text (and some missing features added).
[lyx.git] / src / lyxcursor.h
1 // -*- C++ -*-
2 /* This file is part of
3  * ====================================================== 
4  * 
5  *           LyX, The Document Processor
6  *       
7  *           Copyright 1995 Matthias Ettrich
8  *           Copyright 1995-2000 The LyX Team.
9  *
10  * ====================================================== */
11
12 #ifndef LYXCURSOR_H
13 #define LYXCURSOR_H
14
15 #ifdef __GNUG__
16 #pragma interface
17 #endif
18
19 #include "lyxparagraph.h"
20
21 struct Row;
22
23 /** All these variables should be explained. Matthias?
24  */
25 class LyXCursor {
26 public:
27         ///
28         void par(LyXParagraph * p);
29         ///
30         LyXParagraph * par();
31         ///
32         LyXParagraph * par() const;
33         ///
34         void pos(LyXParagraph::size_type p);
35         ///
36         LyXParagraph::size_type pos() const;
37         ///
38         void boundary(bool b);
39         ///
40         bool boundary() const;
41         ///
42         void x(int i);
43         ///
44         int x() const;
45         ///
46         void x_fix(int i);
47         ///
48         int x_fix() const;
49         ///
50         void y(int i);
51         ///
52         int y() const;
53         ///
54         void row(Row * r);
55         ///
56         Row * row();
57         ///
58         Row * row() const;
59 private:
60         /// The paragraph the cursor is in.
61         LyXParagraph * par_;
62         /// The position inside the paragraph
63         LyXParagraph::size_type pos_;
64         ///
65         bool boundary_;
66         ///
67         int x_;
68         ///
69         int x_fix_;
70         ///
71         int y_;
72         ///
73         Row * row_;
74 };
75
76 ///
77 inline
78 bool operator==(LyXCursor const & a, LyXCursor const & b)
79 {
80         return (a.par() == b.par())
81                 && (a.pos() == b.pos())
82                 && a.boundary() == b.boundary();
83 }
84
85 ///
86 inline
87 bool operator!=(LyXCursor const & a, LyXCursor const & b)
88 {
89         return !(a == b);
90 }
91
92 #endif