diff -r 7a96bd401351 -r 608f976aa7bb texteditor.h --- a/texteditor.h Sun Jan 30 12:58:47 2005 +0000 +++ b/texteditor.h Tue Jun 06 14:58:11 2006 +0000 @@ -1,16 +1,21 @@ +/* emacs: -*- Mode: C; c-style: "bsd"; c-basic-offset: 4; c-recognize-knr-p: nil; -*- */ #ifndef TEXTEDITOR_H #define TEXTEDITOR_H -#include -#include +#include +#include #include #include #include +//Added by qt3to4: +#include enum EditorState {inactiveEditor,emptyEditor,filledEditor}; -class TextEditor : public QMainWindow { +class MyTextEdit; + +class TextEditor : public Q3MainWindow { Q_OBJECT public: TextEditor(); @@ -24,6 +29,8 @@ QString getFontHintDefault(); void setFilename (const QString&); QString getFilename (); + void setFilenameHint (const QString&); + QString getFilenameHint (); bool findText(const QString &, const bool &); // find Text protected: @@ -54,7 +61,6 @@ void textSave(); void textConvertPar(); void textJoinLines(); - QString textConvertToASCII(const QString &); void textExportAsASCII(); void textPrint(); void textEditUndo(); @@ -68,17 +74,20 @@ void textSize( const QString &p ); void textColor(); void textAlign(QAction*); + void textVAlign(); void fontChanged( const QFont &f ); void colorChanged( const QColor &c ); void alignmentChanged( int a ); + void verticalAlignmentChanged(int a); void enableActions(); void disableActions(); private: QPrinter *printer; - QTextEdit *e; + MyTextEdit *e; QPoint lastPos; // save last position of window QString filename; + QString filenameHint; QBrush emptyPaper; // setting the background color QBrush filledPaper; // depending on the state @@ -115,9 +124,39 @@ *actionAlignLeft, *actionAlignCenter, *actionAlignRight, - *actionAlignJustify; + *actionAlignJustify, + *actionAlignSubScript, + *actionAlignSuperScript; +}; - +/* Wraps currentVerticalAlignmentChanged(VerticalAlignment) + * to currentVerticalAlignmentChanged(int) + * this way the signal can be used without use of the internal + * VerticalAlignment enum of QTextEdit + * If VerticalAlignment has been a global like the normal alignment there + * have been no problems! + */ + +class MyTextEdit : public Q3TextEdit +{ + Q_OBJECT; + public: + MyTextEdit(QWidget *parent, const char *name) : Q3TextEdit(parent, name) { + connect(this, + SIGNAL(currentVerticalAlignmentChanged(VerticalAlignment)), + this, + SLOT(verticalAlignmentChanged(VerticalAlignment))); + } + int verticalAlignment() const { return m_verticalAlignment; } + signals: + void currentVerticalAlignmentChanged(int a); + public slots: + void verticalAlignmentChanged(VerticalAlignment a) { + m_verticalAlignment = a; + emit currentVerticalAlignmentChanged((int)a); + } + private: + int m_verticalAlignment; }; #endif