• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2022 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 SERVICES_INCLUDE_I_INPUT_METHOD_SYSTEM_ABILITY_H
17 #define SERVICES_INCLUDE_I_INPUT_METHOD_SYSTEM_ABILITY_H
18 
19 #include <errors.h>
20 
21 #include <memory>
22 #include <vector>
23 
24 #include "event_status_manager.h"
25 #include "global.h"
26 #include "i_input_client.h"
27 #include "i_input_data_channel.h"
28 #include "i_input_method_core.h"
29 #include "input_attribute.h"
30 #include "input_client_info.h"
31 #include "input_method_property.h"
32 #include "input_method_status.h"
33 #include "input_window_info.h"
34 #include "iremote_broker.h"
35 #include "message_parcel.h"
36 
37 namespace OHOS {
38 namespace MiscServices {
39 class IInputMethodSystemAbility : public IRemoteBroker {
40 public:
41     DECLARE_INTERFACE_DESCRIPTOR(u"ohos.miscservices.inputmethod.IInputMethodSystemAbility");
42 
43     virtual int32_t PrepareInput(InputClientInfo &clientInfo) = 0;
44     virtual int32_t StartInput(sptr<IInputClient> client, bool isShowKeyboard, bool attachFlag) = 0;
45     virtual int32_t ShowCurrentInput() = 0;
46     virtual int32_t HideCurrentInput() = 0;
47     virtual int32_t StopInputSession() = 0;
48     virtual int32_t StopInput(sptr<IInputClient> client) = 0;
49     virtual int32_t ReleaseInput(sptr<IInputClient> client) = 0;
50     virtual std::shared_ptr<Property> GetCurrentInputMethod() = 0;
51     virtual std::shared_ptr<SubProperty> GetCurrentInputMethodSubtype() = 0;
52     virtual int32_t ListInputMethod(InputMethodStatus status, std::vector<Property> &props) = 0;
53     virtual int32_t DisplayOptionalInputMethod() = 0;
54     virtual int32_t SetCoreAndAgent(sptr<IInputMethodCore> core, sptr<IInputMethodAgent> agent) = 0;
55     virtual int32_t ListCurrentInputMethodSubtype(std::vector<SubProperty> &subProps) = 0;
56     virtual int32_t ListInputMethodSubtype(const std::string &name, std::vector<SubProperty> &subProps) = 0;
57     virtual int32_t SwitchInputMethod(const std::string &bundleName, const std::string &name) = 0;
58     virtual int32_t PanelStatusChange(const InputWindowStatus &status, const InputWindowInfo &windowInfo) = 0;
59     virtual int32_t UpdateListenEventFlag(InputClientInfo &clientInfo, EventType eventType) = 0;
60 
61     // Deprecated because of no permission check, and keep for compatibility
62     virtual int32_t HideCurrentInputDeprecated() = 0;
63     virtual int32_t ShowCurrentInputDeprecated() = 0;
64     virtual int32_t DisplayOptionalInputMethodDeprecated() = 0;
65 };
66 } // namespace MiscServices
67 } // namespace OHOS
68 #endif // SERVICES_INCLUDE_I_INPUT_METHOD_SYSTEM_ABILITY_H
69