6 #include <QFontDatabase>
11 enum EditorState {inactiveEditor,emptyEditor,filledEditor};
15 class TextEditor : public QMainWindow {
22 void setShowWithMain (bool);
24 void setFontHint(const QString&);
25 QString getFontHint();
26 QString getFontHintDefault();
27 void setFilename (const QString&);
28 QString getFilename ();
29 void setFilenameHint (const QString&);
30 QString getFilenameHint ();
31 bool findText(const QString &, const QTextDocument::FindFlags &); // find Text
34 void setupFileActions();
35 void setupEditActions();
36 void setupFormatActions();
37 void setupSettingsActions();
38 void closeEvent( QCloseEvent* );
45 void editorChanged(); // received when text() changed
46 void setText(QString); // set Text (by MapEditor)
47 void setInactive(); // Nothing can be entered
51 void textHasChanged();
52 void fontFamilyHasChanged();
53 void fontSizeHasChanged();
59 void textExportAsASCII();
62 void toggleFonthint();
68 void textFamily( const QString &f );
69 void textSize( const QString &p );
71 void textAlign(QAction*);
73 void fontChanged( const QFont &f );
74 void colorChanged( const QColor &c );
75 void formatChanged (const QTextCharFormat &f);
76 void alignmentChanged( int a );
77 void verticalAlignmentChanged(QTextCharFormat::VerticalAlignment);
79 void disableActions();
80 void setState (EditorState);
85 QPoint lastPos; // save last position of window
89 QBrush emptyPaper; // setting the background color
90 QBrush filledPaper; // depending on the state
91 QBrush inactivePaper; // depending on the state
93 bool showwithmain; // same visibility as mainwindow?
97 QComboBox *comboFont, *comboSize;
99 QAction *actionFileLoad,
108 *actionEditDeleteAll,
109 *actionFormatUseFixedFont,
110 *actionSettingsVarFont,
111 *actionSettingsFixedFont,
112 *actionSettingsFonthintDefault,
114 *actionTextUnderline,
117 *actionAlignSubScript,
118 *actionAlignSuperScript,