4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
9 * \author Abdelrazak Younes
11 * Full author contact details are available in file CREDITS.
14 #ifndef BASE_WORKAREA_H
15 #define BASE_WORKAREA_H
17 #include "frontends/GuiCursor.h"
19 #include "frontends/key_state.h"
20 #include "frontends/LyXKeySym.h"
25 class ViewMetricsInfo;
33 * The work area class represents the widget that provides the
34 * view onto a document. It is owned by the BufferView, and
35 * is responsible for handing events back to its owning BufferView.
36 * It works in concert with the BaseScreen class to update the
37 * widget view of a document.
41 WorkArea(LyXView & owner, int w, int h);
43 virtual ~WorkArea() {}
45 /// return the painter object for this work area
46 virtual Painter & getPainter() = 0;
48 /// return the width of the work area in pixels
49 virtual int width() const = 0;
51 /// return the height of the work area in pixels
52 virtual int height() const = 0;
55 * Update the scrollbar.
56 * @param height the total document height in pixels
57 * @param pos the current position in the document, in pixels
58 * @param line_height the line-scroll amount, in pixels
60 virtual void setScrollbarParams(int height, int pos, int line_height) = 0;
62 /// redraw the screen, without using existing pixmap
63 virtual void redraw(BufferView & bv, ViewMetricsInfo const & vi);
65 /// grey out (no buffer)
68 /// paint the cursor and store the background
69 virtual void showCursor(int x, int y, int h, Cursor_Shape shape) = 0;
72 virtual void removeCursor() = 0;
75 /// cause the display of the given area of the work area
76 virtual void expose(int x, int y, int w, int h) = 0;
80 void checkAndGreyOut();
86 } // namespace frontend
89 #endif // BASE_WORKAREA_H