12 enum EditorState {inactiveEditor,emptyEditor,filledEditor};
14 class TextEditor : public QMainWindow
20 void init(const QString &ename);
22 void setEditorName( const QString & );
23 void setEditorTitle(const QString &);
24 QString getEditorTitle();
25 void setFont (const QFont &);
26 void setFontHint(const QString&);
27 QString getFontHint();
28 QString getFontHintDefault();
29 void setFilename (const QString&);
30 QString getFilename ();
31 void setFilenameHint (const QString&);
32 QString getFilenameHint ();
36 bool findText(const QString &, const QTextDocument::FindFlags &);
37 bool findText(const QString &, const QTextDocument::FindFlags &,int i);
38 void setTextCursor (const QTextCursor & cursor );
39 QTextCursor getTextCursor();
43 void setupFileActions();
44 void setupEditActions();
45 void setupFormatActions();
46 void setupSettingsActions();
47 void closeEvent( QCloseEvent* );
48 bool eventFilter(QObject *obj, QEvent *ev);
51 void editorChanged(); // received when text() changed
52 void setRichText(const QString &t);
53 void setPlainText(const QString &t);
54 void setTextAuto(const QString &); // set Text and autodetect mode
55 void setVymText(const VymText &vt);
56 void setInactive(); // Nothing can be entered
61 void textHasChanged();
63 void fontFamilyHasChanged();
64 void fontSizeHasChanged();
70 void textExportAsASCII();
73 void toggleFonthint();
74 void setRichTextMode(bool b);
75 void toggleRichText();
81 void textFamily( const QString &f );
82 void textSize( const QString &p );
84 void textAlign(QAction*);
86 void fontChanged( const QFont &f );
87 void colorChanged( const QColor &c );
88 void formatChanged (const QTextCharFormat &f);
89 void alignmentChanged( int a );
90 void verticalAlignmentChanged(QTextCharFormat::VerticalAlignment);
92 void setState (EditorState);
93 void setEmptyEditorColor();
94 void setInactiveEditorColor();
95 void setFilledEditorColor();
99 QString shortcutScope; // used for settings and shortcut scopes
101 QPoint lastPos; // save last position of window
102 QString editorName; // Name of editor, e.g. note editor, heading editor, ...
103 QString editorTitle; // window title: Editor name + selected branch
105 QString filenameHint;
107 QBrush emptyPaper; // setting the background color
108 QBrush filledPaper; // depending on the state
109 QBrush inactivePaper; // depending on the state
111 bool blockChangedSignal;
113 QColor colorEmptyEditor;
114 QColor colorFilledEditor;
115 QColor colorInactiveEditor;
120 QComboBox *comboFont, *comboSize;
122 QToolBar *editToolBar;
123 QToolBar *fontToolBar;
124 QToolBar *fontHintsToolBar;
125 QToolBar *formatToolBar;
127 QAction *actionFileLoad,
131 *actionFileDeleteAll,
137 *actionFormatUseFixedFont,
138 *actionFormatRichText,
139 *actionSettingsVarFont,
140 *actionSettingsFixedFont,
141 *actionSettingsFonthintDefault,
142 *actionEmptyEditorColor,
143 *actionFilledEditorColor,
144 *actionInactiveEditorColor,
147 QAction *actionTextBold,
148 *actionTextUnderline,
151 *actionAlignSubScript,
152 *actionAlignSuperScript,