Another minor change, but this should almost get us to the point that we
[lyx.git] / src / Bidi.h
blobdfa779ae4947d13a4d4f24c6de9a1c0f99e15b05
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.
7 * \author Dekel Tsur
9 * Full author contact details are available in file CREDITS.
12 #ifndef BIDI_H
13 #define BIDI_H
15 #include "support/types.h"
17 #include <vector>
20 namespace lyx {
22 class Buffer;
23 class Cursor;
24 class Paragraph;
25 class Row;
26 class Font;
29 /// bidi stuff
30 class Bidi {
31 public:
32 ///
33 bool isBoundary(Buffer const &, Paragraph const & par,
34 pos_type pos) const;
35 ///
36 bool isBoundary(Buffer const &, Paragraph const & par,
37 pos_type pos, Font const & font) const;
38 ///
39 pos_type log2vis(pos_type pos) const;
40 /** Maps positions in the logical string to positions
41 * in visual string.
43 pos_type vis2log(pos_type pos) const;
44 ///
45 pos_type level(pos_type pos) const;
46 ///
47 bool inRange(pos_type pos) const;
48 /// same_direction?
49 bool same_direction() const;
50 ///
51 void computeTables(Paragraph const & par,
52 Buffer const &, Row const & row);
53 private:
54 ///
55 bool same_direction_;
56 ///
57 std::vector<pos_type> log2vis_list_;
58 /** Maps positions in the visual string to positions
59 * in logical string.
61 std::vector<pos_type> vis2log_list_;
62 ///
63 std::vector<pos_type> levels_;
64 ///
65 pos_type start_;
66 ///
67 pos_type end_;
70 /// Should interpretation of the arrow keys be reversed?
71 bool reverseDirectionNeeded(Cursor const & cur);
73 /// Is current paragraph in RTL mode?
74 bool isWithinRtlParagraph(Cursor const & cur);
76 } // namespace lyx
78 #endif // BIDI_H