lib

kformulawidget.h
1/* This file is part of the KDE project
2 Copyright (C) 2001 Andrea Rizzi <rizzi@kde.org>
3 Ulrich Kuettler <ulrich.kuettler@mailbox.tu-dresden.de>
4
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version.
9
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details.
14
15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02110-1301, USA.
19*/
20
21#ifndef KFORMULAWIDGET_H
22#define KFORMULAWIDGET_H
23
24#include <tqdom.h>
25#include <tqpixmap.h>
26#include <tqpoint.h>
27#include <tqwidget.h>
28
29#include "kformuladefs.h"
30#include "kformulaview.h"
31
32KFORMULA_NAMESPACE_BEGIN
33
34class BasicElement;
35class FormulaCursor;
36class FormulaElement;
37class Container;
38
39KFORMULA_NAMESPACE_END
40
41using namespace KFormula;
42
43
48class KFormulaWidget : public TQWidget {
49 TQ_OBJECT
50
51
52public:
53 KFormulaWidget(Container*, TQWidget* parent=0, const char* name=0, WFlags f=0);
54 ~KFormulaWidget();
55
56
60 TQPoint getCursorPoint() const;
61
65 void setReadOnly(bool ro);
66
67public slots:
68
69 void slotSelectAll();
70
71signals:
72
76 void cursorChanged(bool visible, bool selecting);
77
78protected slots:
79
83 void slotFormulaChanged(int width, int height);
84
85 void slotCursorChanged(bool visible, bool selecting);
86
87protected:
88
89 virtual void mousePressEvent(TQMouseEvent* event);
90 virtual void mouseReleaseEvent(TQMouseEvent* event);
91 virtual void mouseDoubleClickEvent(TQMouseEvent* event);
92 virtual void mouseMoveEvent(TQMouseEvent* event);
93 virtual void wheelEvent(TQWheelEvent* event);
94
95 virtual void paintEvent(TQPaintEvent* event);
96 virtual void keyPressEvent(TQKeyEvent* event);
97 virtual void focusInEvent(TQFocusEvent* event);
98 virtual void focusOutEvent(TQFocusEvent* event);
99
104
109
110private:
111
115 View formulaView;
116
117 TQPixmap buffer;
118};
119
120#endif // KFORMULAWIDGET_H
Basis of every formula element.
The document.
The selection.
The main element.
void setReadOnly(bool ro)
Puts the widget in read only mode.
TQPoint getCursorPoint() const
void cursorChanged(bool visible, bool selecting)
Is emitted every time the cursor might have changed.
Container * getDocument()
The document we show.
void slotFormulaChanged(int width, int height)
The formula has changed and needs to be redrawn.
FormulaCursor * getCursor()
Our cursor.
The view that shows the formula.