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