~stomato463/+junk/nvdajp

« back to all changes in this revision

Viewing changes to nvdaHelper/nvdajpimeRPC/tsf.h

  • Committer: Masataka Shinke
  • Date: 2011-10-25 12:35:26 UTC
  • mfrom: (4185 jpmain)
  • mto: This revision was merged to the branch mainline in revision 4211.
  • Revision ID: mshinke@users.sourceforge.jp-20111025123526-ze527a2rl3z0g2ky
lp:~nishimotz/nvdajp/main : 4185 をマージ

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
#A part of NonVisual Desktop Access (NVDA)
 
3
#Copyright (C) 2006-2010 NVDA Contributors <http://www.nvda-project.org/>
 
4
#This file is covered by the GNU General Public License.
 
5
#See the file COPYING for more details.
 
6
#
 
7
# nvdajpime
 
8
# by Masataka Shinke
 
9
*/
 
10
 
 
11
////////////////////////////////////////////////////////////////////// 
 
12
//
 
13
// tsf.h: CnvdajpimeTSF declaration
 
14
//
 
15
////////////////////////////////////////////////////////////////////// 
 
16
 
 
17
#ifndef TSF_H
 
18
#define TSF_H
 
19
 
 
20
 
 
21
class CnvdajpimeTSF : public ITfThreadMgrEventSink, 
 
22
                     public ITfTextEditSink
 
23
{
 
24
public:
 
25
    CnvdajpimeTSF();
 
26
    ~CnvdajpimeTSF();
 
27
 
 
28
    // IUnknown
 
29
    STDMETHODIMP QueryInterface(REFIID riid, void **ppvObj);
 
30
    STDMETHODIMP_(ULONG) AddRef(void);
 
31
    STDMETHODIMP_(ULONG) Release(void);
 
32
 
 
33
    // ITfThreadMgrEventSink
 
34
    STDMETHODIMP OnInitDocumentMgr(ITfDocumentMgr *pDocMgr);
 
35
    STDMETHODIMP OnUninitDocumentMgr(ITfDocumentMgr *pDocMgr);
 
36
    STDMETHODIMP OnSetFocus(ITfDocumentMgr *pDocMgrFocus, ITfDocumentMgr *pDocMgrPrevFocus);
 
37
    STDMETHODIMP OnPushContext(ITfContext *pContext);
 
38
    STDMETHODIMP OnPopContext(ITfContext *pContext);
 
39
 
 
40
    // ITfTextEditSink
 
41
    STDMETHODIMP OnEndEdit(ITfContext *pContext, TfEditCookie ecReadOnly, ITfEditRecord *pEditRecord);
 
42
 
 
43
    static BOOL Init();
 
44
    BOOL _InitThreadMgrSink();
 
45
    void _UninitThreadMgrSink();
 
46
    BOOL _InitTextEditSink(ITfDocumentMgr *pDocMgr);
 
47
 
 
48
    void _AppendCompositionText(ITfRange *pRange, TfEditCookie ecReadOnly);
 
49
    void _ClearCompositionText();
 
50
    BOOL _CheckComposition(ITfContext *pContext, TfEditCookie ecReadOnly);
 
51
 
 
52
        LONG _GetLength(ITfRange *pRange,TfEditCookie ecReadOnly);
 
53
        
 
54
        WCHAR* Diff(WCHAR* pOld,WCHAR* pNew,UINT pFirstCode,UINT pLastCode);
 
55
 
 
56
private:
 
57
    DWORD _dwThreadMgrEventSinkCookie;
 
58
    DWORD _dwTextEditSinkCookie;
 
59
    ITfContext *_pTextEditSinkContext;
 
60
    ITfThreadMgr* _pThreadMgr;
 
61
 
 
62
    WCHAR *_pszCompositionText;
 
63
    ULONG _uCompositionText;
 
64
 
 
65
    LONG _cRef;
 
66
 
 
67
 
 
68
 
 
69
        WCHAR m_text[128];
 
70
        volatile DWORD      m_lock_flags;
 
71
 
 
72
};
 
73
 
 
74
 
 
75
#endif TSF_H