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"
23 class ViewMetricsInfo;
31 * The work area class represents the widget that provides the
32 * view onto a document. It is owned by the BufferView, and
33 * is responsible for handing events back to its owning BufferView.
34 * It works in concert with the BaseScreen class to update the
35 * widget view of a document.
39 WorkArea(BufferView * buffer_view = 0);
41 virtual ~WorkArea() {}
43 void setBufferView(BufferView * buffer_view);
46 BufferView & bufferView();
48 BufferView const & bufferView() const;
50 /// return the painter object for this work area
51 virtual Painter & getPainter() = 0;
53 /// return the width of the work area in pixels
54 virtual int width() const = 0;
56 /// return the height of the work area in pixels
57 virtual int height() const = 0;
60 * Update the scrollbar.
61 * @param height the total document height in pixels
62 * @param pos the current position in the document, in pixels
63 * @param line_height the line-scroll amount, in pixels
65 virtual void setScrollbarParams(int height, int pos, int line_height) = 0;
67 /// redraw the screen, without using existing pixmap
68 virtual void redraw(BufferView & bv, ViewMetricsInfo const & vi);
70 /// grey out (no buffer)
73 /// paint the cursor and store the background
74 virtual void showCursor(int x, int y, int h, CursorShape shape) = 0;
77 virtual void removeCursor() = 0;
80 /// cause the display of the given area of the work area
81 virtual void expose(int x, int y, int w, int h) = 0;
84 BufferView * buffer_view_;
88 void checkAndGreyOut();
94 } // namespace frontend
97 #endif // BASE_WORKAREA_H