mirror of
https://github.com/klzgrad/naiveproxy.git
synced 2024-11-28 16:26:10 +03:00
36 lines
1.7 KiB
Plaintext
36 lines
1.7 KiB
Plaintext
// Copyright 2018 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.
|
|
|
|
module chromeos.ime.mojom;
|
|
|
|
// Manages access to a set of IME engines.
|
|
interface InputEngineManager {
|
|
// Sets up the connection by binding the |to_engine_request| to the input
|
|
// engine identified by the |ime_spec|. The |extra| is an optional serialized
|
|
// protobuf data for setting up the IME engine. On success, return |success|
|
|
// as true, and the input data can be sent to the engine by the channel using
|
|
// the interface of |to_engine_request|. The channel interface |from_engine|
|
|
// is implmented on the client and used to receive data sent from the engine.
|
|
// On failure (e.g. input engine is not found), |success| is false.
|
|
ConnectToImeEngine(string ime_spec,
|
|
InputChannel& to_engine_request,
|
|
InputChannel from_engine,
|
|
array<uint8> extra)
|
|
=> (bool success);
|
|
};
|
|
|
|
// A message channel is a paired message sender and receiver, representing
|
|
// the communication channel between an client and the input engine connected.
|
|
// In order to encapsulate all the communication, (e.g. access to some
|
|
// closed-sourced input engine with decoders), implement the method that takes
|
|
// a serialized protobuf message (instead of a plaintext) as its argument.
|
|
interface InputChannel {
|
|
// Returns a plaintext result after processing a plaintext message.
|
|
ProcessText(string message) => (string result);
|
|
|
|
// Returns a serialized protobuf result after processing a serialized
|
|
// protobuf message.
|
|
ProcessMessage(array<uint8> message) => (array<uint8> result);
|
|
};
|