• 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_IMC_PROJECT_INPUTMETHODSYSTEMABILITYPROXY_H
17 #define FM_IMC_PROJECT_INPUTMETHODSYSTEMABILITYPROXY_H
18 
19 #include <vector>
20 #include "iremote_proxy.h"
21 #include "i_input_method_system_ability.h"
22 #include "message_parcel.h"
23 #include "keyboard_type.h"
24 #include "input_method_property.h"
25 #include "input_client_stub.h"
26 #include "input_data_channel_stub.h"
27 #include "input_attribute.h"
28 #include "global.h"
29 
30 namespace OHOS {
31 namespace MiscServices {
32     class InputDataChannelStub;
33     class InputMethodSystemAbilityProxy : public IRemoteProxy<IInputMethodSystemAbility> {
34     public:
35         explicit InputMethodSystemAbilityProxy(const sptr<IRemoteObject> &object);
36         ~InputMethodSystemAbilityProxy() = default;
37         DISALLOW_COPY_AND_MOVE(InputMethodSystemAbilityProxy);
38 
39         virtual void prepareInput(MessageParcel& data) override;
40         virtual void releaseInput(MessageParcel& data) override;
41         virtual void startInput(MessageParcel& data) override;
42         virtual void stopInput(MessageParcel& data) override;
43         virtual void SetCoreAndAgent(MessageParcel& data) override;
44         virtual void HideCurrentInput(MessageParcel& data) override;
45 
46         int32_t Prepare(int32_t displayId, sptr<InputClientStub> &client, sptr<InputDataChannelStub> &channel,
47                         InputAttribute &attribute);
48         int32_t Release(sptr<InputClientStub> &client);
49         int32_t Start(sptr<InputClientStub> &client);
50         int32_t Stop(sptr<InputClientStub> &client);
51 
52         virtual void displayOptionalInputMethod(MessageParcel& data) override;
53         virtual int32_t getDisplayMode(int32_t retMode) override;
54         virtual int32_t getKeyboardWindowHeight(int32_t retHeight) override;
55         virtual int32_t getCurrentKeyboardType(KeyboardType *retType) override;
56         virtual int32_t listInputMethodEnabled(std::vector<InputMethodProperty*> *properties) override;
57         virtual int32_t listInputMethod(std::vector<InputMethodProperty*> *properties) override;
58         virtual int32_t listKeyboardType(const std::u16string& imeId, std::vector<KeyboardType*> *types) override;
59 
60     private:
61         static inline BrokerDelegator<InputMethodSystemAbilityProxy> delegator_;
62     };
63 }
64 }
65 #endif