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.

193 lines
5.2 KiB

  1. //
  2. // candcomp.cpp
  3. //
  4. #include "private.h"
  5. #include "globals.h"
  6. #include "mscandui.h"
  7. #include "candcomp.h"
  8. #include "computil.h"
  9. /*============================================================================*/
  10. /* */
  11. /* C C A N D U I C O M P A R T M E N T M G R */
  12. /* */
  13. /*============================================================================*/
  14. /* C C A N D U I C O M P A R T M E N T M G R */
  15. /*------------------------------------------------------------------------------
  16. ------------------------------------------------------------------------------*/
  17. CCandUICompartmentMgr::CCandUICompartmentMgr( void )
  18. {
  19. m_pCandUI = NULL;
  20. }
  21. /* ~ C C A N D U I C O M P A R T M E N T M G R */
  22. /*------------------------------------------------------------------------------
  23. ------------------------------------------------------------------------------*/
  24. CCandUICompartmentMgr::~CCandUICompartmentMgr( void )
  25. {
  26. }
  27. /* I N I T I A L I Z E */
  28. /*------------------------------------------------------------------------------
  29. ------------------------------------------------------------------------------*/
  30. HRESULT CCandUICompartmentMgr::Initialize( CCandidateUI *pCandUI )
  31. {
  32. m_pCandUI = pCandUI;
  33. return S_OK;
  34. }
  35. /* U N I N I T I A L I Z E */
  36. /*------------------------------------------------------------------------------
  37. ------------------------------------------------------------------------------*/
  38. HRESULT CCandUICompartmentMgr::Uninitialize( void )
  39. {
  40. m_pCandUI = NULL;
  41. return S_OK;
  42. }
  43. /* S E T U I S T Y L E */
  44. /*------------------------------------------------------------------------------
  45. ------------------------------------------------------------------------------*/
  46. HRESULT CCandUICompartmentMgr::SetUIStyle( IUnknown *punk, CANDUISTYLE style )
  47. {
  48. HRESULT hr;
  49. Assert( punk != NULL );
  50. hr = SetCompartmentDWORD( 0 /* tid */, punk, GUID_COMPARTMENT_CANDUI_UISTYLE, (DWORD)style , FALSE );
  51. return (hr == S_OK) ? S_OK : E_FAIL;
  52. }
  53. /* G E T U I S T Y L E */
  54. /*------------------------------------------------------------------------------
  55. ------------------------------------------------------------------------------*/
  56. HRESULT CCandUICompartmentMgr::GetUIStyle( IUnknown *punk, CANDUISTYLE *pstyle )
  57. {
  58. HRESULT hr;
  59. Assert( punk != NULL );
  60. Assert( pstyle != NULL );
  61. hr = GetCompartmentDWORD( punk, GUID_COMPARTMENT_CANDUI_UISTYLE, (DWORD*)pstyle , FALSE );
  62. return (hr == S_OK) ? S_OK : E_FAIL;
  63. }
  64. /* S E T U I O P T I O N */
  65. /*------------------------------------------------------------------------------
  66. ------------------------------------------------------------------------------*/
  67. HRESULT CCandUICompartmentMgr::SetUIOption( IUnknown *punk, DWORD dwOption )
  68. {
  69. HRESULT hr;
  70. Assert( punk != NULL );
  71. hr = SetCompartmentDWORD( 0 /* tid */, punk, GUID_COMPARTMENT_CANDUI_UIOPTION, dwOption , FALSE );
  72. return (hr == S_OK) ? S_OK : E_FAIL;
  73. }
  74. /* G E T U I O P T I O N */
  75. /*------------------------------------------------------------------------------
  76. ------------------------------------------------------------------------------*/
  77. HRESULT CCandUICompartmentMgr::GetUIOption( IUnknown *punk, DWORD *pdwOption )
  78. {
  79. HRESULT hr;
  80. Assert( punk != NULL );
  81. Assert( pdwOption != NULL );
  82. hr = GetCompartmentDWORD( punk, GUID_COMPARTMENT_CANDUI_UIOPTION, pdwOption , FALSE );
  83. return (hr == S_OK) ? S_OK : E_FAIL;
  84. }
  85. /* S E T K E Y T A B L E */
  86. /*------------------------------------------------------------------------------
  87. ------------------------------------------------------------------------------*/
  88. HRESULT CCandUICompartmentMgr::SetKeyTable( IUnknown *punk, CCandUIKeyTable *pCandUIKeyTable )
  89. {
  90. HRESULT hr;
  91. Assert( punk != NULL );
  92. Assert( pCandUIKeyTable != NULL );
  93. ClearCompartment( 0 /* tid */, punk, GUID_COMPARTMENT_CANDUI_KEYTABLE, FALSE );
  94. hr = SetCompartmentUnknown( 0 /*tid*/, punk, GUID_COMPARTMENT_CANDUI_KEYTABLE, (IUnknown*)pCandUIKeyTable );
  95. return (hr == S_OK) ? S_OK : E_FAIL;
  96. }
  97. /* G E T K E Y T A B L E */
  98. /*------------------------------------------------------------------------------
  99. ------------------------------------------------------------------------------*/
  100. HRESULT CCandUICompartmentMgr::GetKeyTable( IUnknown *punk, CCandUIKeyTable **ppCandUIKeyTable )
  101. {
  102. HRESULT hr;
  103. Assert( punk != NULL );
  104. Assert( ppCandUIKeyTable != NULL );
  105. hr = GetCompartmentUnknown( punk, GUID_COMPARTMENT_CANDUI_KEYTABLE, (IUnknown**)ppCandUIKeyTable );
  106. return (hr == S_OK) ? S_OK : E_FAIL;
  107. }
  108. /* C L E A R K E Y T A B L E */
  109. /*------------------------------------------------------------------------------
  110. ------------------------------------------------------------------------------*/
  111. HRESULT CCandUICompartmentMgr::ClearKeyTable( IUnknown *punk )
  112. {
  113. HRESULT hr;
  114. hr = ClearCompartment( 0 /* tid */, punk, GUID_COMPARTMENT_CANDUI_KEYTABLE, FALSE );
  115. return (hr == S_OK) ? S_OK : E_FAIL;
  116. }