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.

114 lines
3.7 KiB

  1. /*++
  2. Copyright (c) 2001, Microsoft Corporation
  3. Module Name:
  4. candpos.h
  5. Abstract:
  6. This file defines the CCandidatePosition Class.
  7. Author:
  8. Revision History:
  9. Notes:
  10. --*/
  11. #ifndef _CANDPOS_H_
  12. #define _CANDPOS_H_
  13. #include "imc.h"
  14. #include "tls.h"
  15. #include "ctxtcomp.h"
  16. #include "context.h"
  17. #include "uicomp.h"
  18. class CCandidatePosition
  19. {
  20. public:
  21. CCandidatePosition(TfClientId tid,
  22. Interface_Attach<ITfContext> pic,
  23. LIBTHREAD* pLibTLS)
  24. : m_tid(tid), m_ic(pic), m_pLibTLS(pLibTLS)
  25. {
  26. }
  27. virtual ~CCandidatePosition() { }
  28. HRESULT GetCandidatePosition(IN IMCLock& imc,
  29. IN CicInputContext& CicContext,
  30. IN IME_UIWND_STATE uists,
  31. IN LANGID langid,
  32. OUT RECT* out_rcArea);
  33. HRESULT GetRectFromApp(IN IMCLock& imc,
  34. IN CicInputContext& CicContext,
  35. IN LANGID langid,
  36. OUT RECT* out_rcArea);
  37. private:
  38. HRESULT GetRectFromHIMC(IN IMCLock& imc,
  39. IN BOOL fCandForm,
  40. IN DWORD dwStyle,
  41. IN POINT* ptCurrentPos,
  42. IN RECT* rcArea,
  43. OUT RECT* out_rcArea);
  44. HRESULT GetCandidateArea(IN IMCLock& imc,
  45. IN DWORD dwStyle,
  46. IN POINT* ptCurrentPos,
  47. IN RECT* rcArea,
  48. OUT RECT* out_rcArea);
  49. HRESULT GetRectFromCompFont(IN IMCLock& imc,
  50. IN POINT* ptCurrentPos,
  51. OUT RECT* out_rcArea);
  52. HRESULT FindAttributeInCompositionString(IN IMCLock& imc,
  53. IN BYTE target_attribute,
  54. OUT CWCompCursorPos& wCursorPosition);
  55. DWORD GetCharPos(IMCLock& imc, LANGID langid);
  56. //
  57. // Edit session helper
  58. //
  59. HRESULT EscbGetTextAndAttribute(IMCLock& imc, CWCompString* wCompString, CWCompAttribute* wCompAttribute)
  60. {
  61. return ::EscbGetTextAndAttribute(imc, m_tid, m_ic, m_pLibTLS, wCompString, wCompAttribute);
  62. }
  63. HRESULT EscbGetCursorPosition(IMCLock& imc, CWCompCursorPos* wCursorPosition)
  64. {
  65. return ::EscbGetCursorPosition(imc, m_tid, m_ic, m_pLibTLS, wCursorPosition);
  66. }
  67. HRESULT EscbGetStartEndSelection(IMCLock& imc, CWCompCursorPos& wStartSelection, CWCompCursorPos& wEndSelection)
  68. {
  69. return ::EscbGetStartEndSelection(imc, m_tid, m_ic, m_pLibTLS, wStartSelection, wEndSelection);
  70. }
  71. //
  72. // Edit session friend
  73. //
  74. private:
  75. friend HRESULT EscbGetTextAndAttribute(IMCLock& imc, TfClientId tid, Interface_Attach<ITfContext> pic, LIBTHREAD* pLibTLS,
  76. CWCompString* wCompString,
  77. CWCompAttribute* wCompAttribute);
  78. friend HRESULT EscbGetCursorPosition(IMCLock& imc, TfClientId tid, Interface_Attach<ITfContext> pic, LIBTHREAD* pLibTLS,
  79. CWCompCursorPos* wCursorPosition);
  80. friend HRESULT EscbGetStartEndSelection(IMCLock& imc, TfClientId tid, Interface_Attach<ITfContext> pic, LIBTHREAD* pLibTLS,
  81. CWCompCursorPos& wStartSelection,
  82. CWCompCursorPos& wEndSelection);
  83. private:
  84. Interface_Attach<ITfContext> m_ic;
  85. TfClientId m_tid;
  86. LIBTHREAD* m_pLibTLS;
  87. };
  88. #endif // _CANDPOS_H_