00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef EditorHelper_included
00018 #define EditorHelper_included
00019
00020 #include <qobject.h>
00021 #include <qtextedit.h>
00022
00023 class QAction;
00024 class QComboBox;
00025 class QString;
00026 class QFont;
00027 class QColor;
00028 class QToolBar;
00029 class ReadWriteFormBase;
00030
00031
00032 class EditorHelper: public QObject
00033 {
00034 Q_OBJECT
00035
00036
00037 private:
00038 EditorHelper(const EditorHelper&);
00039 EditorHelper& operator=(const EditorHelper&);
00040
00041 public:
00042 EditorHelper(ReadWriteFormBase *parent, QTextEdit *editor);
00043 ~EditorHelper();
00044
00045 private:
00046 QAction *actionTextBold,
00047 *actionTextUnderline,
00048 *actionTextItalic,
00049 *actionTextColor,
00050 *actionAlignLeft,
00051 *actionAlignCenter,
00052 *actionAlignRight,
00053 *actionAlignJustify;
00054 QComboBox *comboStyle,
00055 *comboFont,
00056 *comboSize;
00057
00058 ReadWriteFormBase *parent;
00059 QTextEdit *e;
00060 QToolBar *toolbar;
00061
00062
00063 public slots:
00064 void setupToolBar();
00065 void setupEditorConnections();
00066
00067 private slots:
00068 void editUndo();
00069 void editRedo();
00070 void editCut();
00071 void editCopy();
00072 void editPaste();
00073
00074 void textBold();
00075 void textUnderline();
00076 void textItalic();
00077 void textFamily( const QString &f );
00078 void textSize( const QString &p );
00079 void textStyle( int s );
00080 void textColor();
00081 void textAlign( QAction *a );
00082
00083 void fontChanged( const QFont &f );
00084 void colorChanged( const QColor &c );
00085 void alignmentChanged( int a );
00086 };
00087 #endif