Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

87 lines
2.8 KiB

  1. // --------------------------------------------------------------------------------------------------------
  2. //
  3. // File Name: adddelete.h
  4. //
  5. // This file declares CAddDeleteWord class, which is used to handle SR AddRemove Word UI case.
  6. //
  7. // User can open Add/Remove Word dialog by click speech tools -- Add/Delete word item
  8. //
  9. // Or select the same document range twice.
  10. //
  11. // --------------------------------------------------------------------------------------------------------
  12. #ifndef _ADDDELETE_H
  13. #define _ADDDELETE_H
  14. #include "sapilayr.h"
  15. class CSapiIMX;
  16. class CSpTask;
  17. #define MAX_SELECTED 20
  18. #define MAX_DELIMITER 34
  19. class __declspec(novtable) CAddDeleteWord
  20. {
  21. public:
  22. CAddDeleteWord(CSapiIMX *psi);
  23. virtual ~CAddDeleteWord( );
  24. ITfRange *GetLastUsedIP(void) {return m_cpRangeLastUsedIP;}
  25. void SaveLastUsedIPRange( )
  26. {
  27. // When m_fCurIPIsSelection is true, means this current IP is selected by user.
  28. if ( m_fCurIPIsSelection && m_cpRangeOrgIP )
  29. {
  30. m_cpRangeLastUsedIP.Release();
  31. m_cpRangeLastUsedIP = m_cpRangeOrgIP; // comptr addrefs
  32. }
  33. }
  34. HRESULT SaveCurIPAndHandleAddDelete_InjectFeedbackUI( );
  35. HRESULT _SaveCurIPAndHandleAddDeleteUI(TfEditCookie ec, ITfContext *pic);
  36. HRESULT _HandleAddDeleteWord(TfEditCookie ec,ITfContext *pic);
  37. HRESULT DisplayAddDeleteUI(WCHAR *pwzInitWord, ULONG cchSize);
  38. HRESULT _DisplayAddDeleteUI(void);
  39. BOOL WasAddDeleteUIOpened( ) { return m_fAddDeleteUIOpened; }
  40. static INT_PTR CALLBACK DlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
  41. static void SetThis(HWND hWnd, LPARAM lParam)
  42. {
  43. SetWindowLongPtr(hWnd, DWLP_USER, (LONG_PTR)lParam);
  44. }
  45. static CAddDeleteWord *GetThis(HWND hWnd)
  46. {
  47. CAddDeleteWord *p = (CAddDeleteWord *)GetWindowLongPtr(hWnd, DWLP_USER);
  48. Assert(p != NULL);
  49. return p;
  50. }
  51. BOOL OnCommand(HWND hDlg, WPARAM wParam, LPARAM lParam);
  52. static WCHAR m_Delimiter[MAX_DELIMITER];
  53. private:
  54. CSapiIMX *m_psi;
  55. CSpTask *_pCSpTask;
  56. BOOL m_fCurIPIsSelection;
  57. BOOL m_fMessagePopUp; // If the message pop up
  58. BOOL m_fToOpenAddDeleteUI; // If user wants to open Add/delete word by select the same range twice.
  59. BOOL m_fAddDeleteUIOpened; // If the Add/delete UI window was opened.
  60. BOOL m_fInDisplayAddDeleteUI; // TRUE if we're in the middle of
  61. // showing the UI
  62. // the last used IP Range
  63. CComPtr<ITfRange> m_cpRangeLastUsedIP;
  64. // the original IP Range right before user starts to speak
  65. CComPtr<ITfRange> m_cpRangeOrgIP;
  66. CSpDynamicString m_dstrInitWord;
  67. };
  68. #endif // _ADDDELETE_H