]> git.lyx.org Git - lyx.git/blob - src/lyxcursor.h
encoding + etc patch from dekel
[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 #include "lyxparagraph.h"
16
17 struct Row;
18
19 /** All these variables should be explained. Matthias?
20  */
21 class LyXCursor {
22 public:
23         ///
24         void par(LyXParagraph * p);
25         ///
26         LyXParagraph * par();
27         ///
28         LyXParagraph * par() const;
29         ///
30         void pos(LyXParagraph::size_type p);
31         ///
32         LyXParagraph::size_type pos() const;
33         ///
34         void boundary(bool b);
35         ///
36         bool boundary() const;
37         ///
38         void x(int i);
39         ///
40         int x() const;
41         ///
42         void x_fix(int i);
43         ///
44         int x_fix() const;
45         ///
46         void y(unsigned long i);
47         ///
48         unsigned long y() const;
49         ///
50         void row(Row * r);
51         ///
52         Row * row();
53         ///
54         Row * row() const;
55 private:
56         /// The paragraph the cursor is in.
57         LyXParagraph * par_;
58         /// The position inside the paragraph
59         LyXParagraph::size_type pos_;
60         ///
61         bool boundary_;
62         ///
63         int x_;
64         ///
65         int x_fix_;
66         ///
67         unsigned long y_;
68         ///
69         Row * row_;
70 };
71
72
73 inline
74 bool operator==(LyXCursor const & a, LyXCursor const & b)
75 {
76         return (a.par() == b.par())
77                 && (a.pos() == b.pos())
78                 && a.boundary() == b.boundary();
79 }
80
81
82 inline
83 bool operator!=(LyXCursor const & a, LyXCursor const & b)
84 {
85         return !(a == b);
86 }
87
88 #endif