readded flag as xpm. png are not (easily) found
1 /* emacs: -*- Mode: C; c-style: "bsd"; c-basic-offset: 4; c-recognize-knr-p: nil; -*- */
5 #include <qmainwindow.h>
8 #include <qfontdatabase.h>
12 enum EditorState {inactiveEditor,emptyEditor,filledEditor};
16 class TextEditor : public QMainWindow {
23 void setShowWithMain (bool);
25 void setFontHint(const QString&);
26 QString getFontHint();
27 QString getFontHintDefault();
28 void setFilename (const QString&);
29 QString getFilename ();
30 void setFilenameHint (const QString&);
31 QString getFilenameHint ();
32 bool findText(const QString &, const bool &); // find Text
35 void setupFileActions();
36 void setupEditActions();
37 void setupFormatActions();
38 void setupSettingsActions();
39 void closeEvent( QCloseEvent* );
46 void editorChanged(); // received when text() changed
47 void setText(QString); // set Text (by MapEditor)
48 void setInactive(); // Nothing can be entered
52 void textHasChanged();
53 void fontFamilyHasChanged();
54 void fontSizeHasChanged();
60 void textConvertPar();
62 void textExportAsASCII();
65 void toggleFonthint();
71 void textFamily( const QString &f );
72 void textSize( const QString &p );
74 void textAlign(QAction*);
76 void fontChanged( const QFont &f );
77 void colorChanged( const QColor &c );
78 void alignmentChanged( int a );
79 void verticalAlignmentChanged(int a);
81 void disableActions();
86 QPoint lastPos; // save last position of window
90 QBrush emptyPaper; // setting the background color
91 QBrush filledPaper; // depending on the state
92 QBrush inactivePaper; // depending on the state
94 bool showwithmain; // same visibility as mainwindow?
102 QAction *actionFileLoad,
111 *actionEditDeleteAll,
112 *actionEditConvertPar,
113 *actionEditJoinLines,
114 *actionFormatUseFixedFont,
115 *actionSettingsVarFont,
116 *actionSettingsFixedFont,
117 *actionSettingsFonthintDefault,
119 *actionTextUnderline,
126 *actionAlignSubScript,
127 *actionAlignSuperScript;
130 /* Wraps currentVerticalAlignmentChanged(VerticalAlignment)
131 * to currentVerticalAlignmentChanged(int)
132 * this way the signal can be used without use of the internal
133 * VerticalAlignment enum of QTextEdit
134 * If VerticalAlignment has been a global like the normal alignment there
135 * have been no problems!
138 class MyTextEdit : public QTextEdit
142 MyTextEdit(QWidget *parent, const char *name) : QTextEdit(parent, name) {
144 SIGNAL(currentVerticalAlignmentChanged(VerticalAlignment)),
146 SLOT(verticalAlignmentChanged(VerticalAlignment)));
148 int verticalAlignment() const { return m_verticalAlignment; }
150 void currentVerticalAlignmentChanged(int a);
152 void verticalAlignmentChanged(VerticalAlignment a) {
153 m_verticalAlignment = a;
154 emit currentVerticalAlignmentChanged((int)a);
157 int m_verticalAlignment;