whitespace.
[lyx.git] / src / rowpainter.h
blobd3e521496c7e6fd1ea79026f6a83fb8c82a3ac02
1 // -*- C++ -*-
2 /**
3 * \file rowpainter.h
4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
7 * \author various
8 * \author John Levon
9 * \author André Pönitz
11 * Full author contact details are available in file CREDITS.
14 #ifndef ROWPAINTER_H
15 #define ROWPAINTER_H
17 #include "Changes.h"
19 #include "support/types.h"
21 namespace lyx {
23 class Bidi;
24 class BufferView;
25 class Font;
26 class FontInfo;
27 class Inset;
28 class Language;
29 class PainterInfo;
30 class Paragraph;
31 class ParagraphList;
32 class ParagraphMetrics;
33 class Row;
34 class Text;
35 class TextMetrics;
37 namespace frontend { class Painter; }
39 /**
40 * A class used for painting an individual row of text.
41 * FIXME: get rid of that class.
43 class RowPainter {
44 public:
45 /// initialise and run painter
46 RowPainter(PainterInfo & pi, Text const & text,
47 pit_type pit, Row const & row, Bidi & bidi, int x, int y);
49 /// paint various parts
50 /// FIXME: transfer to TextMetrics
51 void paintAppendix();
52 void paintDepthBar();
53 void paintChangeBar();
54 void paintFirst();
55 void paintLast();
56 void paintText();
57 void paintOnlyInsets();
59 private:
60 void paintForeignMark(double orig_x, Language const * lang, int desc = 0);
61 void paintHebrewComposeChar(pos_type & vpos, FontInfo const & font);
62 void paintArabicComposeChar(pos_type & vpos, FontInfo const & font);
63 void paintChars(pos_type & vpos, FontInfo const & font,
64 bool hebrew, bool arabic);
65 int paintAppendixStart(int y);
66 void paintFromPos(pos_type & vpos);
67 void paintInset(Inset const * inset, pos_type const pos);
68 void paintInlineCompletion(Font const & font);
70 /// return left margin
71 int leftMargin() const;
73 /// return the label font for this row
74 FontInfo labelFont() const;
76 /// contains painting related information.
77 PainterInfo & pi_;
79 /// Text for the row
80 Text const & text_;
81 TextMetrics & text_metrics_;
82 ParagraphList const & pars_;
84 /// The row to paint
85 Row const & row_;
87 /// Row's paragraph
88 pit_type const pit_;
89 Paragraph const & par_;
90 ParagraphMetrics const & pm_;
92 /// bidi cache, comes from outside the rowpainter because
93 /// rowpainters are normally created in a for loop and there only
94 /// one of them is active at a time.
95 Bidi & bidi_;
97 /// row changed? (change tracking)
98 Change const change_;
100 // Looks ugly - is
101 double const xo_;
102 int const yo_; // current baseline
103 double x_;
104 int width_;
107 } // namespace lyx
109 #endif // ROWPAINTER_H