IWithIme.cs 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. // Copyright (c) 2024 Vuplex Inc. All rights reserved.
  2. //
  3. // Licensed under the Vuplex Commercial Software Library License, you may
  4. // not use this file except in compliance with the License. You may obtain
  5. // a copy of the License at
  6. //
  7. // https://vuplex.com/commercial-library-license
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. using System;
  15. using UnityEngine;
  16. namespace Vuplex.WebView {
  17. /// <summary>
  18. /// An interface implemented by a webview if it supports Input Method Editor (IME) for
  19. /// inputting Chinese, Japanese, and Korean text. On Windows and macOS, if keyboard support
  20. /// is enabled via WebViewPrefab.KeyboardEnabled, then IME is automatically enabled
  21. /// (implemented with this interface). For an example of using this interface, please see
  22. /// 3D WebView's KeyboardManager.cs script.
  23. /// </summary>
  24. public interface IWithIme {
  25. /// <summary>
  26. /// Indicates that the coordinates of the IME text composition within the browser changed.
  27. /// </summary>
  28. event EventHandler<EventArgs<Vector2Int>> ImeInputFieldPositionChanged;
  29. /// <summary>
  30. /// Cancels the current IME composition.
  31. /// </summary>
  32. void CancelImeComposition();
  33. /// <summary>
  34. /// Finishes the current IME composition with the given text.
  35. /// </summary>
  36. void FinishImeComposition(string text);
  37. /// <summary>
  38. /// Updates the current IME composition with the given text, or starts a new composition
  39. /// if one isn't already in progress.
  40. /// </summary>
  41. void SetImeComposition(string text);
  42. }
  43. }