-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCInput.h
More file actions
92 lines (69 loc) · 2.31 KB
/
CInput.h
File metadata and controls
92 lines (69 loc) · 2.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
// CInput.h - part if Multi-Language input class
//
// Copyright (C) 2000-2005, Kwon-il Lee
//
// Kwon-il Lee
// zupet@hitel.net
#if !defined(_C_INPUT_H_)
#define _C_INPUT_H_
/*----------------------------------------------------------------------------*/
int GetCharsetFromLang(LANGID);
int GetCodePageFromLang( LANGID langid );
/*----------------------------------------------------------------------------*/
class CInput
{
public:
CInput();
~CInput();
void InitInput();
/* messages */
void OnInputLanguageChange(HWND hWnd, WPARAM wParam, LPARAM lParam);
bool OnComposition(HWND hWnd, WPARAM wParam, LPARAM lParam);
bool OnEndComposition(HWND hWnd, WPARAM wParam, LPARAM lParam);
bool OnNotify(HWND hWnd, WPARAM wParam, LPARAM lParam);
bool OnChar(HWND hWnd, WPARAM wParam, LPARAM lParam);
int GetInput(char* text, int len);
int GetComp(char* text, int len);
int GetReading(char* text, int len);
int GetCandidate(DWORD index, char* text, int len);
int GetCandidateCount();
int GetCandidateSelection();
int GetCandidatePageSize();
int GetCandidatePageStart();
void GetUnderLine(int* start, int* end);
/* property */
bool IsVerticalReading(){ return m_bVerticalReading; }
bool IsVerticalCandidate(){ return m_bVerticalCandidate; }
WORD GetCodePage() { return m_codePage; }
LANGID GetLangId() { return m_langId; }
int GetCharSet() { return GetCharsetFromLang(m_langId); }
wchar_t* GetIndicator() { return m_wszCurrIndicator; }
int GetImeState() { return m_ImeState; }
protected:
void SetupImeApi(HWND hWnd);
void GetImeId();
bool GetReadingWindowOrientation();
void GetPrivateReadingString(HWND hWnd);
void CheckToggleState(HWND hWnd);
protected:
std::wstring m_input;
std::wstring m_comp;
std::wstring m_reading;
std::vector<BYTE> m_candidate;
int m_ulStart;
int m_ulEnd;
HKL m_hkl;
LANGID m_langId;
WORD m_codePage;
bool m_bUnicodeIME;
bool m_bVerticalReading;
bool m_bVerticalCandidate;
int m_ImeState;
wchar_t* m_wszCurrIndicator;
DWORD m_dwId[2];
HINSTANCE m_hDllIme;
UINT (WINAPI * _GetReadingString)( HIMC, UINT, LPWSTR, PINT, BOOL*, PUINT );
BOOL (WINAPI * _ShowReadingWindow)( HIMC, BOOL );
};
/*----------------------------------------------------------------------------*/
#endif //_C_INPUT_H_