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
|
|
|
|
*
|
2003-08-23 00:17:00 +00:00
|
|
|
* 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 <qscrollbar.h>
|
2003-09-07 21:25:37 +00:00
|
|
|
|
2004-04-28 11:33:27 +00:00
|
|
|
class LyXView;
|
2003-09-07 21:25:37 +00:00
|
|
|
class QPixmap;
|
|
|
|
class QWidget;
|
2002-06-19 03:38:44 +00:00
|
|
|
|
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
|
|
|
|
2004-04-28 17:22:05 +00:00
|
|
|
QWorkArea(LyXView & owner, int w, int h);
|
2002-06-19 03:38:44 +00:00
|
|
|
|
|
|
|
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;
|
|
|
|
///
|
2003-10-06 15:43:21 +00:00
|
|
|
virtual std::string const getClipboard() const;
|
2002-06-19 03:38:44 +00:00
|
|
|
///
|
2003-10-06 15:43:21 +00:00
|
|
|
virtual void putClipboard(std::string const &) const;
|
2003-08-05 19:51:45 +00:00
|
|
|
///
|
|
|
|
virtual void dragEnterEvent(QDragEnterEvent * event);
|
|
|
|
///
|
|
|
|
virtual void dropEvent(QDropEvent* event);
|
2002-06-19 03:38:44 +00:00
|
|
|
|
|
|
|
/// 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
|