kformula
kformulawidget.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
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 FormulaCursor;
00035 class Container;
00036
00037 KFORMULA_NAMESPACE_END
00038
00039
00044 class KFormulaWidget : public QWidget {
00045 Q_OBJECT
00046
00047 public:
00048 KFormulaWidget(KFormula::Container*, QWidget* parent=0, const char* name=0, WFlags f=0);
00049 ~KFormulaWidget();
00050
00051
00055 QPoint getCursorPoint() const;
00056
00060 void setReadOnly(bool ro);
00061
00062 const KFormula::View* view() const { return &formulaView; }
00063 KFormula::View* view() { return &formulaView; }
00064
00065 public slots:
00066
00067 void slotSelectAll();
00068
00069 signals:
00070
00074 void cursorChanged(bool visible, bool selecting);
00075
00076 protected slots:
00077
00081 void slotFormulaChanged(int width, int height);
00082
00083 void slotCursorChanged(bool visible, bool selecting);
00084
00085 protected:
00086
00087 virtual void mousePressEvent(QMouseEvent* event);
00088 virtual void mouseReleaseEvent(QMouseEvent* event);
00089 virtual void mouseDoubleClickEvent(QMouseEvent* event);
00090 virtual void mouseMoveEvent(QMouseEvent* event);
00091
00092 virtual void paintEvent(QPaintEvent* event);
00093 virtual void keyPressEvent(QKeyEvent* event);
00094 virtual void focusInEvent(QFocusEvent* event);
00095 virtual void focusOutEvent(QFocusEvent* event);
00096
00100 KFormula::Container* getDocument();
00101
00105 KFormula::FormulaCursor* getCursor();
00106
00107 private:
00108
00112 KFormula::View formulaView;
00113
00114 QPixmap buffer;
00115 };
00116
00117 #endif // KFORMULAWIDGET_H
|