import 'keyboard_android_platform_interface.dart';

class KeyboardAndroid {
  /// 获取平台版本
  Future<String?> getPlatformVersion() {
    return KeyboardAndroidPlatform.instance.getPlatformVersion();
  }

  Future<void> initPlugin() async {
    return KeyboardAndroidPlatform.instance.initPlugin();
  }

  /// 打开或关闭悬浮窗
  Future<void> enableFloatingWindow(bool enable) async {
    return KeyboardAndroidPlatform.instance.enableFloatingWindow(enable);
  }

  /// 跳转到系统的悬浮窗设置页
  Future<void> jumpFloatingWindowSetting() async {
    return KeyboardAndroidPlatform.instance.jumpFloatingWindowSetting();
  }

  /// 是否有悬浮窗权限
  Future<bool> hasFloatingWindowPermission() async {
    return KeyboardAndroidPlatform.instance.hasFloatingWindowPermission();
  }

  /// 打开输入法设置
  Future<void> openInputMethodSettings() async {
    return KeyboardAndroidPlatform.instance.openInputMethodSettings();
  }

  /// 检查目标键盘是否启用
  Future<bool> isTargetKeyboardEnabled() async {
    return KeyboardAndroidPlatform.instance.isTargetKeyboardEnabled();
  }

  /// 是否是默认输入法
  Future<bool> isDefaultKeyboard() async {
    return KeyboardAndroidPlatform.instance.isDefaultKeyboard();
  }

  /// 更新键盘信息
  void updateKeyboardInfo(String keyboardInfoJson) {
    KeyboardAndroidPlatform.instance.updateKeyboardInfo(keyboardInfoJson);
  }

  /// 刷新人设列表
  void refreshCharacterList() {
    KeyboardAndroidPlatform.instance.refreshCharacterList();
  }

  /// 刷新数据
  void refreshData() {
    KeyboardAndroidPlatform.instance.refreshData();
  }

  // /// 获取键映射
  // static Future<List<Map<String, String>>> getKeyMappings() {
  //   return KeyboardAndroidPlatform.instance.getKeyMappings();
  // }
  //
  // /// 设置键映射
  // static Future<bool> setKeyMappings(List<Map<String, String>> mappings) {
  //   return KeyboardAndroidPlatform.instance.setKeyMappings(mappings);
  // }
  //
  // /// 通过方法名获取动态文本
  // static Future<String?> getDynamicText(String method) {
  //   return KeyboardAndroidPlatform.instance.getDynamicText(method);
  // }
}
