]> git.lyx.org Git - lyx.git/blob - src/Bidi.h
Rename .C ==> .cpp for files in src/support, part two
[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 <vector>
17
18
19 namespace lyx {
20
21 class Buffer;
22 class Paragraph;
23 class Row;
24 class LyXFont;
25
26
27 /// bidi stuff
28 class Bidi {
29 public:
30         ///
31         bool isBoundary(Buffer const &, Paragraph const & par,
32                         pos_type pos) const;
33         ///
34         bool isBoundary(Buffer const &, Paragraph const & par,
35                                 pos_type pos, LyXFont const & font) const;
36         ///
37         pos_type log2vis(pos_type pos) const;
38         /** Maps positions in the logical string to positions
39          *  in visual string.
40          */
41         pos_type vis2log(pos_type pos) const;
42         ///
43         pos_type level(pos_type pos) const;
44         ///
45         bool inRange(pos_type pos) const;
46         /// same_direction?
47         bool same_direction() const;
48         ///
49         void computeTables(Paragraph const & par,
50                            Buffer const &, Row const & row);
51 private:
52         ///
53         bool same_direction_;
54         ///
55         std::vector<pos_type> log2vis_list_;
56         /** Maps positions in the visual string to positions
57          *  in logical string.
58          */
59         std::vector<pos_type> vis2log_list_;
60         ///
61         std::vector<pos_type> levels_;
62         ///
63         pos_type start_;
64         ///
65         pos_type end_;
66 };
67
68
69 } // namespace lyx
70
71 #endif // BIDI_H