lyx_mirror/src/frontends/qt2/QWorkArea.h
John Levon 0c5c06c8c4 The initial merge of the Qt frontend, and the necessary compile fixes.
All still VERY primitive, in fact even more primitive since some stuff
got re-horked after the meeting, and still needs working on. Won't actually
compile out of the box, but the tweaks should be pretty obvious for any
body sufficiently daring.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4427 a592a061-630c-0410-9148-cb99ea01b6c8
2002-06-19 03:38:44 +00:00

92 lines
2.1 KiB
C++

// -*- C++ -*-
/**
* \file QWorkArea.h
* Copyright 1995-2002 the LyX Team
* Read the file COPYING
*
* \author unknown
* \author John Levon <moz@compsoc.man.ac.uk>
*/
#ifndef QWORKAREA_H
#define QWORKAREA_H
#ifdef __GNUG__
#pragma interface
#endif
#include <utility>
#include "WorkArea.h"
#include "QLPainter.h"
#include "QContentPane.h"
#include <qwidget.h>
#include <qscrollbar.h>
#include <qpixmap.h>
/**
* 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 {
friend class QContentPane;
public:
QWorkArea(int x, int y, int w, int h);
// FIXME:
virtual int xpos() const { return 0; }
virtual int ypos() const { return 0; }
virtual bool visible() const { return true; }
virtual void greyOut() const { }
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(); }
/// resize this widget
virtual void resize(int xpos, int ypos, int width, int height);
/// FIXME: makes no sense ?
virtual void redraw() const { }
/// set focus to this widget
virtual void setFocus() const { /* FIXME */ }
/// does this widget have the focus ?
virtual bool hasFocus() const { /* FIXME */ return true; }
///
virtual void setScrollbarParams(int height, int pos, int line_height);
/// 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_;
/// our painter
QLPainter painter_;
};
#endif // QWORKAREA_H