IMEManager.h 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. /*
  2. ** Command & Conquer Generals(tm)
  3. ** Copyright 2025 Electronic Arts Inc.
  4. **
  5. ** This program is free software: you can redistribute it and/or modify
  6. ** it under the terms of the GNU General Public License as published by
  7. ** the Free Software Foundation, either version 3 of the License, or
  8. ** (at your option) any later version.
  9. **
  10. ** This program is distributed in the hope that it will be useful,
  11. ** but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. ** GNU General Public License for more details.
  14. **
  15. ** You should have received a copy of the GNU General Public License
  16. ** along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. ////////////////////////////////////////////////////////////////////////////////
  19. // //
  20. // (c) 2001-2003 Electronic Arts Inc. //
  21. // //
  22. ////////////////////////////////////////////////////////////////////////////////
  23. //----------------------------------------------------------------------------
  24. //
  25. // Westwood Studios Pacific.
  26. //
  27. // Confidential Information
  28. // Copyright (C) 2001 - All Rights Reserved
  29. //
  30. //----------------------------------------------------------------------------
  31. //
  32. // Project: Generals
  33. //
  34. // Module: IME
  35. //
  36. // File name: GameClient/IMEManager.h
  37. //
  38. // Created: 11/14/01 TR
  39. //
  40. //----------------------------------------------------------------------------
  41. #pragma once
  42. #ifndef __GAMECLIENT_IMEMANAGER_H
  43. #define __GAMECLIENT_IMEMANAGER_H
  44. //----------------------------------------------------------------------------
  45. // Includes
  46. //----------------------------------------------------------------------------
  47. #include "Lib/BaseType.h"
  48. #include "Common/SubsystemInterface.h"
  49. #include "Common/UnicodeString.h"
  50. //----------------------------------------------------------------------------
  51. // Forward References
  52. //----------------------------------------------------------------------------
  53. class GameWindow;
  54. class UnicodeString;
  55. //----------------------------------------------------------------------------
  56. // Type Defines
  57. //----------------------------------------------------------------------------
  58. //===============================
  59. // IMEManagerInterface
  60. //===============================
  61. class IMEManagerInterface : public SubsystemInterface
  62. {
  63. public:
  64. virtual ~IMEManagerInterface() {};
  65. virtual void attach( GameWindow *window ) = 0; ///< attach IME to specified window
  66. virtual void detatch( void ) = 0; ///< detatch IME from current window
  67. virtual void enable( void ) = 0; ///< Enable IME
  68. virtual void disable( void ) = 0; ///< Disable IME
  69. virtual Bool isEnabled( void ) = 0; ///< Is IME enabled
  70. virtual Bool isAttachedTo( GameWindow *window ) = 0; ///< Is the manager currently attached to the window
  71. virtual GameWindow* getWindow( void ) = 0; ///< Returns the window we are currently attached to
  72. virtual Bool isComposing( void ) = 0; ///< Manager is currently composing new input string
  73. virtual void getCompositionString( UnicodeString &string ) = 0; ///< Return the current composition string
  74. virtual Int getCompositionCursorPosition( void ) =0; ///< Returns the composition cursor position
  75. virtual Int getIndexBase( void ) = 0; ///< Get index base for candidate list
  76. virtual Int getCandidateCount() = 0; ///< Returns the total number of candidates
  77. virtual UnicodeString*getCandidate( Int index ) = 0; ///< Returns the candidate string
  78. virtual Int getSelectedCandidateIndex() = 0; ///< Returns the indexed of the currently selected candidate
  79. virtual Int getCandidatePageSize() = 0; ///< Returns the page size for the candidates list
  80. virtual Int getCandidatePageStart() = 0; ///< Returns the index of the first visibel candidate
  81. /// Checks for and service IME messages. Returns TRUE if message serviced
  82. virtual Bool serviceIMEMessage( void *windowsHandle,
  83. UnsignedInt message,
  84. Int wParam,
  85. Int lParam ) = 0;
  86. virtual Int result( void ) = 0; ///< result return value of last serviced IME message
  87. };
  88. extern IMEManagerInterface *TheIMEManager;
  89. extern IMEManagerInterface *CreateIMEManagerInterface( void );
  90. //----------------------------------------------------------------------------
  91. // Inlining
  92. //----------------------------------------------------------------------------
  93. #endif // __GAMECLIENT_IMEMANAGER_H