summaryrefslogtreecommitdiff
path: root/plugins/SpellChecker/RichEdit.h
diff options
context:
space:
mode:
authorVadim Dashevskiy <watcherhd@gmail.com>2012-05-19 11:12:34 +0000
committerVadim Dashevskiy <watcherhd@gmail.com>2012-05-19 11:12:34 +0000
commit927add1b301c9f38808f3d35854d3ce896bff095 (patch)
tree244dfff95aee5393ec835e5804252ff8cf07866d /plugins/SpellChecker/RichEdit.h
parente447995b61b645d48ebe837a0ee4fdb28373aa1c (diff)
adding SpellChecker plugin
git-svn-id: http://svn.miranda-ng.org/main/trunk@69 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/SpellChecker/RichEdit.h')
-rw-r--r--plugins/SpellChecker/RichEdit.h71
1 files changed, 71 insertions, 0 deletions
diff --git a/plugins/SpellChecker/RichEdit.h b/plugins/SpellChecker/RichEdit.h
new file mode 100644
index 0000000000..e8b4101be4
--- /dev/null
+++ b/plugins/SpellChecker/RichEdit.h
@@ -0,0 +1,71 @@
+#ifndef __RICHEDIT_H__
+#define __RICHEDIT_H__
+
+#include <windows.h>
+#include <richedit.h>
+#include <tom.h>
+#include <richole.h>
+
+
+class RichEdit
+{
+ HWND hwnd;
+ IRichEditOle *ole;
+ ITextDocument *textDocument;
+
+ int stopped;
+ BOOL undoEnabled;
+ POINT old_scroll_pos;
+ CHARRANGE old_sel;
+ POINT caretPos;
+ DWORD old_mask;
+ BOOL inverse;
+
+public:
+ RichEdit(HWND hwnd);
+ ~RichEdit();
+
+ bool IsValid() const;
+ HWND GetHWND() const;
+
+ LRESULT SendMessage(UINT Msg, WPARAM wParam, LPARAM lParam) const;
+
+ bool IsReadOnly() const;
+
+ void SuspendUndo();
+ void ResumeUndo();
+ void Stop();
+ void Start();
+ BOOL IsStopped();
+
+ int GetCharFromPos(const POINT &pt);
+
+ int GetLineCount() const;
+ void GetLine(int line, TCHAR *text, size_t text_len) const;
+ int GetLineLength(int line) const;
+ int GetFirstCharOfLine(int line) const;
+ int GetLineFromChar(int charPos) const;
+
+ CHARRANGE GetSel() const;
+ void SetSel(int start, int end);
+ void SetSel(const CHARRANGE &sel);
+
+ TCHAR *GetText(int start, int end) const;
+ int GetTextLength() const;
+
+ void ReplaceSel(const TCHAR *new_text);
+ int Replace(int start, int end, const TCHAR *new_text);
+ int Insert(int pos, const TCHAR *text);
+ int Delete(int start, int end);
+
+private:
+ void SetHWND(HWND hwnd);
+
+ int FixSel(CHARRANGE *to_fix, CHARRANGE sel_changed, int new_len);
+};
+
+
+
+
+
+#endif // __RICHEDIT_H__