Files
miscservices_inputmethod/frameworks/inputmethod_controller/include/input_method_utils.h
T
jiangdayuan 98a576bd20 输入法联调Ace
Signed-off-by: jiangdayuan <jiangdayuan@huawei.com>
Change-Id: I1b7337395d7bdc198054f09beacaee0b7bde6d19
2021-12-25 20:50:25 +08:00

118 lines
2.8 KiB
C++

/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef FM_IMC_PROJECT_INPUT_METHOD_UTILS_H
#define FM_IMC_PROJECT_INPUT_METHOD_UTILS_H
#include <stdint.h>
namespace OHOS {
namespace MiscServices {
enum class EnterKeyType {
UNSPECIFIED = 0,
NONE,
GO,
SEARCH,
SEND,
NEXT,
DONE,
PREVIOUS
};
enum class TextInputType {
TEXT = 0,
MULTILINE,
NUMBER,
PHONE,
DATETIME,
EMAIL_ADDRESS,
URL,
VISIBLE_PASSWORD,
};
class Configuration {
public:
EnterKeyType GetEnterKeyType() const
{
return enterKeyType;
}
void SetEnterKeyType(EnterKeyType keyType)
{
enterKeyType = keyType;
}
TextInputType GetTextInputType() const
{
return textInputType;
}
void SetTextInputType(TextInputType textType)
{
textInputType = textType;
}
private:
EnterKeyType enterKeyType = EnterKeyType::UNSPECIFIED;
TextInputType textInputType = TextInputType::TEXT;
};
struct CursorInfo {
double left = 0.0;
double top = 0.0;
double width = 0.0;
double height = 0.0;
};
class KeyEvent {
};
enum class KeyboardStatus {
NONE = 0,
HIDE,
SHOW
};
enum class FunctionKey {
NONE = 0,
CONFIRM,
};
class KeyboardInfo {
public:
KeyboardStatus GetKeyboardStatus() const
{
return keyboardStatus;
}
void SetKeyboardStatus(int32_t status)
{
keyboardStatus = static_cast<KeyboardStatus>(status);
}
FunctionKey GetFunctionKey() const
{
return functionKey;
}
void SetFunctionKey(int32_t key)
{
functionKey = static_cast<FunctionKey>(key);
}
private:
KeyboardStatus keyboardStatus = KeyboardStatus::NONE;
FunctionKey functionKey = FunctionKey::NONE;
};
}
}
#endif // FM_IMC_PROJECT_INPUT_METHOD_UTILS_H