lib Library API Documentation

kformulawidget.h

00001 /* This file is part of the KDE project
00002    Copyright (C) 2001 Andrea Rizzi <rizzi@kde.org>
00003                   Ulrich Kuettler <ulrich.kuettler@mailbox.tu-dresden.de>
00004 
00005    This library is free software; you can redistribute it and/or
00006    modify it under the terms of the GNU Library General Public
00007    License as published by the Free Software Foundation; either
00008    version 2 of the License, or (at your option) any later version.
00009 
00010    This library is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY; without even the implied warranty of
00012    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013    Library General Public License for more details.
00014 
00015    You should have received a copy of the GNU Library General Public License
00016    along with this library; see the file COPYING.LIB.  If not, write to
00017    the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00018    Boston, MA 02111-1307, USA.
00019 */
00020 
00021 #ifndef KFORMULAWIDGET_H
00022 #define KFORMULAWIDGET_H
00023 
00024 #include <qdom.h>
00025 #include <qpixmap.h>
00026 #include <qpoint.h>
00027 #include <qwidget.h>
00028 
00029 #include "kformuladefs.h"
00030 #include "kformulaview.h"
00031 
00032 KFORMULA_NAMESPACE_BEGIN
00033 
00034 class BasicElement;
00035 class FormulaCursor;
00036 class FormulaElement;
00037 class Container;
00038 
00039 KFORMULA_NAMESPACE_END
00040 
00041 using namespace KFormula;
00042 
00043 
00048 class KFormulaWidget : public QWidget {
00049     Q_OBJECT
00050 
00051 public:
00052     KFormulaWidget(Container*, QWidget* parent=0, const char* name=0, WFlags f=0);
00053     ~KFormulaWidget();
00054 
00055 
00059     QPoint getCursorPoint() const;
00060 
00064     void setReadOnly(bool ro);
00065 
00066 public slots:
00067 
00068     void slotSelectAll();
00069 
00070 signals:
00071 
00075     void cursorChanged(bool visible, bool selecting);
00076 
00077 protected slots:
00078 
00082     void slotFormulaChanged(int width, int height);
00083 
00084     void slotCursorChanged(bool visible, bool selecting);
00085 
00086 protected:
00087 
00088     virtual void mousePressEvent(QMouseEvent* event);
00089     virtual void mouseReleaseEvent(QMouseEvent* event);
00090     virtual void mouseDoubleClickEvent(QMouseEvent* event);
00091     virtual void mouseMoveEvent(QMouseEvent* event);
00092     virtual void wheelEvent(QWheelEvent* event);
00093 
00094     virtual void paintEvent(QPaintEvent* event);
00095     virtual void keyPressEvent(QKeyEvent* event);
00096     virtual void focusInEvent(QFocusEvent* event);
00097     virtual void focusOutEvent(QFocusEvent* event);
00098 
00102     Container* getDocument();
00103 
00107     FormulaCursor* getCursor();
00108 
00109 private:
00110 
00114     View formulaView;
00115 
00116     QPixmap buffer;
00117 };
00118 
00119 #endif // KFORMULAWIDGET_H
KDE Logo
This file is part of the documentation for lib Library Version 1.4.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Mon Feb 13 09:39:57 2006 by doxygen 1.4.2 written by Dimitri van Heesch, © 1997-2003