harmony 鸿蒙Input Method Framework

  • 2023-10-30
  • 浏览 (507)

Input Method Framework

Introduction

The input method framework is responsible for establishing a communication channel between the application in which the edit box is located and the input method application, to ensure that the two can jointly provide text input, and also enables system applications to manage the input method application.

The input method framework has four modules:

  1. Application

Path: /base/inputmethod/imf/frameworks/native/inputmethod_controller

Function: enables an application to request the use of and interaction with the input method application.

  1. Input method application

Path: /base/inputmethod/imf/frameworks/native/inputmethod_ability

Function: provides an input method application implementation framework. Based on the framework, the input method application can be correctly started, and collaborates with the edit box application to complete text input.

  1. Input method engine

Path: /base/inputmethod/imf/services

Function: responsible for establishing secure and reliable connections with the input method and providing features such as input method switching and query.

  1. Input method JS API implementation

Path: /base/inputmethod/imf/frameworks/js

  • JS API implementation provided for input method applications: /base/inputmethod/imf/frameworks/js/napi/inputmethodability

  • JS API implementation provided for the self-drawing components: /base/inputmethod/imf/frameworks/js/napi/inputmethodclient.

Function: provides specific implementation for TS-related APIs.

System Architecture

Figure 1 Architecture

Input method framework

Directory Structure

/base/inputmethod/imf
├── figures                                     # Architecture diagram
├── frameworks
│   └── js/napi                                 # Native APIs of the input method framework
│       └──inputmethod_extention_ability        # InputMethodExtentionAbility related APIs for input method applications
│       └──inputmethod_extention_context        # InputMethodExtentionContext related APIs for input method applications
│       └──inputmethodability                   # APIs provided for input method applications
│       └──inputmethodclient                    # APIs provided by the system applications and self-drawing components
│   └── native
│       └──inputmethod_ability                  # APIs provided for input method applications
│       └──inputmethod_controller               # APIs provided for the application
├── interfaces                                  # APIs provided by the components for external systems
│   └── inner_api                               # Inner APIs
├── profile                                     # Configuration files of system services and processes contained in the components
├── services                                    # Input method engine
├── test                                        # Tests
│   └── fuzztest                                # Fuzz test of APIs
│   └── unitest                                 # Unit test of APIs
│       └──cpp_test                             # CPP unit test of APIs
│       └──napi_test                            # JS unit test of APIs

How to Use

Repositories Involved

Input method framework

inputmethod_imf

你可能感兴趣的鸿蒙文章

harmony 鸿蒙ArkCompiler Runtime

harmony 鸿蒙DeviceProfile

harmony 鸿蒙System Ability Manager

harmony 鸿蒙Security

harmony 鸿蒙Ability Framework

harmony 鸿蒙Account

harmony 鸿蒙AI

harmony 鸿蒙ArkUI

harmony 鸿蒙Bundle Management

harmony 鸿蒙Common Event and Notification

0  赞