00001
00002
00003 #ifndef RICHTEXTWIDGET_H
00004 #define RICHTEXTWIDGET_H
00005
00006 #include <klineedit.h>
00007 #include <qfont.h>
00008 #include <qcheckbox.h>
00009 #include <qcombobox.h>
00010 #include <qtextedit.h>
00011 #include <kcolorbutton.h>
00012 #include <kpopupmenu.h>
00013 #include "Worksheet.h"
00014 #include "Label.h"
00015
00016 class RichTextWidget: public QWidget
00017 {
00018 Q_OBJECT
00019 public:
00020 RichTextWidget(QWidget *parent, Label *label, const char *name, bool qwtplot=0);
00021 ~RichTextWidget();
00022 public slots:
00023 void setLabel(Label *label) { l = label; update(); }
00024 Label* getLabel() { apply(); return l; }
00025 Label* label() { return getLabel(); }
00026 void setPostionReadOnly(bool r=true) {xle->setReadOnly(r); yle->setReadOnly(r); }
00027 void update();
00028 private slots:
00029 void selectFont();
00030 void setTEColor();
00031 void toggleBold();
00032 void toggleItalic();
00033 void toggleUnderline();
00034 void toggleSuperscript();
00035 void toggleSubscript();
00036 void insertChar(int ch);
00037 void insertGChar(int ch);
00038 void boxedChanged(bool b) { l->setBoxed(b); }
00039 private:
00040 void apply();
00041 Label *l;
00042 QFont greek;
00043 QTextEdit *te;
00044 KLineEdit *xle, *yle, *titleFont, *rotle;
00045 QToolButton *bold, *italic, *underline, *superscript, *subscript;
00046 KPopupMenu *sgletters, *bgletters, *oletters;
00047 KColorButton *kcb, *bgcolor;
00048 QCheckBox *boxedcb, *texcb, *transcb;
00049 };
00050
00051 #endif //RICHTEXTWIDGET_H