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);
00021 public slots:
00022 void setLabel(Label *label) { l = label;update(); }
00023 Label* label() { apply(); return l; }
00024 void update();
00025 private slots:
00026 void selectFont();
00027 void setTEColor();
00028 void toggleBold();
00029 void toggleItalic();
00030 void toggleUnderline();
00031 void toggleSuperscript();
00032 void toggleSubscript();
00033 void insertChar(int ch);
00034 void insertGChar(int ch);
00035 void boxedChanged(bool b) { l->setBoxed(b); }
00036 private:
00037 void apply();
00038 Label *l;
00039 QTextEdit *te;
00040 KLineEdit *xle, *yle, *titleFont;
00041 QToolButton *bold, *italic, *underline, *superscript, *subscript;
00042 KPopupMenu *sgletters, *bgletters, *oletters;
00043 KColorButton *kcb;
00044 QCheckBox *boxedcb;
00045 };
00046
00047 #endif //RICHTEXTWIDGET_H