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_; }
|
* frontends/WorkArea.h(workAreaResize, scrollDocView, workAreaKeyPress,
dispatch, selectionReuqested, selectionLost): remove signals
* BufferView.[Ch] (selectionRequested, selectionLost, workAreaResize,
workAreaKeyPress, workAreaDispatch): add forwarding functions to the pimpl
* BufferView_pimpl.C (Pimpl): Remove the setup of the now deleted signals,
also remove corresponding connection objects.
* frontends/xforms/XWorkArea.h:
* frontends/qt2/QWorkArea.h:
* frontends/qt4/QWorkArea.h:
* frontends/gtk/GWorkArea.h: add LyXView as class variable view_ (qt
classes also get view() medthod)
* frontends/qt2/QWorkArea.C:
* frontends/qt2/QContentPane.C:
* frontends/qt4/QWorkArea.C:
* frontends/xforms/XWorkArea.C:
* frontends/gtk/GWorkArea.C: Change from calling signals to call
the functions directly through view_.view()
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@13671 a592a061-630c-0410-9148-cb99ea01b6c8
2006-04-13 18:58:48 +00:00
|
|
|
///
|
|
|
|
LyXView & view()
|
|
|
|
{
|
|
|
|
return owner_;
|
|
|
|
}
|
2002-06-19 03:38:44 +00:00
|
|
|
private:
|
* frontends/WorkArea.h(workAreaResize, scrollDocView, workAreaKeyPress,
dispatch, selectionReuqested, selectionLost): remove signals
* BufferView.[Ch] (selectionRequested, selectionLost, workAreaResize,
workAreaKeyPress, workAreaDispatch): add forwarding functions to the pimpl
* BufferView_pimpl.C (Pimpl): Remove the setup of the now deleted signals,
also remove corresponding connection objects.
* frontends/xforms/XWorkArea.h:
* frontends/qt2/QWorkArea.h:
* frontends/qt4/QWorkArea.h:
* frontends/gtk/GWorkArea.h: add LyXView as class variable view_ (qt
classes also get view() medthod)
* frontends/qt2/QWorkArea.C:
* frontends/qt2/QContentPane.C:
* frontends/qt4/QWorkArea.C:
* frontends/xforms/XWorkArea.C:
* frontends/gtk/GWorkArea.C: Change from calling signals to call
the functions directly through view_.view()
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@13671 a592a061-630c-0410-9148-cb99ea01b6c8
2006-04-13 18:58:48 +00:00
|
|
|
/// The owning LyXView
|
|
|
|
LyXView & owner_;
|
|
|
|
|
2002-06-19 03:38:44 +00:00
|
|
|
/// 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
|