• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2023 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 KEYINPUT_H
17 #define KEYINPUT_H
18 
19 #include <cstdint>
20 #include <vector>
21 #include <string>
22 
23 class KeyInput {
24 public:
SetKeyEvent(const int32_t keyCodeVal,const int32_t keyActionVal,const std::vector<int32_t> pressedCodesVal,const std::string keyStrVal)25     virtual void SetKeyEvent(const int32_t keyCodeVal, const int32_t keyActionVal,
26                              const std::vector<int32_t> pressedCodesVal,
27                              const std::string keyStrVal) {};
SetCodePoint(const unsigned int codePointVal)28     virtual void SetCodePoint(const unsigned int codePointVal) {};
DispatchOsInputMethodEvent()29     virtual void DispatchOsInputMethodEvent() const {};
DispatchOsKeyEvent()30     virtual void DispatchOsKeyEvent() const {};
31 
32 protected:
33     KeyInput();
~KeyInput()34     virtual ~KeyInput() {}
35     unsigned int codePoint; // unicode for IME
36     int32_t keyCode;
37     int32_t keyAction;
38     std::string keyString;
39 };
40 
41 #endif // KEYINPUT_H
42