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