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"
30 * The work area class represents the widget that provides the
31 * view onto a document. It is owned by the BufferView, and
32 * is responsible for handing events back to its owning BufferView.
33 * It works in concert with the BaseScreen class to update the
34 * widget view of a document.
38 WorkArea(BufferView * buffer_view = 0);
40 virtual ~WorkArea() {}
42 void setBufferView(BufferView * buffer_view);
45 BufferView & bufferView();
47 BufferView const & bufferView() const;
49 /// return the painter object for this work area
50 virtual Painter & getPainter() = 0;
52 /// return the width of the work area in pixels
53 virtual int width() const = 0;
55 /// return the height of the work area in pixels
56 virtual int height() const = 0;
59 * Update the scrollbar.
60 * @param height the total document height in pixels
61 * @param pos the current position in the document, in pixels
62 * @param line_height the line-scroll amount, in pixels
64 virtual void setScrollbarParams(int height, int pos, int line_height) = 0;
66 /// redraw the screen, without using existing pixmap
67 virtual void redraw(BufferView & bv);
69 /// grey out (no buffer)
72 /// paint the cursor and store the background
73 virtual void showCursor(int x, int y, int h, CursorShape shape) = 0;
76 virtual void removeCursor() = 0;
79 /// cause the display of the given area of the work area
80 virtual void expose(int x, int y, int w, int h) = 0;
83 BufferView * buffer_view_;
87 void checkAndGreyOut();
93 } // namespace frontend
96 #endif // BASE_WORKAREA_H