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.
18 #include <boost/scoped_ptr.hpp>
37 * QLPainter - a painter implementation for Qt4
39 class QLPainter : public QPainter, public Painter {
41 /// return the width of the work area in pixels
42 virtual int paperWidth() const;
43 /// return the height of the work area in pixels
44 virtual int paperHeight() const;
46 /// draw a line from point to point
51 line_style = line_solid,
52 line_width = line_thin);
55 * lines - draw a set of lines
56 * @param xp array of points' x co-ords
57 * @param yp array of points' y co-ords
58 * @param np size of the points array
65 line_style = line_solid,
66 line_width = line_thin);
69 virtual void rectangle(
73 line_style = line_solid,
74 line_width = line_thin);
76 /// draw a filled rectangle
77 virtual void fillRectangle(
85 unsigned int w, unsigned int h,
94 /// draw an image from the image cache
95 virtual void image(int x, int y,
97 lyx::graphics::Image const & image);
99 /// draw a string at position x, y (y is the baseline)
100 virtual int text(int x, int y,
101 lyx::docstring const & str, LyXFont const & f);
103 /** Draw a string at position x, y (y is the baseline)
104 * This is just for fast drawing
106 virtual int text(int x, int y,
107 lyx::char_type const * str, size_t l,
110 /// draw a char at position x, y (y is the baseline)
111 virtual int text(int x, int y,
112 lyx::char_type c, LyXFont const & f);
115 friend class GuiWorkArea;
116 QLPainter(QWidget *);
119 /// draw small caps text
121 \return width of the drawn text.
123 int smallCapsText(int x, int y,
124 QString const & str, LyXFont const & f);
126 /// set pen parameters
127 void setQPainterPen(LColor_color col,
128 line_style ls = line_solid,
129 line_width lw = line_thin);
134 LColor::color current_color_;
135 Painter::line_style current_ls_;
136 Painter::line_width current_lw_;
139 } // namespace frontend
142 #endif // QLPAINTER_H