summaryrefslogtreecommitdiffstats
path: root/ui/base/ime/ime_input_context_handler_interface.h
blob: b8fbb2b358be9366e128c47a0e0293e387adef0a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef UI_BASE_IME_IME_INPUT_CONTEXT_HANDLER_INTERFACE_H_
#define UI_BASE_IME_IME_INPUT_CONTEXT_HANDLER_INTERFACE_H_

#include <stdint.h>

#include <string>
#include "ui/base/ime/composition_text.h"
#include "ui/base/ime/ui_base_ime_export.h"
#include "ui/events/event.h"

namespace ui {

class UI_BASE_IME_EXPORT IMEInputContextHandlerInterface {
 public:
  // Called when the engine commit a text.
  virtual void CommitText(const std::string& text) = 0;

  // Called when the engine updates composition text.
  virtual void UpdateCompositionText(const CompositionText& text,
                                     uint32_t cursor_pos,
                                     bool visible) = 0;

  // Called when the engine request deleting surrounding string.
  virtual void DeleteSurroundingText(int32_t offset, uint32_t length) = 0;

  // Called when the engine sends a key event.
  virtual void SendKeyEvent(KeyEvent* event) = 0;
};

}  // namespace ui

#endif  // UI_BASE_IME_IME_INPUT_CONTEXT_HANDLER_INTERFACE_H_