4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
8 * \author Abdelrazak Younes
10 * Full author contact details are available in file CREDITS.
16 #include "frontends/Painter.h"
31 * QLPainter - a painter implementation for Qt4
33 class QLPainter : public QPainter, public Painter {
35 QLPainter(QPaintDevice *);
38 /// draw a line from point to point
43 line_style = line_solid,
44 line_width = line_thin);
47 * lines - draw a set of lines
48 * @param xp array of points' x co-ords
49 * @param yp array of points' y co-ords
50 * @param np size of the points array
57 line_style = line_solid,
58 line_width = line_thin);
61 virtual void rectangle(
65 line_style = line_solid,
66 line_width = line_thin);
68 /// draw a filled rectangle
69 virtual void fillRectangle(
77 unsigned int w, unsigned int h,
86 /// draw an image from the image cache
87 virtual void image(int x, int y,
89 lyx::graphics::Image const & image);
91 /// draw a string at position x, y (y is the baseline)
92 virtual int text(int x, int y,
93 lyx::docstring const & str, LyXFont const & f);
95 /** Draw a string at position x, y (y is the baseline)
96 * This is just for fast drawing
98 virtual int text(int x, int y,
99 lyx::char_type const * str, size_t l,
102 /// draw a char at position x, y (y is the baseline)
103 virtual int text(int x, int y,
104 lyx::char_type c, LyXFont const & f);
107 /// draw small caps text
109 \return width of the drawn text.
111 int smallCapsText(int x, int y,
112 QString const & str, LyXFont const & f);
114 /// set pen parameters
115 void setQPainterPen(LColor_color col,
116 line_style ls = line_solid,
117 line_width lw = line_thin);
119 LColor::color current_color_;
120 Painter::line_style current_ls_;
121 Painter::line_width current_lw_;
124 } // namespace frontend
127 #endif // QLPAINTER_H