summaryrefslogtreecommitdiffstats
path: root/kmail/kmedit.h
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commit460c52653ab0dcca6f19a4f492ed2c5e4e963ab0 (patch)
tree67208f7c145782a7e90b123b982ca78d88cc2c87 /kmail/kmedit.h
downloadtdepim-460c52653ab0dcca6f19a4f492ed2c5e4e963ab0.tar.gz
tdepim-460c52653ab0dcca6f19a4f492ed2c5e4e963ab0.zip
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kmail/kmedit.h')
-rw-r--r--kmail/kmedit.h131
1 files changed, 131 insertions, 0 deletions
diff --git a/kmail/kmedit.h b/kmail/kmedit.h
new file mode 100644
index 000000000..384b36f3d
--- /dev/null
+++ b/kmail/kmedit.h
@@ -0,0 +1,131 @@
+/* -*- mode: C++; c-file-style: "gnu" -*-
+ * KMComposeWin Header File
+ * Author: Markus Wuebben <markus.wuebben@kde.org>
+ */
+#ifndef __KMAIL_KMEDIT_H__
+#define __KMAIL_KMEDIT_H__
+
+#include <kdeversion.h>
+#include <keditcl.h>
+#include <qmap.h>
+#include <qstringlist.h>
+#include <qclipboard.h>
+
+class KMComposeWin;
+class KSpellConfig;
+class KSpell;
+class SpellingFilter;
+class KTempFile;
+class KDictSpellingHighlighter;
+class KDirWatch;
+class KProcess;
+class QPopupMenu;
+
+
+class KMEdit : public KEdit {
+ Q_OBJECT
+public:
+ KMEdit(QWidget *parent=0,KMComposeWin* composer=0,
+ KSpellConfig* spellConfig = 0,
+ const char *name=0);
+ ~KMEdit();
+
+ /**
+ * Start the spell checker.
+ */
+ void spellcheck();
+
+ /**
+ * Text with lines breaks inserted after every row
+ */
+ QString brokenText();
+
+ /**
+ * Toggle automatic spellchecking
+ */
+ int autoSpellChecking( bool );
+
+ /**
+ * For the external editor
+ */
+ void setUseExternalEditor( bool use ) { mUseExtEditor = use; }
+ void setExternalEditorPath( const QString & path ) { mExtEditor = path; }
+
+ /**
+ * Check that the external editor has finished and output a warning
+ * if it hasn't.
+ * @return false if the user chose to cancel whatever operation
+ * called this method.
+ */
+ bool checkExternalEditorFinished();
+
+ QPopupMenu* createPopupMenu(const QPoint&);
+ void setSpellCheckingActive(bool spellCheckingActive);
+
+ /** Drag and drop methods */
+ void contentsDragEnterEvent(QDragEnterEvent *e);
+ void contentsDragMoveEvent(QDragMoveEvent *e);
+ void contentsDropEvent(QDropEvent *e);
+
+ void deleteAutoSpellChecking();
+
+ unsigned int lineBreakColumn() const;
+
+ /** set cursor to absolute position pos */
+ void setCursorPositionFromStart(unsigned int pos);
+
+signals:
+ void spellcheck_done(int result);
+ void attachPNGImageData(const QByteArray &image);
+ void pasteImage();
+ void focusUp();
+ void focusChanged( bool );
+ void insertSnippet();
+public slots:
+ void initializeAutoSpellChecking();
+ void slotSpellcheck2(KSpell*);
+ void slotSpellResult(const QString&);
+ void slotSpellDone();
+ void slotExternalEditorDone(KProcess*);
+ void slotMisspelling(const QString &, const QStringList &, unsigned int);
+ void slotCorrected (const QString &, const QString &, unsigned int);
+ void addSuggestion(const QString& text, const QStringList& lst, unsigned int );
+ void cut();
+ void clear();
+ void del();
+ void paste();
+protected:
+ /**
+ * Event filter that does Tab-key handling.
+ */
+ bool eventFilter(QObject*, QEvent*);
+ void keyPressEvent( QKeyEvent* );
+
+ void contentsMouseReleaseEvent( QMouseEvent * e );
+
+private slots:
+ void slotExternalEditorTempFileChanged( const QString & fileName );
+
+private:
+ void killExternalEditor();
+
+private:
+ KMComposeWin* mComposer;
+
+ KSpell *mKSpell;
+ KSpellConfig *mSpellConfig;
+ QMap<QString,QStringList> mReplacements;
+ SpellingFilter* mSpellingFilter;
+ KTempFile *mExtEditorTempFile;
+ KDirWatch *mExtEditorTempFileWatcher;
+ KProcess *mExtEditorProcess;
+ bool mUseExtEditor;
+ QString mExtEditor;
+ bool mWasModifiedBeforeSpellCheck;
+ KDictSpellingHighlighter *mSpellChecker;
+ bool mSpellLineEdit;
+ QClipboard::Mode mPasteMode;
+};
+
+#endif // __KMAIL_KMEDIT_H__
+