• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2021 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
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  */
15 
16 #ifndef FM_IMMS_PROJECT_IINPUTMETHODCORE_H
17 #define FM_IMMS_PROJECT_IINPUTMETHODCORE_H
18 #include "iremote_broker.h"
19 #include "i_input_data_channel.h"
20 #include "i_input_control_channel.h"
21 #include "ipc_types.h"
22 #include "input_attribute.h"
23 #include "keyboard_type.h"
24 #include "input_channel.h"
25 #include "global.h"
26 
27 /**
28  * brief Definition of interface IInputMethodCore
29  * It defines the remote calls from input method management service to input method service
30  */
31 namespace OHOS {
32 namespace MiscServices {
33     class IInputMethodCore : public IRemoteBroker {
34     public:
35         enum {
36             INITIALIZE_INPUT = FIRST_CALL_TRANSACTION,
37             SET_CLIENT_STATE,
38             START_INPUT,
39             STOP_INPUT,
40             SHOW_KEYBOARD,
41             STOP_INPUT_SERVICE,
42             HIDE_KEYBOARD,
43             SET_KEYBOARD_TYPE,
44             GET_KEYBOARD_WINDOW_HEIGHT,
45             INIT_INPUT_CONTROL_CHANNEL
46         };
47 
48         DECLARE_INTERFACE_DESCRIPTOR(u"ohos.miscservices.inputmethod.IInputMethodCore");
49 
50         virtual int32_t initializeInput(sptr<IRemoteObject>& startInputToken, int32_t displayId,
51                                         sptr<IInputControlChannel>& inputControlChannel) = 0;
52         virtual bool startInput(const sptr<IInputDataChannel>& startInputToken,
53                                 const InputAttribute& editorAttribute,
54                                 bool supportPhysicalKbd) = 0;
55         virtual int32_t stopInput() = 0;
56         virtual bool showKeyboard(const sptr<IInputDataChannel>& inputDataChannel) = 0;
57         virtual bool hideKeyboard(int32_t flags) = 0;
58         virtual int32_t setKeyboardType(const KeyboardType& type) = 0;
59         virtual int32_t getKeyboardWindowHeight(int32_t retHeight) = 0;
60         virtual int32_t InitInputControlChannel(sptr<IInputControlChannel> &inputControlChannel) = 0;
61         virtual void SetClientState(bool state) = 0;
62         virtual void StopInputService(std::string imeId) = 0;
63     };
64 }
65 }
66 #endif // FM_IMMS_PROJECT_IINPUTMETHODCORE_H
67