]> git.lyx.org Git - lyx.git/blob - src/Bidi.h
remove obsolete references to saveSelection
[lyx.git] / src / Bidi.h
1 // -*- C++ -*-
2 /**
3  * \file Bidi.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Dekel Tsur
8  *
9  * Full author contact details are available in file CREDITS.
10  */
11
12 #ifndef BIDI_H
13 #define BIDI_H
14
15 #include "support/types.h"
16 #include "Cursor.h"
17 #include <vector>
18
19
20 namespace lyx {
21
22 class Buffer;
23 class Paragraph;
24 class Row;
25 class Font;
26
27
28 /// bidi stuff
29 class Bidi {
30 public:
31         ///
32         bool isBoundary(Buffer const &, Paragraph const & par,
33                         pos_type pos) const;
34         ///
35         bool isBoundary(Buffer const &, Paragraph const & par,
36                                 pos_type pos, Font const & font) const;
37         ///
38         pos_type log2vis(pos_type pos) const;
39         /** Maps positions in the logical string to positions
40          *  in visual string.
41          */
42         pos_type vis2log(pos_type pos) const;
43         ///
44         pos_type level(pos_type pos) const;
45         ///
46         bool inRange(pos_type pos) const;
47         /// same_direction?
48         bool same_direction() const;
49         ///
50         void computeTables(Paragraph const & par,
51                            Buffer const &, Row const & row);
52 private:
53         ///
54         bool same_direction_;
55         ///
56         std::vector<pos_type> log2vis_list_;
57         /** Maps positions in the visual string to positions
58          *  in logical string.
59          */
60         std::vector<pos_type> vis2log_list_;
61         ///
62         std::vector<pos_type> levels_;
63         ///
64         pos_type start_;
65         ///
66         pos_type end_;
67 };
68
69 /// Should interpretation of the arrow keys be reversed?
70 bool reverseDirectionNeeded(Cursor const & cur);
71
72 /// Is current paragraph in RTL mode?
73 bool isWithinRtlParagraph(Cursor const & cur);
74
75 } // namespace lyx
76
77 #endif // BIDI_H