2002-06-19 03:38:44 +00:00
|
|
|
// -*- C++ -*-
|
|
|
|
/**
|
|
|
|
* \file QWorkArea.h
|
2002-09-24 13:57:09 +00:00
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
2002-06-19 03:38:44 +00:00
|
|
|
*
|
|
|
|
* \author unknown
|
2002-09-24 13:57:09 +00:00
|
|
|
* \author John Levon
|
|
|
|
*
|
|
|
|
* Full author contact details are available in file CREDITS
|
2002-06-19 03:38:44 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef QWORKAREA_H
|
|
|
|
#define QWORKAREA_H
|
|
|
|
|
|
|
|
|
|
|
|
#include "WorkArea.h"
|
|
|
|
#include "QLPainter.h"
|
|
|
|
#include "QContentPane.h"
|
2002-09-24 13:57:09 +00:00
|
|
|
|
2002-06-19 03:38:44 +00:00
|
|
|
#include <qwidget.h>
|
|
|
|
#include <qscrollbar.h>
|
|
|
|
#include <qpixmap.h>
|
|
|
|
|
2002-09-24 13:57:09 +00:00
|
|
|
|
2002-06-19 03:38:44 +00:00
|
|
|
/**
|
|
|
|
* Qt-specific implementation of the work area
|
|
|
|
* (buffer view GUI)
|
|
|
|
*
|
|
|
|
* It consists of a content pane widget, and a scrollbar.
|
|
|
|
* Hopefully soon we can just use QScrollView ...
|
|
|
|
*/
|
|
|
|
class QWorkArea : public WorkArea, public QWidget {
|
|
|
|
public:
|
2002-10-20 01:48:28 +00:00
|
|
|
friend class QContentPane;
|
2002-06-19 03:38:44 +00:00
|
|
|
|
|
|
|
QWorkArea(int x, int y, int w, int h);
|
|
|
|
|
|
|
|
virtual ~QWorkArea();
|
|
|
|
/// return this widget's painter
|
|
|
|
virtual Painter & getPainter() { return painter_; }
|
|
|
|
/// return the width of the content pane
|
|
|
|
virtual int workWidth() const { return content_->width(); }
|
|
|
|
/// return the height of the content pane
|
|
|
|
virtual int workHeight() const { return content_->height(); }
|
2002-09-24 13:57:09 +00:00
|
|
|
///
|
2002-06-19 03:38:44 +00:00
|
|
|
virtual void setScrollbarParams(int height, int pos, int line_height);
|
2002-09-24 13:57:09 +00:00
|
|
|
|
2002-06-19 03:38:44 +00:00
|
|
|
/// a selection exists
|
|
|
|
virtual void haveSelection(bool) const;
|
|
|
|
///
|
|
|
|
virtual string const getClipboard() const;
|
|
|
|
///
|
|
|
|
virtual void putClipboard(string const &) const;
|
|
|
|
|
|
|
|
/// get the pixmap we paint on to
|
|
|
|
QPixmap * getPixmap() const { return content_->pixmap(); }
|
|
|
|
|
|
|
|
/// get the content pane widget
|
|
|
|
QWidget * getContent() const { return content_; }
|
|
|
|
private:
|
|
|
|
/// scroll bar
|
|
|
|
QScrollBar * scrollbar_;
|
|
|
|
/// content
|
|
|
|
QContentPane * content_;
|
2002-09-24 13:57:09 +00:00
|
|
|
|
2002-06-19 03:38:44 +00:00
|
|
|
/// our painter
|
|
|
|
QLPainter painter_;
|
|
|
|
};
|
2002-09-24 13:57:09 +00:00
|
|
|
|
2002-06-19 03:38:44 +00:00
|
|
|
#endif // QWORKAREA_H
|